tty.h 523 B

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