File:systm.h - ikarishinjieva/unixV6-code-analyze-chs GitHub Wiki
|
0200 /* various global variables */
0201
0202 char canonb[CANBSIZ]; /* buffer for erase and kill */
0203 int coremap[CMAPSIZ]; /* space for core allocation */
0204 int swapmap[SMAPSIZ]; /* space for swap allocation */
- 内存 空闲空间管理结构,参看空闲块管理
0205
- 盘交换区 空闲空间管理结构,参看空闲块管理
0206 int *rootdir; /* pointer to inode of root directory */
0207
- 指向 根目录 的inode块
0208 int cputype; /* type of cpu =40, 45, or 70 */
0209
0210 int execnt; /* number of processes in exec */
0211
- 执行exec的进程数
0212 int lbolt; /* time of day in 60th not in time */
0213 int time[2]; /* time in sec from 1970 */
- 在 clock 中使用,作为已经过的时钟滴答数
0214 int tout[2]; /* time of day of next sleep */
- 系统时间,从1970年起始的秒数
详见睡眠原因0215
0216 int mpid; /* generic for unique process id’s */
0217
0218 char runin; /* scheduling flag */
0219 char runout; /* scheduling flag */
- 用于表示盘交换区上有进程想调入内存但无法调入的标志
0220 char runrun; /* scheduling flag */
- 用于表示盘交换区上没有可以调入内存的就绪进程的标志
0221
0222 char curpri; /* more scheduling */
0223
- 当前进程 的优先级
0224 int maxmem; /* actual max memory per process */
0225
- 每进程 能 使用的最大内存块数
0226 int *lks; /* pointer to clock device */
0227
- 指向 时钟发生器 状态/控制 寄存器
- 参看 时钟
0228 int rootdev; /* dev of root see conf.c */
0229 int swapdev; /* dev of swap see conf.c */
- 根设备
0230
- 盘交换区 设备
0231 int swplo; /* block number of swap space */
0232 int nswap; /* size of swap space */
0233
0234 int updlock; /* lock for sync */
0235 int rablock; /* block to be read ahead */
- 函数update的锁标识
- 要预读的磁盘块
0236
0237 char regloc[]; /* locs. of saved user registers
0238 (see trap.c) */
0239
0240
0241 /* ------------------------- */
0242
0243
0244
0245
0246
0247
0248
0249
0250
0251 /* -------------------------*/
0252
0253 /* The callout structure is for a routine
0254 * arranging to be called by the the clock interrupt
0255 * (see clock.c), with a specified argument,
0256 * within a specified amount of time.
0257 * It is used, for example, to time tab delays
0258 * on teletypes. */
0259
0260 struct callo
0261 {
0262 int c_time; /* incremental time */
0263 int c_arg; /* argument to routine */
- 相邻事件 间隔的时钟滴答数
0264 int (*c_func)(); /* routine */
- 事件函数的参数
0265 } callout[NCALL];
- 事件函数
0266 /* -------------------------*/
- 事件执行链表(由clock调用,按时间执行事件)