Expand description
Interrupt Descriptor Table (IDT) for Strat9-OS
Handles CPU exceptions and hardware IRQs.
Inspired by MaestroOS idt.rs and Redox-OS kernel.
ModulesΒ§
- irq
- IRQ interrupt vector numbers (PIC1_OFFSET + IRQ number)
StructsΒ§
- Idtr π
- Interrupt
Return Decision - Decision returned by the raw interrupt trampolines.
- Live
IdtGate Info - Swap
GsGuard π - RAII guard: swap GS to kernel on entry if we came from Ring 3, and restore user GS automatically on drop (covers every exit path including early returns).
ConstantsΒ§
- KERNEL_
CODE_ πSELECTOR
StaticsΒ§
- IDT_
STORAGE π - Static IDT storage (must be βstatic for load())
- IDT_
STORAGE_ πLOCK - RESCHED_
IPI_ πTRACE_ BUDGET - USER_
PF_ πTRACE_ BUDGET
FunctionsΒ§
- ahci_
handler π - AHCI storage controller IRQ handler.
- breakpoint_
handler π - Performs the breakpoint handler operation.
- decode_
error_ πcode - Decodes
PageFaultErrorCodebits into a human-readable string. - double_
fault_ πhandler - Performs the double fault handler operation.
- dump_
memory_ πbytes - Hex + ASCII dump of
countbytes at virtual addressvaddr. Each page boundary is translated through the raw page tables. - dump_
nearby_ πvma_ regions - Dumps VMA regions near the faulting address.
- dump_
page_ πfault_ full - Full diagnostic dump for a non-recoverable page fault.
- dump_
page_ πtable_ walk - Detailed page table walk with flag decoding at every level.
- dump_
user_ πpf_ context - Performs the dump user pf context operation.
- format_
pte_ πflags - Formats page table entry flags into a short human-readable byte string.
- general_
protection_ πfault_ handler - Performs the general protection fault handler operation.
- init
- invalid_
opcode_ πhandler - Performs the invalid opcode handler operation.
- keyboard_
handler π - Performs the keyboard handler operation.
- lapic_
timer_ π βentry - Raw Local APIC timer interrupt entry.
- lapic_
timer_ πhandler - Local APIC timer handler (dedicated vector, e.g. 0xD2).
- lapic_
timer_ πinner - legacy_
timer_ πhandler - Legacy external timer IRQ handler (PIC/IOAPIC IRQ0 path, vector 0x20).
- live_
gate_ info - load
- lock_
idt_ πstorage - mouse_
handler π - PS/2 Mouse IRQ12 handler.
- needs_
swapgs π - Determine whether
swapgsis needed at interrupt/exception entry. - nic_
handler π - NIC IRQ handler
- non_
maskable_ πinterrupt_ handler - nvme_
handler π - NVMe storage controller IRQ handler.
- page_
fault_ πhandler - Performs the page fault handler operation.
- register_
ahci_ irq - Register the AHCI storage controller IRQ handler.
- register_
lapic_ timer_ vector - Register the Local APIC timer IRQ vector to use the timer handler.
- register_
nic_ irq - Register the NIC IRQ handler.
- register_
nvme_ irq - Register the NVMe storage controller IRQ handler.
- register_
virtio_ block_ irq - Register the VirtIO block device IRQ handler
- register_
xhci_ irq - Register the xHCI USB controller IRQ handler.
- resched_
ipi_ π βentry - Raw reschedule IPI entry.
- resched_
ipi_ πhandler - Cross-CPU reschedule IPI handler (vector 0xF0).
- resched_
ipi_ πinner - spurious_
handler π - Spurious interrupt handler (APIC vector 0xFF). Per Intel SDM: do NOT send EOI for spurious interrupts.
- stack_
segment_ πfault_ handler - Performs the stack segment fault handler operation.
- tlb_
shootdown_ πhandler - Cross-CPU TLB shootdown IPI handler (vector 0xF0).
- translate_
via_ πraw_ pt - Translates a virtual address to a physical address via a manual 4-level
page table walk. Returns
Some(phys)orNoneif any level is absent. - unlock_
idt_ πstorage - virtio_
block_ πhandler - VirtIO Block device IRQ handler
- xhci_
handler π - xHCI USB controller IRQ handler