projects
/
eightysix
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
reorg done
[eightysix]
/
kern
/
src
/
startup.asm
diff --git
a/kern/src/startup.asm
b/kern/src/startup.asm
index
c90cef6
..
c64684a
100644
(file)
--- a/
kern/src/startup.asm
+++ b/
kern/src/startup.asm
@@
-3,8
+3,10
@@
bits 16
section .startup
bits 16
section .startup
-extern bootmain
-extern _stage2_start_seg
+; memory reserved at the top of RAM for the kernel stack
+STACKSZ equ 4096
+
+extern kmain
extern _bss_start_off
extern _bss_size
extern _bss_start_off
extern _bss_size
@@
-12,6
+14,11
@@
global _start
_start:
; TODO floppy off if necessary
_start:
; TODO floppy off if necessary
+ ; move stack to the top of RAM (TODO: detect and avoid Ext. BIOS data area)
+ mov ax, (0xa0000 - STACKSZ) >> 4
+ mov ss, ax
+ mov sp, STACKSZ
+
; zero .bss
mov di, _bss_start_off
mov cx, _bss_size
; zero .bss
mov di, _bss_start_off
mov cx, _bss_size
@@
-20,7
+27,7
@@
_start:
xor ax, ax
mov es, ax
xor ax, ax
mov es, ax
- call bootmain
+ call kmain
hang: hlt
jmp hang
hang: hlt
jmp hang