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Β§

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 πŸ”’

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 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_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) 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