From c4b4dbeb18dccab31ec8462f167a452e582b85f4 Mon Sep 17 00:00:00 2001 From: Edgaru089 Date: Sun, 14 Nov 2021 18:19:10 +0800 Subject: [PATCH] interrupt: LoadGDT() with KERNEL_GDT_SIZE instead of calculating it --- interrupt/init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/interrupt/init.c b/interrupt/init.c index b0ec1eb..a687bd9 100644 --- a/interrupt/init.c +++ b/interrupt/init.c @@ -41,6 +41,7 @@ void interrupt_Init() { io_WriteConsoleASCII("interrupt_Init() calling\n"); // set the 2 dummy gdts + memset((void *)KERNEL_GDT_MAPPING, 0, KERNEL_GDT_SIZE); uint64_t *gdt = (uint64_t *)KERNEL_GDT_MAPPING; gdt[0] = 0; gdt[GDT_DATA_SELECTOR >> 3] = GDT_DATA; @@ -49,7 +50,7 @@ void interrupt_Init() { gdt[GDT_EXEC_RING3_SELECTOR >> 3] = GDT_EXEC_RING3; io_WriteConsoleASCII("GDT Installed\n"); - interrupt_LoadGDT(5 * GDT_SIZE_BYTES - 1, (void *)KERNEL_GDT_MAPPING); // set it! + interrupt_LoadGDT(KERNEL_GDT_SIZE - 1, (void *)KERNEL_GDT_MAPPING); // set it! io_WriteConsoleASCII("GDT OK\n"); //interrupt_Testcode();