summaryrefslogtreecommitdiff
path: root/kernel/x86.h
blob: 345162ffe5fef8a1266fe0e1820e6dd289d78cf3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#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();
void x86_flush_tlb(uint32_t addr);

#endif