aboutsummaryrefslogtreecommitdiff
path: root/kernel/l0/kmain.c
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2014-12-01 18:20:45 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2014-12-01 18:20:45 +0100
commitc7bcf94b1e70721d0f7bfb5ca383d996559c2559 (patch)
tree845f9e6c2193f444c80b1506438e9280a52585e5 /kernel/l0/kmain.c
parent8f936e07ecb5af4053ad7d457a32e69695cb357e (diff)
downloadkogata-c7bcf94b1e70721d0f7bfb5ca383d996559c2559.tar.gz
kogata-c7bcf94b1e70721d0f7bfb5ca383d996559c2559.zip
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
Diffstat (limited to 'kernel/l0/kmain.c')
-rw-r--r--kernel/l0/kmain.c6
1 files changed, 6 insertions, 0 deletions
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 <gdt.h>
#include <idt.h>
+
+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");