aboutsummaryrefslogtreecommitdiff
path: root/i686/isr.c
blob: 4f6729ba4c85e89803a8840fdc386a31d391b19a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
 * Interrupt Service Routines
 */

#include "idt.h"
#include "sys/control.h"
#include <stdio.h>

__attribute__((interrupt)) void
abort_handler(struct interrupt_frame *frame)
{
  printf("### system abort ###\n");
  printf("#   ip: %x cs=%x\n", frame->ip, frame->cs);
  printf("#   sp: %x ss=%x\n", frame->sp, frame->ss);
  printf("#   flags: %x\n", frame->flags);
  abort();
}

__attribute__((interrupt)) void
syscall_handler(struct interrupt_frame *)
{
  printf("syscall\n");
  abort();
}

extern void pic_clear(unsigned char irq);

__attribute__((interrupt)) void
irq0x00(struct interrupt_frame *)
{
  // printf("irq0x00\n");
  pic_clear(0x00);
}

extern void ps2_keyboard_irq_handler();
__attribute__((interrupt)) void
irq0x01(struct interrupt_frame *)
{
  // printf("irq0x01\n");
  ps2_keyboard_irq_handler();
  pic_clear(0x00);
}