code:struct tty - ikarishinjieva/unixV6-code-analyze-chs GitHub Wiki

Source

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 */
  • 模式位,模式常量定义参看 tty.h
7932     int *t_addr; /* device address (register or

7933                          startup fcn) */

  • 指向 设备寄存器
  • 或 特殊启动函数(置SSTART标志)
7934     char t_delct; /* number of delimiters in raw q */
  • 原始队列中 的 定界符数
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 /* ------------------------- */

Caller

⚠️ **GitHub.com Fallback** ⚠️