diff options
author | Robin Krahl <robin.krahl@ireas.org> | 2017-03-06 02:52:05 +0100 |
---|---|---|
committer | Robin Krahl <robin.krahl@ireas.org> | 2017-03-06 02:52:05 +0100 |
commit | 05b9ca73793047e795e46a2ae13db02c34b8a7c3 (patch) | |
tree | 5ab672db87c57cbe01662547e7733e71aa748743 /arch/x86_64/arch.c | |
parent | 28301499381cb541eec4eb99f61e3d1a193c5a2d (diff) | |
download | garmos-05b9ca73793047e795e46a2ae13db02c34b8a7c3.tar.gz garmos-05b9ca73793047e795e46a2ae13db02c34b8a7c3.tar.bz2 |
idt: add interruption handling
The Interruption Descriptor Table (IDT) is implemented in idt.{c,h} as
part of the core, but the setup and activation of the IDT and the
registration of specific interruption request handlers is part of
arch.{c,h}. The request handlers are implemented in idt.s and
delegate to kernel_handle_interrupt.
Diffstat (limited to 'arch/x86_64/arch.c')
-rw-r--r-- | arch/x86_64/arch.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/x86_64/arch.c b/arch/x86_64/arch.c index d7762c2..a8c1417 100644 --- a/arch/x86_64/arch.c +++ b/arch/x86_64/arch.c @@ -15,6 +15,16 @@ #include <garmos/arch.h> #include <garmos/types.h> +void irqhdl0x00(void); +void irqhdl0x01(void); + +uint8_t irqnos[3] = { 0x20, 0x21, 0 }; +uint32_t irqhdls[3] = { + (uint32_t) &irqhdl0x00, + (uint32_t) &irqhdl0x01, + 0 +}; + void prtset8(const uint16_t port, const uint8_t val) { asm volatile("outb %0, %1" : : "a" (val), "Nd" (port)); @@ -79,3 +89,13 @@ void gdtset(struct gdtp gdtp) { asm volatile("lgdt %0" : : "m" (gdtp)); } + +void idtset(struct idtp idtp) +{ + asm volatile("lidt %0" : : "m" (idtp)); +} + +void idtact(void) +{ + asm("sti"); +} |