test_pit_sleep_protected.S 522 B

12345678910111213141516171819202122232425262728293031
  1. /*
  2. Test PIT_SLEEP_TICKS in protected mode.
  3. Expected output: `a\n` gets printed with frequency 2Hz.
  4. */
  5. #include "common.h"
  6. BEGIN
  7. STAGE2
  8. CLEAR
  9. PROTECTED_MODE
  10. IDT_SETUP_48_ISRS
  11. REMAP_PIC_32
  12. PIT_GENERATE_FREQUENCY
  13. PIT_SET_FREQ 1000
  14. sti
  15. loop:
  16. VGA_PRINT_STRING $message
  17. PIT_SLEEP_TICKS $500
  18. jmp loop
  19. IDT_48_ENTRIES
  20. PIT_SLEEP_TICKS_GLOBALS
  21. interrupt_handler:
  22. cmp PIT_ISR_NUMBER, 4(%esp)
  23. jne not_pit
  24. PIT_SLEEP_TICKS_HANDLER_UPDATE
  25. not_pit:
  26. ret
  27. message:
  28. .asciz "a"