Kernel: Tidy up p112 and n8vem-mark4 targets, remove redundant code and merge memory...
authorWill Sowerbutts <will@sowerbutts.com>
Sat, 27 Dec 2014 11:22:22 +0000 (11:22 +0000)
committerWill Sowerbutts <will@sowerbutts.com>
Sat, 27 Dec 2014 11:40:24 +0000 (11:40 +0000)
Kernel/cpu-z180/z180.s
Kernel/platform-n8vem-mark4/README
Kernel/platform-n8vem-mark4/cpmload.s [deleted file]
Kernel/platform-n8vem-mark4/mark4.s
Kernel/platform-p112/README
Kernel/platform-p112/main.c
Kernel/platform-p112/p112.s

index 10bbd20..48cc4fe 100644 (file)
@@ -26,6 +26,9 @@
         .globl _switchout
         .globl _dofork
         .globl map_kernel
+        .globl map_process_always
+        .globl map_save
+        .globl map_restore
         .globl unix_syscall_entry
         .globl null_handler
         .globl nmi_handler
@@ -720,3 +723,53 @@ switchinfail:
         ld hl, #badswitchmsg
         call outstring
         jp _trap_monitor
+
+map_kernel: ; map the kernel into the low 60K, leaves common memory unchanged
+        push af
+.if DEBUGBANK
+        ld a, #'K'
+        call outchar
+.endif
+        ld a, #(OS_BANK + FIRST_RAM_BANK)
+        out0 (MMU_BBR), a
+        pop af
+        ret
+
+map_process_always: ; map the process into the low 60K based on current common mem (which is unchanged)
+        push af
+.if DEBUGBANK
+        ld a, #'='
+        call outchar
+.endif
+        ld a, (U_DATA__U_PAGE)
+        out0 (MMU_BBR), a
+.if DEBUGBANK
+        call outcharhex
+.endif
+        ; MMU_CBR is left unchanged
+        pop af
+        ret
+
+map_save:   ; save the current process/kernel mapping
+        push af
+        in0 a, (MMU_BBR)
+        ld (map_store), a
+        pop af
+        ret
+
+map_restore: ; restore the saved process/kernel mapping
+        push af
+.if DEBUGBANK
+        ld a, #'-'
+        call outchar
+.endif
+        ld a, (map_store)
+        out0 (MMU_BBR), a
+.if DEBUGBANK
+        call outcharhex
+.endif
+        pop af
+        ret
+
+map_store:  ; storage for map_save/map_restore
+        .db 0
index 914c5a6..50248e1 100644 (file)
@@ -1,4 +1,4 @@
-This is UZI for the N8VEM Mark IV SBC
+This is Fuzix for the N8VEM Mark IV SBC
 By Will Sowerbutts <will@sowerbutts.com>
 
 Assumes an N8VEM Mark IV SBC fitted with 512KB RAM, with the RS232 port as
diff --git a/Kernel/platform-n8vem-mark4/cpmload.s b/Kernel/platform-n8vem-mark4/cpmload.s
deleted file mode 100644 (file)
index 7d1dfa2..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-.module cpmload
-.area _LOADER (ABS)
-
-    ; CP/M will load us at 0x0100
-    ; We want to relocate our payload (the kernel) and jump into it.
-    ; We put a small stub at the very bottom of memory, copy the kernel into
-    ; place above us, then jump into it.
-
-    .org 0x100
-    di
-    ; copy ourselves to the very bottom of memory -- 0x00 upwards
-    ld de, #0
-    ld hl, #(doload)                ; start of loader code
-    ld bc, #(endloader-doload)      ; length of our loader
-    ldir                            ; copy copy copy!
-    ld hl, (load_address)
-    ld sp, hl                       ; stash copy of entry vector in SP for now
-    ex de, hl                       ; load_address to de
-    ld hl, #payload_start
-    ld bc, (load_length)
-    jp 0                            ; jump and perform copy in low memory
-
-    ; this code gets copied to .org 0
-doload:
-    ldir                            ; copy image into correct place
-    ld hl, #0
-    add hl, sp                      ; recover entry vector
-    jp (hl)                         ; run image
-endloader:                          ; end of code to copy
-
-    ; the data is in a trailer, with a 6-byte header:
-load_address:
-    .ds 2
-load_length:
-    .ds 2
-payload_start:
index 8d9bdcc..f10b51e 100644 (file)
         .globl platform_interrupt_all
         .globl _trap_monitor
 
-        .globl map_kernel
-        .globl map_process_always
-        .globl map_save
-        .globl map_restore
-        ;.globl map_process_only
-
         ; imported symbols
         .globl z180_init_hardware
         .globl z180_init_early
@@ -84,75 +78,6 @@ ocloop: in0 a, (ASCI_STAT0)
 platform_interrupt_all:
         ret
 
