blu_os
Loading...
Searching...
No Matches
pic.h
1//
2// Created by dylan on 11/07/2026.
3//
4
5#ifndef BLU_OS_PIC_H
6#define BLU_OS_PIC_H
7
8#include <stdint.h>
9
10#define PIC1 0x20
11#define PIC2 0xA0
12#define PIC1_COMMAND PIC1
13#define PIC1_DATA (PIC1 + 1)
14#define PIC2_COMMAND PIC2
15#define PIC2_DATA (PIC2 + 1)
16#define PIC_EOI 0x20
17
18#define ICW1_ICW4 0x01
19#define ICW1_SINGLE 0x02
20#define ICW1_INTERVAL4 0x04
21#define ICW1_LEVEL 0x08
22#define ICW1_INIT 0x10
23
24#define ICW4_8086 0x01
25#define ICW4_AUTO 0x02
26#define ICW4_BUF_SLAVE 0x08
27#define ICW4_BUF_MASTER 0x0C
28#define ICW4_SFNM 0x10
29
30#define CASCADE_IRQ 2
31
32#define PIC_READ_IRR 0x0a
33#define PIC_READ_ISR 0x0b
34
35void picSendEoi(uint8_t irq);
36
37void remapPic(uint32_t offset1, uint32_t offset2);
38
39void disablePic();
40
41void irqSetMask(uint8_t irqLine);
42
43void irqClearMask(uint8_t irqLine);
44
45uint16_t getPicIrr();
46
47uint16_t getPicIsr();
48
49
50#endif //BLU_OS_PIC_H
Fixed-width integer types.