From a9c01aefdae2a63acc0587faf984da04384127d0 Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Thu, 26 Jul 2018 12:25:43 +0200 Subject: [PATCH] Setup stack bottom --- boot.asm | 2 ++ boot.s | 1 + 2 files changed, 3 insertions(+) diff --git a/boot.asm b/boot.asm index 7c4c794..664f5e2 100644 --- a/boot.asm +++ b/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. MBALIGN equ 1 << 0 ; align loaded modules on page boundaries MEMINFO equ 1 << 1 ; provide memory map @@ -54,6 +55,7 @@ _start: ; stack (as it grows downwards on x86 systems). This is necessarily done ; in assembly as languages such as C cannot function without a stack. mov esp, stack_top + mov ebp, stack_bottom ; This is a good place to initialize crucial processor state before the ; high-level kernel is entered. It's best to minimize the early diff --git a/boot.s b/boot.s index 8aa2a07..2ebf558 100644 --- a/boot.s +++ b/boot.s @@ -64,6 +64,7 @@ _start: in assembly as languages such as C cannot function without a stack. */ mov $stack_top, %esp + mov $stack_bottom, %ebp /* This is a good place to initialize crucial processor state before the