:: commit 70f0385881215483d3fe06e5c54752a77d9371f4

Mintsuki <mintsuki@protonmail.com> — 2026-03-06 12:54

parents: 18c9143ed5

stage1/hdd: Rearrange code to work around boot sector size limitation

diff --git a/stage1/hdd/bootsect.asm b/stage1/hdd/bootsect.asm
index df622ad7..0d2b47e1 100644
--- a/stage1/hdd/bootsect.asm
+++ b/stage1/hdd/bootsect.asm
@@ -78,6 +78,10 @@ start:
     lgdt [gdt]
 
     cli
+
+    push dword 0
+    mov ebp, 0x10
+
     mov eax, cr0
     bts ax, 0
     mov cr0, eax
@@ -114,17 +118,14 @@ err:
 
 bits 32
 vector:
-    mov eax, 0x10
-    mov ds, ax
-    mov es, ax
-    mov fs, ax
-    mov gs, ax
-    mov ss, ax
+    mov ds, ebp
+    mov es, ebp
+    mov fs, ebp
+    mov gs, ebp
+    mov ss, ebp
 
     and edx, 0xff
 
-    push 0
-
     push edx
 
     push stage2.size
tab: 248 wrap: offon