File:tty.c - ikarishinjieva/unixV6-code-analyze-chs GitHub Wiki

Source

8100 # /* general TTY subroutines */

8101

8102 #include "../param.h"

8103 #include "../systm.h"

8104 #include "../user.h"

8105 #include "../tty.h"

8106 #include "../proc.h"

8107 #include "../inode.h"

8108 #include "../file.h"

8109 #include "../reg.h"

8110 #include "../conf.h"

8111

8112 /* Input mapping table-- if an entry is non-zero, when the

8113  * corresponding character is typed preceded by "\" the

8114  * escape sequence is replaced by the table value.

8115  * Mostly used for upper-case only terminals.

8116  */

8117 char maptab[]

8118 {

8119     000,000,000,000,004,000,000,000,

8120     000,000,000,000,000,000,000,000,

8121     000,000,000,000,000,000,000,000,

8122     000,000,000,000,000,000,000,000,

8123     000,’|’,000,’#’,000,000,000,β€™β€˜β€™,

8124     β€™{’,’}’,000,000,000,000,000,000,

8125     000,000,000,000,000,000,000,000,

8126     000,000,000,000,000,000,000,000,

8127     β€™@’,000,000,000,000,000,000,000,

8128     000,000,000,000,000,000,000,000,

8129     000,000,000,000,000,000,000,000,

8130     000,000,000,000,000,000,’~’,000,

8131     000,’A’,’B’,’C’,’D’,’E’,’F’,’G’,

8132     β€™H’,’I’,’J’,’K’,’L’,’M’,’N’,’O’,

8133     β€™P’,’Q’,’R’,’S’,’T’,’U’,’V’,’W’,

8134     β€™X’,’Y’,’Z’,000,000,000,000,000,

8135 };

8136 /* ------------------------- */

8137 /* The actual structure of a clist block manipulated by

8138  * getc and putc (mch.s)

8139  */

8140 struct cblock {

8141     struct cblock *c_next;

8142     char info[6];

8143 };

  • ε­—η¬¦ηΌ“ε­˜εŸΊζœ¬ε— η»“ζž„
8144 /* ------------------------- */

8145 /* The character lists-- space for 6*NCLIST characters */

8146     struct cblock cfree[NCLIST];

  • ε­—η¬¦ηΌ“ε­˜
8147

8148 /* List head for unused character blocks. */

8149     struct cblock *cfreelist;

8150 /* structure of device registers for KL, DL, and DC

8151  * interfaces-- more particularly, those for which the

8152  * SSTART bit is off and can be treated by general routines

8153  * (that is, not DH).

8154  */

8155 struct {

8156     int ttrcsr;

8157     int ttrbuf;

8158     int tttcsr;

8159     int tttbuf;

8160 };

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