From 656c0c00bdf87fbdda66c12e19edfcaa5b642075 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 11 Dec 2014 12:11:26 +0000 Subject: [PATCH] zx128: kernel.def option to decide if we want to microdrive boot Also use a temporary boot stack for this --- Kernel/platform-zx128/crt0.s | 18 ++++++++++++++---- Kernel/platform-zx128/kernel.def | 6 ++++++ 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Kernel/platform-zx128/crt0.s b/Kernel/platform-zx128/crt0.s index ba198b7b..6ac76f8c 100644 --- a/Kernel/platform-zx128/crt0.s +++ b/Kernel/platform-zx128/crt0.s @@ -38,12 +38,12 @@ .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 diff --git a/Kernel/platform-zx128/kernel.def b/Kernel/platform-zx128/kernel.def index 7d4a50f4..ef16c704 100644 --- a/Kernel/platform-zx128/kernel.def +++ b/Kernel/platform-zx128/kernel.def @@ -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 -- 2.34.1