code:struct tty - ikarishinjieva/unixV6-code-analyze-chs GitHub Wiki
7915
7916 /*
7917 * A tty structure is needed for
7918 * each UNIX character device that
7919 * is used for normal terminal IO.
7920 * The routines in tty.c handle the
7921 * common code associated with
7922 * these structures.
7923 * The definition and device dependent
7924 * code is in each driver (kl.c dc.c dh.c)
7925 */
7926 struct tty
7927 {
7928 struct clist t_rawq; /* input chars right off device */
7929 struct clist t_canq; /* input chars after erase and kill */
- 原始输入队列
7930 struct clist t_outq; /* output list to device */
- 非原始输入队列
7931 int t_flags; /* mode, settable by stty call */
- 输出队列
7932 int *t_addr; /* device address (register or
- 模式位,模式常量定义参看 tty.h
7933 startup fcn) */
7934 char t_delct; /* number of delimiters in raw q */
- 指向 设备寄存器
- 或 特殊启动函数(置SSTART标志)
7935 char t_col; /* printing column of device */
- 原始队列中 的 定界符数
7936 char t_erase; /* erase character */
- 当前 列位置
7937 char t_kill; /* kill character */
- "擦除"字符
7938 char t_state; /* internal state, not visible
- "删除行"字符
7939 externally */
7940 char t_char; /* character temporary */
7941 int t_speeds; /* output+input line speed */
7942 int t_dev; /* device name */
7943 };
7944 /* ------------------------- */