File:tty.c - ikarishinjieva/unixV6-code-analyze-chs GitHub Wiki
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 };