Global Descriptor Table Entry x86_64 32-bit format question
Posted: Sun Apr 26, 2026 7:30 am
My question has to do with the format of the GDT entry. I am using this article: https://wiki.osdev.org/Global_Descriptor_Table
The article shows the GDT segment descriptor. (Please see article)
My interpretation of this is:
Yet what I find on the internet shows the uint16_t entries (membaselow, limit) as being first in the structure.
I find it hard to believe that being a newbie at this, my interpretation is the correct one. I think it is more likely that I am missing something basic.
Could someone please tell me if I am correct, or explain what I'm missing?
Tom
The article shows the GDT segment descriptor. (Please see article)
My interpretation of this is:
Code: Select all
struct __attribute__((packed)) gdt_entry {
uint8_t membasehigh; // byte 0
uint8_t flagslimit; // byte 1
uint8_t access; // byte 2
uint8_t membasemiddle; // byte 3
uint16_t membaselow; // bytes 4-5
uint16_t limit; // bytes 6-7
};I find it hard to believe that being a newbie at this, my interpretation is the correct one. I think it is more likely that I am missing something basic.
Could someone please tell me if I am correct, or explain what I'm missing?
Tom