]> git.buserror.net Git - polintos/scott/priv.git/blobdiff - kernel/arch/x86/descriptors.cc
update
[polintos/scott/priv.git] / kernel / arch / x86 / descriptors.cc
index e281895386764fec8f8481a58c5d455bfca38421..65b146e00c715567f9d6ef6466dec0474ce0c9b5 100644 (file)
@@ -29,7 +29,7 @@ using Arch::Priv::tss;
 
 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,
@@ -44,7 +44,7 @@ Descriptor x86_gdt[1024] = {
                gran: 1,
                base_high: 0
        },
-       {   // 0x10: code
+       {   // 0x10: kernel code
                limit_low: 0xffff,
                base_low: 0,
                base_mid: 0,
@@ -73,7 +73,37 @@ Descriptor x86_gdt[1024] = {
                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 {