Fix GDT error offsetting memory by some bytes

The error in the GDT caused the whole memory space to be offset by
128B or 256B (It's not entirely sure which one of those). This was
only made visible by later changes, but now it's fixed.
This commit is contained in:
Eric-Paul Ickhorn 2024-07-19 00:12:52 +02:00
parent a72a41c3ac
commit f573f49874
Signed by: epickh
GPG Key ID: 1358818BAA38B104
1 changed files with 6 additions and 3 deletions

View File

@ -67,7 +67,7 @@ make_regular_data_segment_in_gdt:
.write_base_address: .write_base_address:
mov [eax + 2], bx mov [eax + 2], bx
shr bx, 16 shr ebx, 16
mov [eax + 4], bl mov [eax + 4], bl
mov [eax + 7], bh mov [eax + 7], bh
@ -282,7 +282,7 @@ make_code_segment_in_gdt:
.write_base_address: .write_base_address:
mov [eax + 2], bx mov [eax + 2], bx
shr bx, 16 shr ebx, 16
mov [eax + 4], bl mov [eax + 4], bl
mov [eax + 7], bh mov [eax + 7], bh
@ -389,6 +389,9 @@ load_flat_gdt:
or ebx, 1 or ebx, 1
mov cr0, ebx mov cr0, ebx
xor bx, bx
mov ds, bx
jmp dword 0x08:.epilog jmp dword 0x08:.epilog
bits 32 bits 32
@ -407,7 +410,7 @@ bits 32
align 16 align 16
.gdtr: .gdtr:
.gdtr.length: .gdtr.length:
dw 23 dw 15
.gdtr.pointer: .gdtr.pointer:
dd GDT_MEMORY_AREA dd GDT_MEMORY_AREA