diff --git a/src/kernel/arch/i686/gdt.asm b/src/kernel/arch/i686/gdt.asm index 0071e50..0d40b2f 100644 --- a/src/kernel/arch/i686/gdt.asm +++ b/src/kernel/arch/i686/gdt.asm @@ -19,7 +19,7 @@ i686_gdt_load: .reload_cs: ; Reload data segments mov ax, [ebp + 16] - mov dx, ax + mov ds, ax mov es, ax mov fs, ax mov gs, ax @@ -27,5 +27,5 @@ i686_gdt_load: ; Restore old call frame mov esp, ebp - push ebp + pop ebp ret diff --git a/src/kernel/arch/i686/gdt.c b/src/kernel/arch/i686/gdt.c index c1603e7..b5c62fb 100644 --- a/src/kernel/arch/i686/gdt.c +++ b/src/kernel/arch/i686/gdt.c @@ -68,7 +68,7 @@ static gdt_entry g_gdt[] = { // Kernel 32-bit code segment GDT_ENTRY( 0, - 0xFFFF, + 0xFFFFF, GDT_ACCESS_PRESENT | GDT_ACCESS_RING0 | GDT_ACCESS_CODE_SEGMENT | GDT_ACCESS_CODE_READABLE, GDT_FLAG_32BIT | GDT_FLAG_GRANULARITY_4K ), @@ -76,7 +76,7 @@ static gdt_entry g_gdt[] = { // Kernel 32-bit data segment GDT_ENTRY( 0, - 0xFFFF, + 0xFFFFF, GDT_ACCESS_PRESENT | GDT_ACCESS_RING0 | GDT_ACCESS_DATA_SEGMENT | GDT_ACCESS_DATA_WRITEABLE, GDT_FLAG_32BIT | GDT_FLAG_GRANULARITY_4K ),