pub fn init() -> KernelResult<()>Expand description
Initialize the Local APIC and I/O APIC.
This function:
- Reads the APIC base address from the IA32_APIC_BASE MSR.
- Ensures the global APIC enable bit is set in the MSR.
- Translates physical MMIO addresses to virtual using the bootloader’s physical memory offset.
- Initializes the Local APIC (software enable, mask all LVTs, set TPR=0).
- Initializes the I/O APIC (mask all redirection entries).
Must be called after GDT/IDT initialization but before interrupts are
enabled. Safe to call exactly once; subsequent calls return
AlreadyExists.