/// The structure that contains all the information that each GDT entry needs.
constGdtEntry=packedstruct{
/// The lower 16 bits of the limit address. Describes the size of memory that can be addressed.
limit_low:u16,
/// The lower 24 bits of the base address. Describes the start of memory for the entry.
base_low:u24,
/// Bit 0 : accessed - The CPU will set this when the GDT entry is accessed.
/// Bit 1 : writable - The writable bit to say if the memory region is writable. If set, then memory region is readable and writable. If not set, then the memory region is just readable.
/// Bit 2 : direction_conforming - For a code segment: if set (1), then the code segment can be executed from a lower ring level. If unset (0), then the code segment can only be executed from the same ring level in the privilege flag. For the data segment: if set (1), then the data segment grows downwards. If unset (0), then the data segment grows upwards.
/// Bit 3 : executable - The execution bit to say that the memory region is executable.
/// Bit 4 : descriptor_bit - The descriptor bit.
/// Bit 5-6 : privilege - The ring level of the memory region.
/// Bit 7 : present - The present bit to tell that this GDT entry is present.
access:u8,
/// The upper 4 bits of the limit address. Describes the size of memory that can be addressed.
limit_high:u4,
/// Bit 0 : reserved_zero - This must always be zero.
/// Bit 1 : is_64bits - Whether this is a 64 bit system.
/// Bit 2 : is_32bits - Whether this is a 32 bit system.
/// Bit 3 : is_limit_4K - Whether paging is turned on, and each address is addressed as if it is a page number not physical/logical linear address.
flags:u4,
/// The upper 8 bits of the base address. Describes the start of memory for the entry.
base_high:u8,
};
/// The GDT pointer structure that contains the pointer to the beginning of the GDT and the number
/// of the table (minus 1). Used to load the GDT with LGDT instruction.
pubconstGdtPtr=packedstruct{
/// 16bit entry for the number of entries (minus 1).