MentOS  0.8.0
The Mentoring Operating System
Classes | Macros | Typedefs | Enumerations | Functions
gdt.h File Reference

Data structures concerning the Global Descriptor Table (GDT). More...

Go to the source code of this file.

Classes

struct  gdt_descriptor_t
 Data structure representing a GDT descriptor. More...
 
struct  gdt_pointer_t
 Data structure used to load the GDT into the GDTR. More...
 

Macros

#define IDT_PADDING   14U
 Used in IDT for padding.
 

Typedefs

typedef struct gdt_descriptor_t _syscall0 = _syscall0( (packed) )= _syscall1( (packed) )= _syscall2( (packed) )= _syscall3( (packed) )= gdt_descriptor_t
 Data structure representing a GDT descriptor. More...
 

Enumerations

enum  gdt_bits_t {
  GDT_PRESENT = 128U , GDT_KERNEL = 0U , GDT_USER = 96U , GDT_S = 16U ,
  GDT_EX = 8U , GDT_DC = 4U , GDT_RW = 2U , GDT_AC = 1U ,
  GDT_CODE = (GDT_S | GDT_EX) , GDT_DATA = (GDT_S | GDT_RW) , GDT_GRANULARITY = 128U , GDT_OPERAND_SIZE = 64U
}
 Bitmasks used to access to specific bits of the GDT. More...
 

Functions

void init_gdt (void)
 Initialise the GDT. More...
 
void gdt_set_gate (uint8_t index, uint32_t base, uint32_t limit, uint8_t access, uint8_t granul)
 Sets the value of one GDT entry. More...
 

Detailed Description

Data structures concerning the Global Descriptor Table (GDT).

The Global Descriptor Table (GDT) is a data structure used by Intel x86-family processors starting with the 80286 in order to define the characteristics of the various memory areas used during program execution, including the base address, the size, and access privileges like executability and writability. These memory areas are called segments in Intel terminology.