port_io.h 669 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include <types/types.h>
  3. #define PORT_PIC1 (0x20)
  4. #define PORT_PIC2 (0xa0)
  5. #define PORT_PIC1_COMMAND (PORT_PIC1)
  6. #define PORT_PIC1_DATA ((PORT_PIC1) + 1)
  7. #define PORT_PIC2_COMMAND (PORT_PIC2)
  8. #define PORT_PIC2_DATA ((PORT_PIC2) + 1)
  9. #define PORT_KEYBOARD_COMMAND (0x64)
  10. #define PORT_KEYBOARD_DATA (0x60)
  11. #define PORT_PIT_CONTROL (0x43)
  12. #define PORT_PIT_COUNT (0x40)
  13. #define PORT_KEYDATA 0x0060u
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. extern void asm_outb(uint16_t port_number, uint8_t data);
  18. extern uint8_t asm_inb(uint16_t port_number);
  19. extern void asm_hlt(void);
  20. extern void asm_cli(void);
  21. extern void asm_sti(void);
  22. #ifdef __cplusplus
  23. }
  24. #endif