test_pit_sleep_protected.S 497 B

123456789101112131415161718192021222324252627
  1. /* https://github.com/cirosantilli/x86-bare-metal-examples#pit_sleep_ticks */
  2. #include "common.h"
  3. BEGIN
  4. STAGE2
  5. CLEAR
  6. PROTECTED_MODE
  7. IDT_SETUP_48_ISRS
  8. REMAP_PIC_32
  9. PIT_GENERATE_FREQUENCY
  10. PIT_SET_FREQ 1000
  11. sti
  12. loop:
  13. VGA_PRINT_STRING $message
  14. PIT_SLEEP_TICKS $500
  15. jmp loop
  16. IDT_48_ENTRIES
  17. PIT_SLEEP_TICKS_GLOBALS
  18. interrupt_handler:
  19. cmp PIT_ISR_NUMBER, 4(%esp)
  20. jne not_pit
  21. PIT_SLEEP_TICKS_HANDLER_UPDATE
  22. not_pit:
  23. ret
  24. message:
  25. .asciz "a"