From: Alan Cox Date: Sat, 20 May 2017 22:59:32 +0000 (+0100) Subject: v68-banked: Fix various silly things X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=c7eb0b3512395e9ab1533d8b9aeffeacee701d09;p=FUZIX.git v68-banked: Fix various silly things This gets us to the point we hit fork. Our fork() path then fails for reasons still under investigation. --- diff --git a/Kernel/platform-v68-banked/main.c b/Kernel/platform-v68-banked/main.c index 1426b938..451869c7 100644 --- a/Kernel/platform-v68-banked/main.c +++ b/Kernel/platform-v68-banked/main.c @@ -33,9 +33,10 @@ void pagemap_init(void) uaddr_t ramtop; uint8_t need_resched; +/* Each process is mapped into the same banked address */ uaddr_t pagemap_base(void) { - return 0x20000UL; + return MAPBASE; } uint8_t platform_param(char *p) diff --git a/Kernel/platform-v68-banked/p68000.S b/Kernel/platform-v68-banked/p68000.S index f12371a7..22021f19 100644 --- a/Kernel/platform-v68-banked/p68000.S +++ b/Kernel/platform-v68-banked/p68000.S @@ -154,7 +154,7 @@ outcharw: ; support bank switching while handling swap. ; devide_read_data: - move.l blk_op,a0 + lea.l blk_op,a0 move.b 4(a0),d0 move.b $00F05000,d1 cmp.b #2,d0 @@ -162,6 +162,7 @@ devide_read_data: move.b 5(a0),$00F05000 notswap: move.w #255,d0 + move.l (a0),a0 devide_read_l: move.w $00F01000,(a0)+ dbra d0,devide_read_l @@ -169,7 +170,7 @@ devide_read_l: rts devide_write_data: - move.l blk_op,a0 + lea.l blk_op,a0 move.b 4(a0),d0 move.b $00F05000,d1 cmp.b #2,d0 @@ -177,6 +178,7 @@ devide_write_data: move.b 5(a0),$00F05000 notswapw: move.w #255,d0 + move.l (a0),a0 devide_write_l: move.w (a0)+,$00F01000 dbra d0,devide_write_l diff --git a/Kernel/platform-v68-banked/tricks.S b/Kernel/platform-v68-banked/tricks.S index fcc00022..6018ca4f 100644 --- a/Kernel/platform-v68-banked/tricks.S +++ b/Kernel/platform-v68-banked/tricks.S @@ -62,6 +62,9 @@ idling: mov.b #P_RUNNING,P_TAB__P_STATUS_OFFSET(a0) movem.l (sp)+,a0/a2-a4/a6/d2-d7 addq #2,sp +; +; FIXME: check if in interrupt and if so don't restore IRQ ? +; and #$F8FF,sr rts @@ -244,7 +247,7 @@ bankfork: ; ; move.l d2,-(sp) - move.l #$02000000,a0 ; process base + move.l #$00200000,a0 ; process base move.b $FFF05000,d1 ; parent page copyloop: @@ -252,7 +255,7 @@ copyloop: move.l (a0),d0 move.b d2,$FFF05000 ; child bank move.l d0,(a0)+ - cmp.l #$03000000,a0 + cmp.l #$00300000,a0 bne copyloop ; Return with child bank paged as we want it move.l (sp)+,d2 ; we swapped stack but copied d2