boot/gdt.h (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
/*! \file
* Configures the global descriptor table (GDT).
*/
#ifndef GDT_H
#define GDT_H
#include "stdint.h"
/*!
* Represents a single segment descriptor within the GDT.
*/
typedef struct {
//! Bytes 0-7 of the segment limit
uint8_t limit_0;
//! Bytes 8-15 of the segment limit
uint8_t limit_8;
//! Bytes 0-7 of the segment base
uint8_t base_0;
//! Bytes 8-15 of the segment base
uint8_t base_8;
//! Bytes 16-23 of the segment base
uint8_t base_16;
//! Access bytes: Contains information regulating access to the segment
uint8_t access;
//! Bytes 16-19 of the segment limit and flags
uint8_t limit_and_flags;
//! Bytes 24-31 of the segment base
uint8_t base_24;
} __attribute__((packed)) GDT_ENTRY;
/*!
* The GDT.
*/
GDT_ENTRY GDT[7];
#endif