PatchworkOS
Loading...
Searching...
No Matches
pic.c
Go to the documentation of this file.
2
4#include <kernel/cpu/port.h>
5#include <kernel/log/log.h>
6
7void pic_disable(void)
8{
9 // We initialize the PIC before we then mask all interrupts.
10 // Probably not needed but it ensures that the PIC is in a known state before we disable it.
11
13 port_wait();
15 port_wait();
16
18 port_wait();
20 port_wait();
21
23 port_wait();
25 port_wait();
26
28 port_wait();
30 port_wait();
31
33 port_wait();
35 port_wait();
36
38 port_wait();
40 port_wait();
41
42 // Mask all interrupts.
43 port_outb(PIC1_DATA, 0xFF);
44 port_outb(PIC2_DATA, 0xFF);
45
46 LOG_INFO("pic disabled\n");
47}
@ EXTERNAL_INTERRUPT_BASE
Definition interrupt.h:132
#define ICW1_INIT
Definition port.h:19
static uint8_t port_inb(uint16_t port)
Definition port.h:34
#define ICW4_8086
Definition port.h:21
static void port_wait(void)
Definition port.h:65
static void port_outb(uint16_t port, uint8_t val)
Definition port.h:29
#define ICW1_ICW4
Definition port.h:15
#define LOG_INFO(format,...)
Definition log.h:87
void pic_disable(void)
Definition pic.c:7
#define PIC2_COMMAND
Definition pic.h:7
#define PIC2_DATA
Definition pic.h:8
#define PIC1_COMMAND
Definition pic.h:5
#define PIC1_DATA
Definition pic.h:6
__UINT8_TYPE__ uint8_t
Definition stdint.h:11