Skip to main content

Module idt

Module idt 

Source
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ยง

IdtStorage ๐Ÿ”’
Combined IDT storage + lock in a single struct to prevent memory corruption. The static mut InterruptDescriptorTable initialization was corrupting the adjacent AtomicBool lock.
Idtr ๐Ÿ”’
InterruptReturnDecision
Decision returned by the raw interrupt trampolines.
LiveIdtGateInfo
SwapGsGuard ๐Ÿ”’
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 ๐Ÿ”’
Kernel code segment selector for IDT entries.

Staticsยง

IDT_STORAGEWrapper ๐Ÿ”’
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 PageFaultErrorCode bits into a human-readable string.
double_fault_handler ๐Ÿ”’
Performs the double fault handler operation.
dump_memory_bytes ๐Ÿ”’
Hex + ASCII dump of count bytes at virtual address vaddr. 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 swapgs is 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_nvme_irq_vector
Register the NVMe storage controller IRQ handler for a specific vector.
register_virtio_block_irq
Register the VirtIO block device IRQ handler
register_xhci_irq
register_xhci_irq_vector
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) or None if any level is absent.
unlock_idt_storage ๐Ÿ”’
virtio_block_handler ๐Ÿ”’
VirtIO Block device IRQ handler
xhci_handler ๐Ÿ”’
xHCI USB controller IRQ handler