mirror of
https://github.com/cfenollosa/os-tutorial.git
synced 2025-12-17 20:34:36 +03:00
lesson 20, keyboard
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
#include "idt.h"
|
||||
#include "../kernel/util.h"
|
||||
|
||||
void set_idt_gate(int n, u32 handler) {
|
||||
idt[n].low_offset = low_16(handler);
|
||||
idt[n].sel = KERNEL_CS;
|
||||
idt[n].always0 = 0;
|
||||
idt[n].flags = 0x8E;
|
||||
idt[n].high_offset = high_16(handler);
|
||||
}
|
||||
|
||||
void set_idt() {
|
||||
idt_reg.base = (u32) &idt;
|
||||
idt_reg.limit = IDT_ENTRIES * sizeof(idt_gate_t) - 1;
|
||||
/* Don't make the mistake of loading &idt -- always load &idt_reg */
|
||||
__asm__ __volatile__("lidtl (%0)" : : "r" (&idt_reg));
|
||||
}
|
||||
1
20-interrupts-timer/cpu/idt.c
Symbolic link
1
20-interrupts-timer/cpu/idt.c
Symbolic link
@@ -0,0 +1 @@
|
||||
../../19-interrupts-irqs/cpu/idt.c
|
||||
Reference in New Issue
Block a user