io.h 811 B

1234567891011121314151617181920212223242526
  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). Row IO_DEBUG_ROW is below content. */
  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. void io_init(void);
  11. void io_clear_screen(void);
  12. void io_putchar(char c);
  13. void io_putstr(const char *s);
  14. unsigned int io_get_cursor(void);
  15. void io_cursor_show_block(void);
  16. void io_cursor_hide_block(void);
  17. void io_vga_write(unsigned int pos, unsigned short value);
  18. void io_drain_keyboard(void);
  19. /* Poll keyboard; returns 0 or ASCII character. Shift applied. */
  20. char io_poll_key(void);
  21. unsigned char io_last_scancode(void);
  22. #endif