[docs] ...
This commit is contained in:
parent
e26c53dfc0
commit
19d47ce98e
@ -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;
|
||||
|
@ -11,6 +11,9 @@ struct idt_entry {
|
||||
unsigned short base_high;
|
||||
} __attribute__((packed));
|
||||
|
||||
/*
|
||||
* IDT pointer
|
||||
*/
|
||||
struct idt_ptr {
|
||||
unsigned short limit;
|
||||
uintptr_t base;
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user