diff options
Diffstat (limited to 'kernel/include/drivers/tty/tty.h')
-rw-r--r-- | kernel/include/drivers/tty/tty.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/kernel/include/drivers/tty/tty.h b/kernel/include/drivers/tty/tty.h new file mode 100644 index 0000000..ec22b68 --- /dev/null +++ b/kernel/include/drivers/tty/tty.h @@ -0,0 +1,21 @@ +#pragma once + +#include "drivers/chardev.h" +#include "ldisc.h" +#include "vterminal.h" + +#define TTY_MAJOR 2 +#define cd_to_tty(bd) \ + CONTAINER_OF((bd), tty_t, tty_cdev) // Should this be cd, for chardev? + +typedef struct tty +{ + vterminal_t tty_vterminal; // the virtual terminal, where the characters will be displayed + ldisc_t tty_ldisc; // the line discipline for the tty + chardev_t tty_cdev; // the super struct for the tty + kmutex_t tty_read_mutex; + kmutex_t tty_write_mutex; +} tty_t; + +void tty_init(void); + |