v68-banked: Fix various silly things
authorAlan Cox <alan@linux.intel.com>
Sat, 20 May 2017 22:59:32 +0000 (23:59 +0100)
committerAlan Cox <alan@linux.intel.com>
Sat, 20 May 2017 22:59:32 +0000 (23:59 +0100)
This gets us to the point we hit fork. Our fork() path then fails for
reasons still under investigation.

Kernel/platform-v68-banked/main.c
Kernel/platform-v68-banked/p68000.S
Kernel/platform-v68-banked/tricks.S

index 1426b93..451869c 100644 (file)
@@ -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)
index f12371a..22021f1 100644 (file)
@@ -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
index fcc0002..6018ca4 100644 (file)
@@ -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