Skip to main content

Module pic

Module pic 

Source
Expand description

8259 Programmable Interrupt Controller (PIC) driver Inspired by MaestroOS pic.rs

The PIC handles hardware interrupts (IRQs) and maps them to CPU interrupt vectors. We remap IRQs to vectors 0x20-0x2F.

Constantsยง

COMMAND_EOI ๐Ÿ”’
End-of-interrupt command
ICW1_ICW4 ๐Ÿ”’
ICW1_INIT ๐Ÿ”’
ICW1: Initialization + ICW4 needed
ICW3_CASCADE ๐Ÿ”’
ICW3: Cascade identity for slave
ICW3_SLAVE_PIC ๐Ÿ”’
ICW3: Slave PIC on IRQ2
ICW4_8086 ๐Ÿ”’
ICW4: 8086 mode
MASTER_COMMAND ๐Ÿ”’
Master PIC command port
MASTER_DATA ๐Ÿ”’
Master PIC data port
PIC1_OFFSET
IRQ offset for master PIC (IRQ0 -> interrupt 0x20)
PIC2_OFFSET
IRQ offset for slave PIC (IRQ8 -> interrupt 0x28)
SLAVE_COMMAND ๐Ÿ”’
Slave PIC command port
SLAVE_DATA ๐Ÿ”’
Slave PIC data port

Functionsยง

disable
Disable all IRQs on both PICs.
disable_irq
Disable a specific IRQ line.
disable_permanently
Disable the 8259 PIC permanently by masking all IRQs.
enable_irq
Enable a specific IRQ line.
end_of_interrupt
Send End-Of-Interrupt to the PIC for the given IRQ.
init
Initialize the PIC with the given offsets.