2018-12-04 09:46:27 +00:00
|
|
|
/* https://github.com/cirosantilli/x86-bare-metal-examples#interrupts */
|
|
|
|
|
|
2015-09-21 09:43:03 +02:00
|
|
|
#include "common.h"
|
|
|
|
|
BEGIN
|
|
|
|
|
CLEAR
|
2018-05-06 14:33:33 +01:00
|
|
|
DBG
|
|
|
|
|
/* Set address of the handler for interrupt 0. */
|
2015-09-21 09:43:03 +02:00
|
|
|
movw $handler, 0x00
|
2018-05-06 14:33:33 +01:00
|
|
|
/* Set code segment of the handler for interrupt 0. */
|
2015-10-04 19:59:15 +02:00
|
|
|
mov %cs, 0x02
|
2015-09-24 10:17:28 +02:00
|
|
|
int $0
|
2015-10-21 15:55:27 +02:00
|
|
|
PUTC $'b
|
2015-10-17 00:03:05 +02:00
|
|
|
hlt
|
2015-09-21 09:43:03 +02:00
|
|
|
handler:
|
2015-10-21 15:55:27 +02:00
|
|
|
PUTC $'a
|
2015-09-24 10:17:28 +02:00
|
|
|
iret
|