【文件属性】:
文件名称:与进程有关的数据结构-UNIX(V6)内核阅读
文件大小:325KB
文件格式:PPT
更新时间:2021-04-22 18:41:26
UNIX(V6)内核阅读
与进程有关的数据结构
Proc结构
Proc结构包含15个成员,它们大致可分成四类:
1,标识数:p_uid, p_pid, p_ppid;
2,非常驻内存进程映象的位置信息:
p_addr, P-size, p_textp;
3,进程状态及标志信息:
#define SSLEEP 1 /*高优先权睡眠*/
#define SWAIT 2 /*低优先权睡眠*/
#define SRUN 3 /*运行*/
#define SIDL 4 /*进程创建时的中间状态*/
#define SZOMB 5 /*进程终止时的中间状态*/
#define SSTOP 6 /*进程正被跟踪*/
#define SLOAD 01 /*进程映象在内存*/
#define SSYS 02 /*系统进程,常驻内存*/
#define SLOCK 04 /*进程因某种原因不能调出内存*/
#define SSWAP 010 /*进程正在交换*/
#define STRC 020 /*父子进程跟踪*/
#define STWED 040 /*另一个跟踪标志*/
4,与进程优先数有关参数:p_pri, p_cpu, p_nice;
5,其它:p_time, p_sig, p_ttyp, p_wchan;
Struct proc
{
char p_stat;
char p_flag;
char p_pri;
char p_sig;
char p_uid;
char p_time;
char p_cpu;
char p_nice;
int p_ttyp;
int p_pid;
int p_ppid;
int p_addr;
int p_size;
int p_wchan;
int *p_textp;
}proc[PROC];