Struct rstubs::arch::gdt::GlobalDescriptorTable
source · #[repr(C, align(16))]pub struct GlobalDescriptorTable<const N: usize>(pub [Descriptor; N]);
Expand description
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
).
- ISDMv3, 2.4.1; Global Descriptor Table Register (GDTR)
- ISDMv3, 3.5.1; Segment Descriptor Tables
Tuple Fields§
§0: [Descriptor; N]
Implementations§
source§impl<const N: usize> GlobalDescriptorTable<N>
impl<const N: usize> GlobalDescriptorTable<N>
pub const fn pointer(&self) -> DescriptorTablePointer
pub const fn selector(&self, idx: usize, user: bool) -> SegmentSelector
Trait Implementations§
source§impl<const N: usize> Clone for GlobalDescriptorTable<N>
impl<const N: usize> Clone for GlobalDescriptorTable<N>
source§fn clone(&self) -> GlobalDescriptorTable<N>
fn clone(&self) -> GlobalDescriptorTable<N>
Returns a copy of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more