-map_kernel: ; map the kernel into the low 60K, leaves common memory unchanged
-        push af
-.if DEBUGBANK
-        ld a, #'K'
-        call outchar
-.endif
-        ld a, #(OS_BANK + FIRST_RAM_BANK)
-        out0 (MMU_BBR), a
-        pop af
-        ret
-
-; this "map_process" business makes no sense on mark4 since we'd switch stacks
-; and the RET would thus lose its return address. oh damn. I suppose we could
-; pop the stack address into hl, then jp (hl) or whatever. let's try and get by
-; without it.
-;
-; map_process: ; if HL=0 call map_kernel, else map the full 64K in bank pointed to by HL
-;             ld a, h
-;             or l
-;             jr z, map_kernel
-;             ld a, (hl)
-;             out0 (MMU_BBR), a
-;             out0 (MMU_CBR), a
-;             ret
-
-; map_process_only: ; as map_process, but does not modify common memory
-;             ld a, h
-;             or l
-;             jr z, map_kernel
-;             ld a, (hl)
-;             out0 (MMU_BBR), a
-;             ret
-
-map_process_always: ; map the process into the low 60K based on current common mem (which is unchanged)
-        push af
-.if DEBUGBANK
-        ld a, #'='
-        call outchar
-.endif
-        ld a, (U_DATA__U_PAGE)
-        out0 (MMU_BBR), a
-.if DEBUGBANK
-        call outcharhex
-.endif
-        ; MMU_CBR is left unchanged
-        pop af
-        ret
-
-map_save:   ; save the current process/kernel mapping
-        push af
-        in0 a, (MMU_BBR)
-        ld (map_store), a
-        pop af
-        ret
-
-map_restore: ; restore the saved process/kernel mapping
-        push af
-.if DEBUGBANK
-        ld a, #'-'
-        call outchar
-.endif
-        ld a, (map_store)
-        out0 (MMU_BBR), a
-.if DEBUGBANK
-        call outcharhex
-.endif
-        pop af
-        ret
-
 _trap_monitor:
         di
         call outnewline
@@ -173,6 +98,3 @@ _trap_monitor:
         call outnewline
         halt
         jr _trap_monitor
-
-map_store:  ; storage for map_save/map_restore
-        .db 0
index 2b4b910..e38cf04 100644 (file)
@@ -1,4 +1,4 @@
-This is UZI for the DX-Designs P112
+This is Fuzix for the DX-Designs P112
 By Will Sowerbutts <will@sowerbutts.com>
 
 Assumes a P112 fitted with 1024KB RAM and G-IDE
index baf4da2..361457e 100644 (file)
@@ -24,7 +24,7 @@ void pagemap_init(void)
 {
     int i;
 
-    /* N8VEM SBC Mark IV has RAM in the top 512K of physical memory. 
+    /* P112 has RAM across the full physical 1MB address space
      * First 64K is used by the kernel. 
      * Each process gets the full 64K for now.
      * Page size is 4KB. */
@@ -36,7 +36,7 @@ void pagemap_init(void)
 void platform_idle(void)
 {
     /* Let's go to sleep while we wait for something to interrupt us;
-     * Makes the Mark IV's run LED go red, which amuses me greatly. */
+     * sadly no fun LED to change colour */
     __asm
         halt
     __endasm;
index 0f9579c..3af2fe6 100644 (file)
         .globl platform_interrupt_all
         .globl _trap_monitor
 
-        .globl map_kernel
-        .globl map_process_always
-        .globl map_save
-        .globl map_restore
-        ;.globl map_process_only
-
         ; imported symbols
         .globl z180_init_hardware
         .globl z180_init_early
@@ -108,75 +102,6 @@ ocloop:     in0 a, (ESCC_CTRL_A)
 platform_interrupt_all:
         ret
 
-map_kernel: ; map the kernel into the low 60K, leaves common memory unchanged
-        push af
-.if DEBUGBANK
-        ld a, #'K'
-        call outchar
-.endif
-        ld a, #(OS_BANK + FIRST_RAM_BANK)
-        out0 (MMU_BBR), a
-        pop af
-        ret
-
-; this "map_process" business makes no sense on mark4 since we'd switch stacks
-; and the RET would thus lose its return address. oh damn. I suppose we could
-; pop the stack address into hl, then jp (hl) or whatever. let's try and get by
-; without it.
-;
-; map_process: ; if HL=0 call map_kernel, else map the full 64K in bank pointed to by HL
-;             ld a, h
-;             or l
-;             jr z, map_kernel
-;             ld a, (hl)
-;             out0 (MMU_BBR), a
-;             out0 (MMU_CBR), a
-;             ret
-
-; map_process_only: ; as map_process, but does not modify common memory
-;             ld a, h
-;             or l
-;             jr z, map_kernel
-;             ld a, (hl)
-;             out0 (MMU_BBR), a
-;             ret
-
-map_process_always: ; map the process into the low 60K based on current common mem (which is unchanged)
-        push af
-.if DEBUGBANK
-        ld a, #'='
-        call outchar
-.endif
-        ld a, (U_DATA__U_PAGE)
-        out0 (MMU_BBR), a
-.if DEBUGBANK
-        call outcharhex
-.endif
-        ; MMU_CBR is left unchanged
-        pop af
-        ret
-
-map_save:   ; save the current process/kernel mapping
-        push af
-        in0 a, (MMU_BBR)
-        ld (map_store), a
-        pop af
-        ret
-
-map_restore: ; restore the saved process/kernel mapping
-        push af
-.if DEBUGBANK
-        ld a, #'-'
-        call outchar
-.endif
-        ld a, (map_store)
-        out0 (MMU_BBR), a
-.if DEBUGBANK
-        call outcharhex
-.endif
-        pop af
-        ret
-
 _trap_monitor:
         di
         call outnewline
@@ -197,6 +122,3 @@ _trap_monitor:
         call outnewline
         halt
         jr _trap_monitor
-
-map_store:  ; storage for map_save/map_restore
-        .db 0