From c7bcf94b1e70721d0f7bfb5ca383d996559c2559 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 1 Dec 2014 18:20:45 +0100 Subject: Small adjustments: - add missing vim modelines - idt_set_ex_handler, idt_set_irq_handler - inline inb,inw,outb,outw - add defines for exceptions and irqs --- kernel/l0/kmain.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'kernel/l0/kmain.c') diff --git a/kernel/l0/kmain.c b/kernel/l0/kmain.c index 854a2b7..7665cb0 100644 --- a/kernel/l0/kmain.c +++ b/kernel/l0/kmain.c @@ -5,6 +5,11 @@ #include #include + +void breakpoint_handler(registers_t *regs) { + dbg_printf("Breakpoint! (int3)\n"); + BOCHS_BREAKPOINT; +} void kmain(struct multiboot_info_t *mbd, int32_t mb_magic) { dbglog_setup(); @@ -17,6 +22,7 @@ void kmain(struct multiboot_info_t *mbd, int32_t mb_magic) { gdt_init(); dbg_printf("GDT set up.\n"); idt_init(); dbg_printf("IDT set up.\n"); + idt_set_ex_handler(EX_BREAKPOINT, breakpoint_handler); asm volatile("int $0x3"); -- cgit v1.2.3