StuBS
|
Abstracts the GDT that, primarily, contains descriptors to memory segments. More...
Classes | |
struct | SegmentDescriptor.__unnamed40__ |
Fields specific for Data Segment (for debugging purposes) More... | |
Enumerations | |
enum | Segments { SEGMENT_NULL = 0 , SEGMENT_KERNEL_CODE , SEGMENT_KERNEL_DATA } |
enum | Granularity { GRANULARITY_BYTES = 0 , GRANULARITY_4KBLOCK = 1 } |
Unit of the segment limit. More... | |
enum | DescriptorType { DESCRIPTOR_SYSTEM = 0 , DESCRIPTOR_CODEDATA = 1 } |
Descriptor type. More... | |
enum | Size { SIZE_16BIT = 0 , SIZE_32BIT = 2 , SIZE_64BIT = 1 } |
Address width. More... | |
Functions | |
constexpr Pointer | gdt_protected_mode_pointer (protected_mode) |
constexpr Pointer | gdt_long_mode_pointer (long_mode) |
Abstracts the GDT that, primarily, contains descriptors to memory segments.
The GDT is a table that primarily contains segment descriptors. Segment descriptors has a size of 8 Bytes and contains the size, position, access rights, and purpose of such a segment. Unlike the LDT, the GDT is shared between all processes and may contain TSS and LDT descriptors. For the kernel, the first entry is required to be a null descriptor and the code and data segments. To support user-mode processes, additional TSS, code, and data segments for ring 3 must be added.
The base address and size of the GDT are written to the GDTR register during boot (via. lgdt
).
struct GDT::SegmentDescriptor.__unnamed40__ |
Fields specific for Data Segment (for debugging purposes)
enum GDT::Granularity |
enum GDT::DescriptorType |
enum GDT::Size |