Descriptor x86_gdt[1024] = {
{}, // The first entry is reserved for the NULL selector.
- { // 0x08: data
+ { // 0x08: kernel data
limit_low: 0xffff,
base_low: 0,
base_mid: 0,
gran: 1,
base_high: 0
},
- { // 0x10: code
+ { // 0x10: kernel code
limit_low: 0xffff,
base_low: 0,
base_mid: 0,
opsize: 0,
gran: 0,
base_high: 0
- }
+ },
+ { // 0x23: user data
+ limit_low: 0xffff,
+ base_low: 0,
+ base_mid: 0,
+ type: 2, // data segment, writable
+ user: 1,
+ dpl: 3,
+ present: 1,
+ limit_high: 0x7f,
+ sw: 0,
+ reserved: 0,
+ opsize: 1,
+ gran: 1,
+ base_high: 0
+ },
+ { // 0x2b: code
+ limit_low: 0xffff,
+ base_low: 0,
+ base_mid: 0,
+ type: 10, // code segment, readable
+ user: 1,
+ dpl: 3,
+ present: 1,
+ limit_high: 0x7f,
+ sw: 0,
+ reserved: 0,
+ opsize: 1,
+ gran: 1,
+ base_high: 0
+ },
};
struct X86DescriptorTablePointer {