blob: 3233124a1bd709113481110cd96ed7c368079f52 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#ifndef FOOLOS_X86_H
#define FOOLOS_X86_H
#include "kernel.h"
// todo: cli/sti??
// http://wiki.osdev.org/Interrupt_Service_Routines
// Black Magic: Strongly Discouraged!
#define X86_IRQ_BEGIN asm("\npusha");
#define X86_IRQ_END asm("mov $0x20, %al\nout %al, $0x20\npopa\nleave\niret");
void x86_outb(int port, uint8_t data);
uint8_t x86_inb(int port);
void x86_outw(int port, uint16_t data);
uint16_t x86_inw(int port);
void x86_outl(int port, uint32_t data);
uint32_t x86_inl(int port);
void x86_set_pdbr(uint32_t addr);
void x86_paging_enable();
#endif
|