|
LumaOS
v0.1.116
An experimental x86-64 OS
|
Initializes and holds the GDT for the kernel. More...
#include <lib/kstring.h>#include <stdbool.h>#include <kernel/tools.h>#include <kernel/log.h>#include <stdint.h>Go to the source code of this file.
Macros | |
| #define | CODE_DATA_SEGMENT true |
| #define | LIMIT_BYTES false |
| #define | LIMIT_4KIB_PAGES true |
| #define | SEGMENT_32_BIT true |
| #define | SEGMENT_16_BIT false |
Functions | |
| struct | __attribute__ ((packed)) gdt_entry |
| Entry to be passed to the gdt. | |
| void | init_gdt (void) |
| Initializes the gdt and loads it. | |
| void | gdt_set_entry (int index, uint8_t access, uint8_t flags) |
| Sets an entry of the gdt with the correct access and flags. | |
| uint8_t | get_access_byte (bool rw, bool exec, bool type, uint8_t dpl) |
| Generates the access byte for the GDT. | |
| uint8_t | get_flag_byte (bool granularity, bool size, bool long_mode) |
| Generates the flag byte for the GDT. | |
Initializes and holds the GDT for the kernel.
Definition in file gdt.h.
| struct __attribute__ | ( | (packed) | ) |
Entry to be passed to the gdt.
The idtr register holding information about the idt.
Struct to be passed to the cpu holding information about the gdt.
TSS Entry (Equivalent to 2 gdt entries).
Generate access byte with get_access_byte()
Generate flag byte with get_flag_byte()
IST stack addresses
Size of the gdt
Address of the first gdt entry
| void gdt_set_entry | ( | int | index, |
| uint8_t | access, | ||
| uint8_t | flags ) |
| uint8_t get_access_byte | ( | bool | rw, |
| bool | exec, | ||
| bool | type, | ||
| uint8_t | dpl ) |
| uint8_t get_flag_byte | ( | bool | granularity, |
| bool | size, | ||
| bool | long_mode ) |