Function gdt::create_and_load_tss_gdt
source · pub fn create_and_load_tss_gdt(
cpu_id: CpuId,
double_fault_stack_top_unusable: VirtualAddress,
privilege_stack_top_unusable: VirtualAddress
)
Expand description
This function first creates and sets up a new TSS with the given double fault stack and privilege stack.
It then creates a new GDT with an entry that references that TSS and loads that new GDT into memory.
Finally, it switches the various code and segment selectors to use that new GDT.
Important Note
The GDT entries (segment descriptors) are only created once upon first invocation of this function, such that the segment selectors are usable Future invocations will not change those initial values and load the same GDT based on them.