1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2024-11-27 11:24:34 -05:00

Display interrupt names

This commit is contained in:
Braiden Vasco 2017-11-01 10:59:18 +00:00
parent d1ebb35f58
commit 9bc52f2f66
2 changed files with 40 additions and 1 deletions

View file

@ -7,7 +7,42 @@ struct IsrRegisters {
unsigned int eip, cs, eflags, useresp, ss; // Pushed by the processor automatically.
};
static const char *const messages[] = {
"Unhandled interrupt: 0x0",
"Unhandled interrupt: 0x1",
"Unhandled interrupt: 0x2",
"Unhandled interrupt: 0x3",
"Unhandled interrupt: 0x4",
"Unhandled interrupt: 0x5",
"Unhandled interrupt: 0x6",
"Unhandled interrupt: 0x7",
"Unhandled interrupt: 0x8",
"Unhandled interrupt: 0x9",
"Unhandled interrupt: 0xA",
"Unhandled interrupt: 0xB",
"Unhandled interrupt: 0xC",
"Unhandled interrupt: 0xD",
"Unhandled interrupt: 0xE",
"Unhandled interrupt: 0xF",
"Unhandled interrupt: 0x10",
"Unhandled interrupt: 0x11",
"Unhandled interrupt: 0x12",
"Unhandled interrupt: 0x13",
"Unhandled interrupt: 0x14",
"Unhandled interrupt: 0x15",
"Unhandled interrupt: 0x16",
"Unhandled interrupt: 0x17",
"Unhandled interrupt: 0x18",
"Unhandled interrupt: 0x19",
"Unhandled interrupt: 0x1A",
"Unhandled interrupt: 0x1B",
"Unhandled interrupt: 0x1C",
"Unhandled interrupt: 0x1D",
"Unhandled interrupt: 0x1E",
"Unhandled interrupt: 0x1F",
};
void isr(struct IsrRegisters regs)
{
logger_warn("ISR.");
logger_warn(messages[regs.int_no]);
}

View file

@ -23,8 +23,12 @@ void main(unsigned int multiboot_magic)
gdt_initialize();
idt_initialize();
asm volatile ("int $0x0");
asm volatile ("int $0x3");
asm volatile ("int $0x4");
asm volatile ("int $0xF");
asm volatile ("int $0x10");
asm volatile ("int $0x1F");
logger_warn("Nothing to do.");
logger_fail("Halt.");