Bits for DPL in GDT or IDT.
Posted: Sun Oct 26, 2014 9:34 am
You can see IDT structure here.
And you can download that tutorial's source here.
Now my question is this.
About bits of DPL field.
I already know that 0(00b) means Ring0 and 3(11b) means Ring3.
but How about Ring1 or Ring2?
In Ring1 case, 01b? 10b?
I thought and believe 01b is right because that is 1 in decimal.
However the source had been wrote 10b as Ring1.
You can see this code at idt.h in Hal project.
I'm really confusing about that. The code is wrong? What is correct?
Code: Select all
•Bits 42...44: Descriptor Privedlge Level (DPL)
◦00: Ring 0
◦01: Ring 1
◦10: Ring 2
◦11: Ring 3
Now my question is this.
About bits of DPL field.
I already know that 0(00b) means Ring0 and 3(11b) means Ring3.
but How about Ring1 or Ring2?
In Ring1 case, 01b? 10b?
I thought and believe 01b is right because that is 1 in decimal.
However the source had been wrote 10b as Ring1.
Code: Select all
#define I86_IDT_DESC_RING1 0x40 //01000000
#define I86_IDT_DESC_RING2 0x20 //00100000
#define I86_IDT_DESC_RING3 0x60 //01100000
I'm really confusing about that. The code is wrong? What is correct?