From 0cc0abae3588b7f867d31a21e662193f2620118f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Ortega=20Froysa?= Date: Thu, 12 Apr 2018 16:42:15 +0200 Subject: [PATCH] Enable paging first before loading GDT. --- src/kernel/arch/x86/boot.s | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/kernel/arch/x86/boot.s b/src/kernel/arch/x86/boot.s index 2ec51b6..9ecfdac 100644 --- a/src/kernel/arch/x86/boot.s +++ b/src/kernel/arch/x86/boot.s @@ -61,12 +61,6 @@ _start: mov $stack_top, %esp mov %esp, %ebp - # GDT, paging, and other features - call gdt_install - # load the TSS which is in the 6th entry of the GDT - movw $0x28, %ax - ltr %ax - # paging call setup_paging # will return pointer to page directory # load page directory @@ -76,6 +70,12 @@ _start: orl $0x80000000, %eax movl %eax, %cr0 + # GDT, paging, and other features + call gdt_install + # load the TSS which is in the 6th entry of the GDT + movw $0x28, %ax + ltr %ax + boot_kernel: # enter high-level kernel (C) call kernel_main