ubee: missed this in the old commits
authorAlan Cox <alan@linux.intel.com>
Sun, 1 Nov 2015 21:02:56 +0000 (21:02 +0000)
committerAlan Cox <alan@linux.intel.com>
Sun, 1 Nov 2015 21:02:56 +0000 (21:02 +0000)
Not yet anything useful here... still need to write the disk manipulation
toolchain

Kernel/platform-ubee/crt0.s [new file with mode: 0644]

diff --git a/Kernel/platform-ubee/crt0.s b/Kernel/platform-ubee/crt0.s
new file mode 100644 (file)
index 0000000..78fe134
--- /dev/null
@@ -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