Files
x86-bare-metal-examples/pit.S

20 lines
400 B
ArmAsm
Raw Normal View History

/* https://github.com/cirosantilli/x86-bare-metal-examples#pit */
2018-12-04 09:46:27 +00:00
2015-09-29 23:55:54 +02:00
#include "common.h"
2015-09-29 23:55:54 +02:00
BEGIN
IVT_PIT_SETUP
2015-11-10 20:43:08 +01:00
PIT_GENERATE_FREQUENCY
PIT_SET_MIN_FREQ
/* If we comment out sti, nothing happens, because the PIT interrupts are maskable. */
2015-10-04 19:59:15 +02:00
sti
2015-10-30 15:24:06 +01:00
jmp .
2015-10-04 19:59:15 +02:00
handler:
2015-10-30 15:24:06 +01:00
cli
PUTC $'a
2015-10-30 15:24:06 +01:00
PUTC $'\n
/* EOI: it will not fire again unless we reset it. */
PIC_EOI
2015-10-30 15:24:06 +01:00
sti
2015-10-04 19:59:15 +02:00
iret