MentOS  0.8.0
The Mentoring Operating System
Macros | Functions
pic8259.h File Reference

Data structures and functions required to manage the PIC8259. More...

Go to the source code of this file.

Macros

#define IRQ_NUM   16
 The total number of IRQs.
 
#define IRQ_TIMER   0
 System timer.
 
#define IRQ_KEYBOARD   1
 Keyboard controller.
 
#define IRQ_TO_SLAVE_PIC   2
 cascaded signals from IRQs 8–15 (any devices configured to use IRQ 2 will actually be using IRQ 9)
 
#define IRQ_COM2_4   3
 Serial port controller for serial port 2 (and 4).
 
#define IRQ_COM1_3   4
 Serial port controller for serial port 1 (and 3).
 
#define IRQ_LPT2   5
 Parallel port 2 and 3 (or sound card).
 
#define IRQ_FLOPPY   6
 Floppy disk controller.
 
#define IRQ_LPT1   7
 Parallel port 1.
 
#define IRQ_REAL_TIME_CLOCK   8
 Real-time clock (RTC).
 
#define IRQ_AVAILABLE_1   9
 Advanced Configuration and Power Interface (ACPI) system control interrupt on Intel chipsets.[1] Other chipset manufacturers might use another interrupt for this purpose, or make it available for the use of peripherals (any devices configured to use IRQ 2 will actually be using IRQ 9)
 
#define IRQ_AVAILABLE_2   10
 The Interrupt is left open for the use of peripherals (open interrupt/available, SCSI or NIC).
 
#define IRQ_AVAILABLE_3   11
 The Interrupt is left open for the use of peripherals (open interrupt/available, SCSI or NIC).
 
#define IRQ_MOUSE   12
 Mouse on PS/2 connector.
 
#define IRQ_MATH_CPU   13
 CPU co-processor or integrated floating point unit or inter-processor interrupt (use depends on OS).
 
#define IRQ_FIRST_HD   14
 Primary ATA channel (ATA interface usually serves hard disk drives and CD drives).
 
#define IRQ_SECOND_HD   15
 Secondary ATA channel.
 

Functions

void pic8259_init_irq (void)
 Function that initializes the processor pic 8259 that will manage the interruptions.
 
int pic8259_irq_enable (uint32_t irq)
 This function, enable irqs on the pic. More...
 
int pic8259_irq_disable (uint32_t irq)
 This function, disable irqs on the pic. More...
 
void pic8259_send_eoi (uint32_t irq)
 This is issued to the PIC chips at the end of an IRQ-based interrupt routine. More...
 

Detailed Description

Data structures and functions required to manage the PIC8259.

The Intel 8259 is a Programmable Interrupt Controller (PIC) designed for the Intel 8085 and Intel 8086 microprocessors.

Function Documentation

◆ pic8259_irq_disable()

int pic8259_irq_disable ( uint32_t  irq)

This function, disable irqs on the pic.

This function provide a tool for enabling irq from the pic processor.

Parameters
irqNumber of irq to enable.
Returns
0 If all OK, -1 on errors.

◆ pic8259_irq_enable()

int pic8259_irq_enable ( uint32_t  irq)

This function, enable irqs on the pic.

This function provide a tool for enabling irq from the pic processor.

Parameters
irqNumber of irq to enable.
Returns
0 If all OK, -1 on errors.

◆ pic8259_send_eoi()

void pic8259_send_eoi ( uint32_t  irq)

This is issued to the PIC chips at the end of an IRQ-based interrupt routine.

Parameters
irqThe interrupt number.