From 581d19fceeaadaeb2249ae485505e2b4c5340328 Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Fri, 27 Aug 2021 08:21:54 -0500 Subject: arch: i386: add ring-3 descriptors to the GDT Add two ring-3 segment discriptors to the GDT during gdt_install. Signed-off-by: Danny Holman --- arch/i386/boot/gdt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/i386/boot/gdt.c b/arch/i386/boot/gdt.c index 53853bb..8be5563 100644 --- a/arch/i386/boot/gdt.c +++ b/arch/i386/boot/gdt.c @@ -46,7 +46,7 @@ struct gpt_ptr { uint32_t base; }__attribute__((packed)); -uint64_t desc[3]; +uint64_t desc[5]; struct gpt_ptr gp; extern void flush_gdt(struct gpt_ptr *ptr); @@ -74,5 +74,7 @@ void gdt_install(void) { desc[0] = create_gdt_entry(0, 0, 0); desc[1] = create_gdt_entry(0, 0x000FFFFF, GDT_CODE_PL0); desc[2] = create_gdt_entry(0, 0x000FFFFF, GDT_DATA_PL0); + desc[3] = create_gdt_entry(0, 0x000FFFFF, GDT_DATA_PL3); + desc[4] = create_gdt_entry(0, 0x000FFFFF, GDT_DATA_PL3); flush_gdt(&gp); } -- cgit v1.2.3