资源描述:
《带优先权的时间片轮转》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、#include#include#include#defineGET_INDOS0x34#defineGET_CRT_ERR0x5d06charfar*indos_ptr=0;charfar*crit_err_ptr=0;inttimecount=0;intcur;#defineFINISHED0#defineRUNNING1#defineREADY2#defineBLOCKED3#defineNTCB3voidinterrupt(*old_int8)();typedefint(far*codep
2、tr)(void);intcreate(char*name,codeptrcod,intstck,unsignedpri);voiddestroy(intid);voidover(void);voidinterruptswtch(void);voidInitDos(void);intDosBusy(void);voidinterruptmy_swtch(void);voidinterruptnew_int8(void);intfinished();intGetNextPsc();structTCB{unsignedchar*stack;unsign
3、edss;unsignedsp;charstate;charname[10];unsignedpri;}tcb[NTCB];typedefstruct{unsignedbp,di,si,ds,es,dx,cx,bx,ax,ip,cs,flags,off,seg;}int_regs;voidInitTCB(){inti;for(i=0;i