pit.S 400 B

1234567891011121314151617181920
  1. /* https://github.com/cirosantilli/x86-bare-metal-examples#pit */
  2. #include "common.h"
  3. BEGIN
  4. IVT_PIT_SETUP
  5. PIT_GENERATE_FREQUENCY
  6. PIT_SET_MIN_FREQ
  7. /* If we comment out sti, nothing happens, because the PIT interrupts are maskable. */
  8. sti
  9. jmp .
  10. handler:
  11. cli
  12. PUTC $'a
  13. PUTC $'\n
  14. /* EOI: it will not fire again unless we reset it. */
  15. PIC_EOI
  16. sti
  17. iret