zx128: kernel.def option to decide if we want to microdrive boot
authorAlan Cox <alan@linux.intel.com>
Thu, 11 Dec 2014 12:11:26 +0000 (12:11 +0000)
committerAlan Cox <alan@linux.intel.com>
Thu, 11 Dec 2014 12:11:26 +0000 (12:11 +0000)
Also use a temporary boot stack for this

Kernel/platform-zx128/crt0.s
Kernel/platform-zx128/kernel.def

index ba198b7..6ac76f8 100644 (file)
         .globl l__DATA
         .globl kstack_top
 
-       .globl mdv_boot
-
         .globl unix_syscall_entry
         .globl nmi_handler
         .globl interrupt_handler
 
+       .include "kernel.def"
+
         ; startup code
         .area _CODE
 init:
@@ -87,8 +87,6 @@ jump_to_basic_end:
         jp nmi_handler
 
 init_continue:
-        ld sp, #kstack_top
-
         ; hack for emulator. Read remaining fuzix part to RAM from fuzix.bin
 ;        ld bc, #0x1ee7
 ;        in a, (c)
@@ -101,7 +99,19 @@ init_continue:
        ld bc, #0x02ff
        ldir
 
+;
+;      These hooks will be platform/dev specific
+;
+       .if MICRODRIVE_BOOT
+       .globl mdv_boot
+
+boot_stack .equ 0xc000
+       ld sp, #boot_stack
        call mdv_boot
+       .endif
+
+
+        ld sp, #kstack_top
 
         ; Configure memory map
         call init_early
index 7d4a50f..ef16c70 100644 (file)
@@ -6,3 +6,9 @@ U_DATA__TOTALSIZE           .equ 0x300        ; 256+256+256 bytes.
 U_DATA_STASH               .equ 0xFD00       ; BD00-BFFF
 
 NMOS_Z80                   .equ 1
+
+
+;
+; Ways we may boot
+;
+MICRODRIVE_BOOT                    .equ 1