33 void gdtLoad(const
igros::x86_64::gdt::pointer_t* gdtPtr) noexcept;
83 .pointer = table.data(),
89 std::ranges::copy(descriptor, table.begin() + (
TSS /
sizeof(
entry_t)));
static constexpr auto TSS
16-byte descriptor: entries 5 and 6
static constexpr auto GDT_ENTRY_CODE_RING3
User code segment (ring 3, code).
static constexpr auto GDT_ENTRY_DATA_RING0
Kernel data segment (ring 0, data).
static constexpr auto tssEntry(const igros_quad_t base, const igros_dword_t limit) noexcept -> std::array< entry_t, 2 >
64-bit available TSS descriptor (two GDT entries: base is 64-bit)
static void setPointer(const pointer_t &pointer) noexcept
Set GDT pointer.
std::array< gdt::entry_t, gdt::GDT_SIZE > table_t
GDT table.
static constexpr auto GDT_ENTRY_CODE_RING0
Kernel code segment (ring 0, code).
static constexpr auto GDT_ENTRY_DATA_RING3
User data segment (ring 3, data).
static constexpr auto calcSize(const table_t &table) noexcept -> igros_word_t
Calc GDT size.
static constexpr auto setEntry(const igros_dword_t base, const igros_dword_t limit, const klib::kFlags< FLAGS > flags) noexcept -> entry_t
Set GDT entry.
static constexpr auto GDT_ENTRY_EMPTY
Empty GDT entry (the first one).
static void init() noexcept
Init GDT table.
static auto init() noexcept -> const segment_t &
Set up task state segment interrupt stacks (returns static segment for GDT).
std::uint32_t igros_dword_t
32-bit unsigned integer
std::uint64_t igros_quad_t
64-bit unsigned integer
void gdtLoad(const igros::i386::gdt::pointer_t *const gdtPtr) noexcept
Load GDT.
void gdtStore(igros::i386::gdt::pointer_t *const gdtPtr) noexcept
Store GDT.
void gdtResetSegments() noexcept
Reset segments to apply new GDT.
void tssLoad(const igros::igros_word_t selector) noexcept
Load task register.
x86_64 (long mode): GDT, IDT, TSS, CPUID, MSR, CPU registers
IgrOS kernel: common types and literals.
Global descriptor table low-level operations.
Task state segment (x86_64).