From: Alan Cox Date: Sun, 1 Nov 2015 21:02:56 +0000 (+0000) Subject: ubee: missed this in the old commits X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=9ca7344353302e1ddfc89eb0592bf9557b72dc31;p=FUZIX.git ubee: missed this in the old commits Not yet anything useful here... still need to write the disk manipulation toolchain --- diff --git a/Kernel/platform-ubee/crt0.s b/Kernel/platform-ubee/crt0.s new file mode 100644 index 00000000..78fe134b --- /dev/null +++ b/Kernel/platform-ubee/crt0.s @@ -0,0 +1,68 @@ + ; Ordering of segments for the linker. + ; WRS: Note we list all our segments here, even though + ; we don't use them all, because their ordering is set + ; when they are first seen. + .area _CODE + .area _CODE2 + .area _VIDEO + .area _CONST + .area _INITIALIZED + .area _DATA + .area _BSEG + .area _BSS + .area _HEAP + ; note that areas below here may be overwritten by the heap at runtime, so + ; put initialisation stuff in here + .area _INITIALIZER + .area _GSINIT + .area _GSFINAL + .area _COMMONMEM + .area _DISCARD + + ; imported symbols + .globl _fuzix_main + .globl init_early + .globl init_hardware + .globl s__DATA + .globl l__DATA + .globl s__DISCARD + .globl l__DISCARD + .globl s__COMMONMEM + .globl l__COMMONMEM + .globl s__INITIALIZER + .globl kstack_top + + ; startup code + .area _CODE + +; +; Once the loader completes it jumps here +; +start: + ld sp, #kstack_top + ; move the common memory where it belongs + ld hl, #s__DATA + ld de, #s__COMMONMEM + ld bc, #l__COMMONMEM + ldir + ; then the discard + ld de, #s__DISCARD + ld bc, #l__DISCARD + ldir + ; then zero the data area + ld hl, #s__DATA + ld de, #s__DATA + 1 + ld bc, #l__DATA - 1 + ld (hl), #0 + ldir + +; TODO: Move the common into the other bank, pain as we may well have +; code in low bank and __COMMON packed in high. Needs to be in +; .COMMONMEM and map the other page low +; + call init_early + call init_hardware + call _fuzix_main + di +stop: halt + jr stop