Add user-mode GDT entries
This commit is contained in:
parent
98aaab64d7
commit
8b13664aca
1 changed files with 17 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue