GitOS
Operating system exercise
Loading...
Searching...
No Matches
pic.h File Reference
#include <stdint.h>

Go to the source code of this file.

Macros

#define PIC1   0x20 /* IO base address for master PIC */
 
#define PIC2   0xA0 /* IO base address for slave PIC */
 
#define PIC1_COMMAND   PIC1
 
#define PIC1_DATA   (PIC1+1)
 
#define PIC2_COMMAND   PIC2
 
#define PIC2_DATA   (PIC2+1)
 

Functions

void pic_Remap (uint8_t offset1, uint8_t offset2)
 Remaps master PIC and slave PIC to specified interupts numbers.
 
void pic_EOI (unsigned char irq)
 Sends End Of Interrupt to PIC.
 
void pic_SetHz (uint16_t hz)
 Sets PIT Channel 0 frequency.
 

Macro Definition Documentation

◆ PIC1

#define PIC1   0x20 /* IO base address for master PIC */

◆ PIC1_COMMAND

#define PIC1_COMMAND   PIC1

◆ PIC1_DATA

#define PIC1_DATA   (PIC1+1)

◆ PIC2

#define PIC2   0xA0 /* IO base address for slave PIC */

◆ PIC2_COMMAND

#define PIC2_COMMAND   PIC2

◆ PIC2_DATA

#define PIC2_DATA   (PIC2+1)

Function Documentation

◆ pic_EOI()

void pic_EOI ( unsigned char  irq)

Sends End Of Interrupt to PIC.

Parameters
irqNumber of IRQ to EOI

References END_OF_INTERRUPT, outb(), PIC1_COMMAND, and PIC2_COMMAND.

◆ pic_Remap()

void pic_Remap ( uint8_t  offset1,
uint8_t  offset2 
)

Remaps master PIC and slave PIC to specified interupts numbers.

Parameters
offset1New starting interrupt number for master PIC (IRQ 0-7)
offset2New starting interrupt number for slave PIC (IRQ 8-15)

References ICW1_ICW4, ICW1_INIT, ICW4_8086, outb(), PIC1_COMMAND, PIC1_DATA, PIC2_COMMAND, and PIC2_DATA.

◆ pic_SetHz()

void pic_SetHz ( uint16_t  hz)

Sets PIT Channel 0 frequency.

Parameters
hzDesired PIT Hz

References outb().