2018-12-04 09:46:27 +00:00
|
|
|
/* https://github.com/cirosantilli/x86-bare-metal-examples#lidt */
|
|
|
|
|
|
2015-10-17 00:03:05 +02:00
|
|
|
#include "common.h"
|
|
|
|
|
BEGIN
|
|
|
|
|
CLEAR
|
2018-05-06 14:33:33 +01:00
|
|
|
cli
|
|
|
|
|
movw $handler, idt_start
|
|
|
|
|
mov %cs, idt_start + 2
|
2015-10-17 00:03:05 +02:00
|
|
|
lidt idt_descriptor
|
|
|
|
|
int $0
|
2015-10-21 15:55:27 +02:00
|
|
|
PUTC $'b
|
2015-10-17 00:03:05 +02:00
|
|
|
hlt
|
2018-05-06 14:33:33 +01:00
|
|
|
idt_start:
|
|
|
|
|
.word handler
|
|
|
|
|
.word
|
2015-10-17 00:03:05 +02:00
|
|
|
idt_end:
|
|
|
|
|
idt_descriptor:
|
2018-05-06 14:33:33 +01:00
|
|
|
.word idt_end - idt_start
|
|
|
|
|
.long idt_start
|
2015-10-17 00:03:05 +02:00
|
|
|
handler:
|
2015-10-21 15:55:27 +02:00
|
|
|
PUTC $'a
|
2015-10-17 00:03:05 +02:00
|
|
|
iret
|