From 458978e7b8a6d50566fc8b68558f76f6b0465c52 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Fri, 15 Sep 2023 00:29:11 +0200 Subject: kern: fix GDT order for 64bit sysret --- src/kernel/arch/amd64/32/gdt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/kernel/arch/amd64/32/gdt.c') diff --git a/src/kernel/arch/amd64/32/gdt.c b/src/kernel/arch/amd64/32/gdt.c index bd5fa48..e643f27 100644 --- a/src/kernel/arch/amd64/32/gdt.c +++ b/src/kernel/arch/amd64/32/gdt.c @@ -75,8 +75,9 @@ void gdt_init(void) { gdt_fillout(&GDT[SEG_r0code], 0, true); gdt_fillout(&GDT[SEG_r0data], 0, false); - gdt_fillout(&GDT[SEG_r3code], 3, true); + gdt_fillout(&GDT[SEG_r3code32], 3, true); gdt_fillout(&GDT[SEG_r3data], 3, false); + gdt_fillout(&GDT[SEG_r3code], 3, true); lgdt_arg.limit = sizeof(GDT) - 1; lgdt_arg.base = (uint64_t)&GDT; -- cgit v1.2.3