//! This module defines the GDT and its segments.
use crate::arch::gdt::{Descriptor, GlobalDescriptorTable, Ring};
use crate::arch::DescriptorTablePointer;
/// The global descriptor table
pub static mut GDT: GlobalDescriptorTable<3> = GlobalDescriptorTable([
// First one is usually null
Descriptor::new(),
// Kernel code
Descriptor::segment(0..=u32::MAX, true, Ring::System),
// Kernel data
Descriptor::segment(0..=u32::MAX, false, Ring::System),
// TODO: BSB B1 - Add user code, user data and TSS segments
]);
/// Fat pointer to the GDT, used by the boot asm code.
#[no_mangle]
pub static GDT_PTR: DescriptorTablePointer = unsafe { GDT.pointer() };