2019-07-19 00:00:00 +00:00
|
|
|
/* 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-30 19:03:23 +02:00
|
|
|
|
2015-09-29 23:55:54 +02:00
|
|
|
BEGIN
|
2015-11-09 12:15:15 +01:00
|
|
|
IVT_PIT_SETUP
|
2015-11-10 20:43:08 +01:00
|
|
|
PIT_GENERATE_FREQUENCY
|
2015-11-09 12:15:15 +01:00
|
|
|
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
|
2015-10-21 15:55:27 +02:00
|
|
|
PUTC $'a
|
2015-10-30 15:24:06 +01:00
|
|
|
PUTC $'\n
|
|
|
|
|
/* EOI: it will not fire again unless we reset it. */
|
2015-11-09 12:15:15 +01:00
|
|
|
PIC_EOI
|
2015-10-30 15:24:06 +01:00
|
|
|
sti
|
2015-10-04 19:59:15 +02:00
|
|
|
iret
|