2015-09-21 09:43:03 +02:00
|
|
|
/*
|
|
|
|
|
Minimal interrupt example.
|
|
|
|
|
|
2015-09-24 10:17:28 +02:00
|
|
|
Should print the characters 'ab' to screen.
|
2015-09-21 09:43:03 +02:00
|
|
|
|
|
|
|
|
TODO: is STI not needed because this interrupt is not maskable?
|
|
|
|
|
|
2015-09-24 10:17:28 +02:00
|
|
|
TODO: use IDTR as a base. Is the initial value 0 guaranteed?
|
2015-09-29 23:55:54 +02:00
|
|
|
|
|
|
|
|
TODO: interrupt priority: order looks like: 0, 1, 2, 8, 9, 10, 11, 12, 13, 14, 15, 3, 4, 5, 6, 7
|
|
|
|
|
|
|
|
|
|
## iret
|
|
|
|
|
|
|
|
|
|
Returns to the next instruction to be executed
|
|
|
|
|
before the interrupt came in.
|
2015-09-21 09:43:03 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
BEGIN
|
|
|
|
|
CLEAR
|
|
|
|
|
movw $handler, 0x00
|
2015-09-29 23:55:54 +02:00
|
|
|
movw %cs, 0x02
|
2015-09-24 10:17:28 +02:00
|
|
|
int $0
|
|
|
|
|
PUTC($0x62)
|
|
|
|
|
jmp end
|
2015-09-21 09:43:03 +02:00
|
|
|
handler:
|
|
|
|
|
PUTC($0x61)
|
2015-09-24 10:17:28 +02:00
|
|
|
iret
|
|
|
|
|
end:
|
2015-09-21 09:43:03 +02:00
|
|
|
hlt
|
|
|
|
|
END
|