io.h 864 B

123456789101112131415161718192021222324252627
  1. /* I/O library: VGA text output and PS/2 keyboard. Usable by terminal and other programs. */
  2. #ifndef IO_H
  3. #define IO_H
  4. /* Content area: rows 0..(IO_DEBUG_ROW-1). Debug row and busy position. */
  5. #define IO_VGA_COLS 80
  6. #define IO_VGA_ROWS 25
  7. #define IO_DEBUG_ROW 24
  8. #define IO_CONTENT_ROWS IO_DEBUG_ROW
  9. #define IO_CONTENT_SIZE (IO_CONTENT_ROWS * IO_VGA_COLS)
  10. #define IO_BUSY_POS (IO_DEBUG_ROW * IO_VGA_COLS + 79)
  11. void io_init(void);
  12. void io_clear_screen(void);
  13. void io_putchar(char c);
  14. void io_putstr(const char *s);
  15. unsigned int io_get_cursor(void);
  16. void io_cursor_show_block(void);
  17. void io_cursor_hide_block(void);
  18. void io_vga_write(unsigned int pos, unsigned short value);
  19. void io_drain_keyboard(void);
  20. /* Poll keyboard; returns 0 or ASCII character. Shift applied. */
  21. char io_poll_key(void);
  22. unsigned char io_last_scancode(void);
  23. #endif