GitOS
Loading...
Searching...
No Matches
gdt.h File Reference
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  gdt
struct  gdt_structured
struct  gdt_descriptor

Macros

#define TOTAL_GDT_SEGMENTS   6
#define KERNEL_CODE_SELECTOR   0x08
#define KERNEL_DATA_SELECTOR   0x10
#define USER_CODE_SELECTOR   0x1b
#define USER_DATA_SELECTOR   0x23

Functions

struct gdt __attribute__ ((packed))
void gdt_load (struct gdt *gdt, unsigned int size)
void gdt_read (struct gdt_descriptor *target)
void gdt_structured_to_gdt (struct gdt *gdt, struct gdt_structured *structured_gdt, unsigned int total_entries)

Variables

uint16_t segment
uint16_t base_first
uint8_t base
uint8_t access
uint8_t high_flags
uint8_t base_24_31_bits
struct gdt_structured __attribute__
uint16_t size
uint32_t start_address

Macro Definition Documentation

◆ KERNEL_CODE_SELECTOR

#define KERNEL_CODE_SELECTOR   0x08

◆ KERNEL_DATA_SELECTOR

#define KERNEL_DATA_SELECTOR   0x10

◆ TOTAL_GDT_SEGMENTS

#define TOTAL_GDT_SEGMENTS   6

◆ USER_CODE_SELECTOR

#define USER_CODE_SELECTOR   0x1b

◆ USER_DATA_SELECTOR

#define USER_DATA_SELECTOR   0x23

Function Documentation

◆ __attribute__()

struct gdt __attribute__ ( (packed) )

◆ gdt_load()

void gdt_load ( struct gdt * gdt,
unsigned int size )

◆ gdt_read()

void gdt_read ( struct gdt_descriptor * target)

◆ gdt_structured_to_gdt()

void gdt_structured_to_gdt ( struct gdt * gdt,
struct gdt_structured * structured_gdt,
unsigned int total_entries )

References encode_gdt_entry().

Variable Documentation

◆ __attribute__

struct gdt_structured __attribute__

◆ access

uint8_t access

◆ base

uint8_t base

◆ base_24_31_bits

uint8_t base_24_31_bits

◆ base_first

uint16_t base_first

◆ high_flags

uint8_t high_flags

◆ segment

uint16_t segment

◆ size

uint16_t size

◆ start_address

uint32_t start_address