Setup stack bottom
This commit is contained in:
parent
05c78e5e0c
commit
a9c01aefda
2
boot.asm
2
boot.asm
@ -1,3 +1,4 @@
|
|||||||
|
; c.f. https://www.gnu.org/software/grub/manual/multiboot/multiboot.html#OS-image-format
|
||||||
; Declare constants for the multiboot header.
|
; Declare constants for the multiboot header.
|
||||||
MBALIGN equ 1 << 0 ; align loaded modules on page boundaries
|
MBALIGN equ 1 << 0 ; align loaded modules on page boundaries
|
||||||
MEMINFO equ 1 << 1 ; provide memory map
|
MEMINFO equ 1 << 1 ; provide memory map
|
||||||
@ -54,6 +55,7 @@ _start:
|
|||||||
; stack (as it grows downwards on x86 systems). This is necessarily done
|
; stack (as it grows downwards on x86 systems). This is necessarily done
|
||||||
; in assembly as languages such as C cannot function without a stack.
|
; in assembly as languages such as C cannot function without a stack.
|
||||||
mov esp, stack_top
|
mov esp, stack_top
|
||||||
|
mov ebp, stack_bottom
|
||||||
|
|
||||||
; This is a good place to initialize crucial processor state before the
|
; This is a good place to initialize crucial processor state before the
|
||||||
; high-level kernel is entered. It's best to minimize the early
|
; high-level kernel is entered. It's best to minimize the early
|
||||||
|
1
boot.s
1
boot.s
@ -64,6 +64,7 @@ _start:
|
|||||||
in assembly as languages such as C cannot function without a stack.
|
in assembly as languages such as C cannot function without a stack.
|
||||||
*/
|
*/
|
||||||
mov $stack_top, %esp
|
mov $stack_top, %esp
|
||||||
|
mov $stack_bottom, %ebp
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This is a good place to initialize crucial processor state before the
|
This is a good place to initialize crucial processor state before the
|
||||||
|
Loading…
Reference in New Issue
Block a user