[docs] ...

This commit is contained in:
Kevin Lange 2011-03-04 21:05:03 -06:00
parent e26c53dfc0
commit 19d47ce98e
3 changed files with 19 additions and 1 deletions

View File

@ -1,12 +1,15 @@
#include <system.h>
/*
* Global Descriptor Tablet Entry
* Global Descriptor Table Entry
*/
struct gdt_entry {
/* Limits */
unsigned short limit_low;
/* Segment address */
unsigned short base_low;
unsigned char base_middle;
/* Access modes */
unsigned char access;
unsigned char granularity;
unsigned char base_high;

View File

@ -11,6 +11,9 @@ struct idt_entry {
unsigned short base_high;
} __attribute__((packed));
/*
* IDT pointer
*/
struct idt_ptr {
unsigned short limit;
uintptr_t base;

View File

@ -19,6 +19,9 @@ extern void _irq15();
static irq_handler_t irq_routines[16] = { NULL };
/*
* Install an interupt handler for a hardware device.
*/
void
irq_install_handler(
int irq,
@ -27,6 +30,9 @@ irq_install_handler(
irq_routines[irq] = handler;
}
/*
* Remove an interrupt handler for a hardware device.
*/
void
irq_uninstall_handler(
int irq
@ -34,6 +40,9 @@ irq_uninstall_handler(
irq_routines[irq] = 0;
}
/*
* Remap interrupt handlers
*/
void
irq_remap() {
outportb(0x20, 0x11);
@ -48,6 +57,9 @@ irq_remap() {
outportb(0xA1, 0x0);
}
/*
* Set up interrupt handler for hardware devices.
*/
void
irq_install() {
irq_remap();