aboutsummaryrefslogtreecommitdiffstats
path: root/src/boot.asm
diff options
context:
space:
mode:
Diffstat (limited to 'src/boot.asm')
-rw-r--r--src/boot.asm15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/boot.asm b/src/boot.asm
index c29267d..c2d461a 100644
--- a/src/boot.asm
+++ b/src/boot.asm
@@ -41,12 +41,19 @@ SECTION "kinit", ROM0
KernelInit:
di
ld sp, KSTACK_TOP
+ push af ; boot ROM hands the console model in A/B -
+ push bc ; park it on the (uncleared) stack for dmesg
; enable cart RAM (MBC5)
ld a, $0A
ld [MBC5_RAM_ENABLE], a
call ClearKernelRAM
+ pop bc
+ pop af
+ ld [wBootA], a
+ ld a, b
+ ld [wBootB], a
call CopyHramCode ; move context-switch trampoline into HRAM
call ProcInit ; wipe process table
; point wCurProc at the (zeroed) kernel PCB so disk I/O during boot restores
@@ -56,11 +63,15 @@ KernelInit:
ld a, HIGH(wKernelPCB)
ld [wCurProc+1], a
call pipe_init ; mark all pipes free
+ call term_init ; LCD console first, so the boot spew is visible
+ call boot_banner ; dmesg: kernel/console/cart/mem/proc lines
call net_init ; clear the socket table, set our IP (10.0.0.2)
+ call boot_net
call fs_init ; mount the disk (format on first boot; persists)
- call term_init ; set up the LCD text terminal
+ call boot_fs
call osk_init ; build the on-screen keyboard (window layer)
- ; terminal starts blank; shell output flows in via KPutc
+ call boot_tty
+ call boot_init ; "init: spawning pid 1"
; --- spawn the init task (pid 1); it fork()s the rest ---
ld hl, TaskInit