www.pudn.com > Mos.rar > PCB.h


// PCB.h: interface for the PCB class. 
// 
////////////////////////////////////////////////////////////////////// 
 
#if !defined(AFX_PCB_H__28D33ED1_7D0C_492D_915B_4230FB64975A__INCLUDED_) 
#define AFX_PCB_H__28D33ED1_7D0C_492D_915B_4230FB64975A__INCLUDED_ 
 
#if _MSC_VER > 1000 
#pragma once 
#endif // _MSC_VER > 1000 
const int PCBMAX = 8; 
#include "JCB.h" 
struct pcbtype; 
struct iorbtype 
{ 
	pcbtype *pcb; 
	iorbtype *link; 
}; 
struct pcbtype 
{ 
	int  pid;//proc ID 
	int  mode;//user|kernel 
	int  flag;//ready|run|sleep 
	int  step;//for system proc 
	char regpc[2];//PC 
	char regc;//C 
	char regr[4];//R 
	char regptr[4];//PTR 
	int  cputime;//record proc time 
	int  io;//io times 
	int  errn;//record error 
	iorbtype* iorbp;//link to iorb 
	int  outp;//track No. for output 
	int  olimit;//max out 
	int  resultline; 
	int  inp;//track No.for input 
	int  ilimit;//max in 
	jcbtype *jcb; 
	pcbtype *next; 
}; 
class PCB   
{ 
public: 
	PCB(); 
	virtual ~PCB(); 
public: 
	pcbtype  PcbTab[PCBMAX]; 
	pcbtype* curr_pcb;//当前进程 
	pcbtype* readypcbhead;//就绪队列 
	pcbtype* readypcbtail; 
	pcbtype* waitpcb_head;//等PCB    P2 
	pcbtype* waitmem_head;//等memory P1 
	pcbtype* waitout_head;//等输出   P3 
	pcbtype* waitjcb_head;//等JCB表  P2 
	pcbtype* jcbnull_head;//等作业   P2 
	pcbtype* kbend_head;//等提交作业 P1 
	pcbtype* restkb_head; 
	pcbtype* restdsk_head; 
	pcbtype* restprt_head; 
	pcbtype* restkb_tail; 
	pcbtype* restdsk_tail; 
	pcbtype* restprt_tail; 
	pcbtype* dsk_head; 
	pcbtype* dsk_tail; 
	pcbtype* pcb_free_head; 
	pcbtype* pcb_free_tail; 
	int      free_pcb_count; 
}; 
#endif // !defined(AFX_PCB_H__28D33ED1_7D0C_492D_915B_4230FB64975A__INCLUDED_)