Add user-mode GDT entries

This commit is contained in:
Mathieu Strypsteen 2024-07-08 14:02:27 +02:00
parent 98aaab64d7
commit 8b13664aca

View file

@ -13,7 +13,7 @@ struct GDTEntry {
}
#[repr(C)]
struct GDT {
entries: [GDTEntry; 3],
entries: [GDTEntry; 5],
}
#[repr(C, packed)]
struct GDTDescriptor {
@ -48,6 +48,22 @@ pub fn setup_gdt() {
flags: 0,
base_high: 0,
},
GDTEntry {
limit_low: 0,
base_low: 0,
base_middle: 0,
access: 0xfa,
flags: 0x20,
base_high: 0,
},
GDTEntry {
limit_low: 0,
base_low: 0,
base_middle: 0,
access: 0xf2,
flags: 0,
base_high: 0,
},
],
}));
let gdt_descriptor = Box::leak(Box::new(GDTDescriptor {