Skip to content

Commit b377c09

Browse files
Mintsukilukflug
authored andcommitted
stage1/hdd: Rearrange code to work around boot sector size limitation
1 parent fac54c1 commit b377c09

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

stage1/hdd/bootsect.asm

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ start:
7878
lgdt [gdt]
7979

8080
cli
81+
82+
push dword 0
83+
mov ebp, 0x10
84+
8185
mov eax, cr0
8286
bts ax, 0
8387
mov cr0, eax
@@ -114,17 +118,14 @@ err:
114118

115119
bits 32
116120
vector:
117-
mov eax, 0x10
118-
mov ds, ax
119-
mov es, ax
120-
mov fs, ax
121-
mov gs, ax
122-
mov ss, ax
121+
mov ds, ebp
122+
mov es, ebp
123+
mov fs, ebp
124+
mov gs, ebp
125+
mov ss, ebp
123126

124127
and edx, 0xff
125128

126-
push 0
127-
128129
push edx
129130

130131
push stage2.size

0 commit comments

Comments
 (0)