summaryrefslogtreecommitdiff
path: root/arch/i386/boot
diff options
context:
space:
mode:
authorDanny Holman <dholman@gymli.xyz>2021-08-27 08:21:54 -0500
committerDanny Holman <dholman@gymli.xyz>2021-08-27 08:21:54 -0500
commit581d19fceeaadaeb2249ae485505e2b4c5340328 (patch)
tree6de540c2212b0845417877bd8c73c33430db5125 /arch/i386/boot
parent9f09b01573a737c9a3274177a60cf51f1015f792 (diff)
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 <dholman@gymli.xyz>
Diffstat (limited to 'arch/i386/boot')
-rw-r--r--arch/i386/boot/gdt.c4
1 files changed, 3 insertions, 1 deletions
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);
}