I'm trying to write functions that set up gdt in c.
My definition of segment descriptor is:
Code: Select all
typedef struct
{
uint16 limit_low;
uint16 base_low;
uint8 base_middle;
uint8 access;
uint8 limit_mid_flag;
uint8 base_high;
} gdt_descriptor;
I know 80386 is little-endian. So when writing a 16-bit value to mem(let's say 0x1234), the actual data in ram would be
Code: Select all
Addr Data
0x0 0x34
0x1 0x12
Code: Select all
Bit Data
0-7 0x34
8-15 0x12.
Code: Select all
Bit Data
0-7 0x12
8-15 0x34.
So I'm confused here:
Should it be 0x12 0x34 or 0x34 0x12(little-endian form)?
Thanks!