diff --git a/kernel/core/gdt.c b/kernel/core/gdt.c index e645646d..55377b6a 100644 --- a/kernel/core/gdt.c +++ b/kernel/core/gdt.c @@ -1,12 +1,15 @@ #include /* - * 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; diff --git a/kernel/core/idt.c b/kernel/core/idt.c index 87df2544..f10a60f9 100644 --- a/kernel/core/idt.c +++ b/kernel/core/idt.c @@ -11,6 +11,9 @@ struct idt_entry { unsigned short base_high; } __attribute__((packed)); +/* + * IDT pointer + */ struct idt_ptr { unsigned short limit; uintptr_t base; diff --git a/kernel/core/irq.c b/kernel/core/irq.c index 0e959f89..e82854cc 100644 --- a/kernel/core/irq.c +++ b/kernel/core/irq.c @@ -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();