summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/boot/boot.asm14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/boot/boot.asm b/src/boot/boot.asm
index 75ad05e..0f31c9d 100644
--- a/src/boot/boot.asm
+++ b/src/boot/boot.asm
@@ -22,8 +22,11 @@
; make sure we know the location of the stack by setting it on our own
; this stack is only used in real mode in stage 1, so it's growing from
-; 0xffff down
- mov bp, 0xFFFF
+; 0x2000 down, we should really not set it above 0x7c00, as this is
+; exacly the place, where we load stage 2 and the kernel to! (was 0xffff,
+; which was a really bad idea after the kernel got bigger than roughly
+; 32k!)
+ mov bp, 0x2000
mov sp, bp
; print out some information about CPU mode and BIOS boot drive
@@ -170,6 +173,13 @@ MESSAGE_HALTED_REAL:
[bits 32]
BEGIN_PROTECTED_MODE:
+; make sure registers have known values
+ xor eax, eax
+ xor ebx, ebx
+ xor ecx, ecx
+ xor edx, edx
+ xor esi, esi
+ xor edi, edi
; we switched to protected mode
mov si, MESSAGE_PROTECTED_MODE