Code: Select all
System Descriptor Types
Type Meaning Segment/Gate
0 Reserved
1 available 16-bit TSS System segment
2 LDT System segment
3 active 16-bit TSS System segment
4 16-bit Call Gate Gate
5 Task Gate Gate
6 16-bit Interrupt Gate Gate
7 16-bit Trap Gate Gate
8 Reserved
9 available 32-bit TSS System segment
10 Reserved
11 active 32-bit TSS System segment
12 32-bit Call Gate Gate
13 Reserved
14 32-bit Interrupt Gate Gate
15 32-bit Trap Gate Gate
Now I know if I set the S bit = 0 this means it is going to be a code/data descriptor instead of a system descriptor above.
My problem is for the 4bit type field in this case I found.
Code: Select all
format of TYPE field
bit 2 Executable (E) 0 = Descriptor is data type
1 Expansion Direction (ED) 0 = Expand up
1 = Expand up
0 Writeable (W) W = 0 data segment is read only
W = 1 data segment is R/W
bit 2 Executable (E) 1 = Descriptor is code type
1 Conforming (C) ( I don't understand )
0 Readable (R) R = 0 Code segment execute only
R = 1 Code segment is Readable
What would be the difference in setting it like s=0 type=0-011 or type=1-011 both of the lower 3bits indicate it is a data segment entry ,expands up , and is read/writeable.
I am just being picky since I have always used the default type values given to create my gdt descriptor enties.
So what is the 4th supposed to be set to and what would happen if I did the opposite .... (I am assuming it would at best ignore it and at worse throw a global protection fault )
Question 2
The only last issue I was curious about is what the 1 Conforming (C) ( I don't understand ) is suppose to stand for?
Is this some type of writable bit or something , or perhaps something that has to do with a 64bit mode compatiblity issue , or an old 16 bit mode.
Either way I don't understand what this should be perhaps zero by default. (but maybe means 16 bit data/code seg or 32 bit data/code that would probably make the most sense.... but now that I think about it that is covered in the D/B bit for 16/32 bits)
Perhaps somebody knows for sure and can explain this little last issue I was wondering about GDT entry fields
Thanks for any help