tty.h 454 B

1234567891011121314151617181920212223242526
  1. #pragma once
  2. #include <asm/port_io.h>
  3. #define STRUCT_TTY_NAME_LEN (32)
  4. struct tty;
  5. struct tty_operations
  6. {
  7. void (*put_char)(struct tty* p_tty, char c);
  8. };
  9. struct tty
  10. {
  11. char name[STRUCT_TTY_NAME_LEN];
  12. struct tty_operations* ops;
  13. char data[12];
  14. };
  15. // in kernel_main.c
  16. extern struct tty* console;
  17. void tty_print(struct tty* p_tty, const char* str);
  18. int make_serial_tty(struct tty* p_tty, int id);
  19. int make_vga_tty(struct tty* p_tty);