pit_once.S 406 B

123456789101112131415161718192021
  1. /* https://github.com/cirosantilli/x86-bare-metal-examples#pit */
  2. #include "common.h"
  3. BEGIN
  4. IVT_PIT_SETUP
  5. /* Operating mode: 0 rate generator. */
  6. OUTB $0b00110000, PORT_PIT_MODE
  7. /* TODO: Set the counter to 1. */
  8. mov $0x01, %al
  9. out %al, PORT_PIT_CHANNEL0
  10. mov $0x00, %al
  11. out %al, PORT_PIT_CHANNEL0
  12. sti
  13. jmp .
  14. handler:
  15. cli
  16. PUTC $'a
  17. PIC_EOI
  18. sti
  19. iret