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