diff options
author | nthnluu <nate1299@me.com> | 2024-01-28 21:20:27 -0500 |
---|---|---|
committer | nthnluu <nate1299@me.com> | 2024-01-28 21:20:27 -0500 |
commit | c63f340d90800895f007de64b7d2d14624263331 (patch) | |
tree | 2c0849fa597dd6da831c8707b6f2603403778d7b /kernel/include/drivers/tty/tty.h |
Created student weenix repository
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); + |