中南大學 操作系統(tǒng)實驗報告課程設計報告

上傳人:仙*** 文檔編號:30235322 上傳時間:2021-10-09 格式:DOC 頁數(shù):48 大小:522.50KB
收藏 版權申訴 舉報 下載
中南大學 操作系統(tǒng)實驗報告課程設計報告_第1頁
第1頁 / 共48頁
中南大學 操作系統(tǒng)實驗報告課程設計報告_第2頁
第2頁 / 共48頁
中南大學 操作系統(tǒng)實驗報告課程設計報告_第3頁
第3頁 / 共48頁

下載文檔到電腦,查找使用更方便

15 積分

下載資源

還剩頁未讀,繼續(xù)閱讀

資源描述:

《中南大學 操作系統(tǒng)實驗報告課程設計報告》由會員分享,可在線閱讀,更多相關《中南大學 操作系統(tǒng)實驗報告課程設計報告(48頁珍藏版)》請在裝配圖網(wǎng)上搜索。

1、操作系統(tǒng)實驗報告界面設計l 菜單菜單包括菜單欄,菜單,菜單項,一個菜單欄可以包括N個菜單,一個菜單可以包括菜單項。C語言設計菜單的思想是用雙向鏈表,先保存繪圖區(qū)的內容,再在上面畫菜單。l 菜單結構圖菜單欄菜單1菜單2菜單n.尾指針頭指針當前指向菜單菜單項1菜單項2。菜單項n頭指針其他菜單項結構類似結尾指針l 數(shù)據(jù)結構1. 菜單欄:typedef struct menubar_sint number,x,y,barheight,baritemwidth;/*number用來記錄菜單項的數(shù)目,x,y用來記錄菜單欄在屏幕上的位置,barheight用來控制菜單欄的高度,baritemwidth用來控

2、制每項菜單的寬度*/struct menu_s *mhead; /*指向第一個菜單*/struct menu_s *mtail; /*指向最后一個菜單*/struct menu_s *mpoint; /*當用戶按下左右箭頭時用來記錄指向那個菜單,初始指向mhead*/void (* docommand)(); /*菜單時間的處理函數(shù)*/MenuBar;2. 菜單:typedef struct menu_sint number; /*菜單是菜單欄中的第幾項*/int subwidth; /*菜單項的寬度*/int subcount; /*菜單項的數(shù)目*/char *content; /*菜單顯示

3、的字符串/struct menu_s *next; /*指向下一個菜單,如果是結尾菜單,則為NULL*/struct menu_s *before; /*指向前一個菜單,如果是頭菜單,則為NULL*/struct submenu_s *sub; /*指向當前激活的菜單項*/struct submenu_s *head; /*指向第一個菜單項*/struct submenu_s *tail; /*指向最后一個菜單項*/Menu;3. 菜單項:typedef struct submenu_sint number; /*菜單項是菜單中的第幾項*/int isactive; /*是否激活*/char

4、*content; /*顯示的字符串*/struct submenu_s *next; /*指向下一個菜單項*/struct submenu_s *before; /*指向前一個菜單項*/submenu;l 函數(shù)實現(xiàn)1. 菜單構造函數(shù)/*該函數(shù)的功能主要是根據(jù)指定的menutitle字符串,往菜單欄中添加一項菜單*/void addmenu(char *menutitle)if(Mb=NULL)/*如果Mb(全局MenuBar類型的變量)為NULL,說明沒有初始化菜單欄,要初始化*/if(Mb=(MenuBar *)malloc(sizeof(MenuBar)=NULL)doerror(Sys

5、tem error);Mb-number=0; /*菜單欄中菜單數(shù)目為0*/Mb-mpoint=Mb-mhead=Mb-mtail=NULL;Mb-x=0;Mb-y=0; /*位置于屏幕上(0,0)*/Mb-barheight=18; /*菜單欄高度為18*/Mb-baritemwidth=100; /*每項菜單的寬度為100*/Mb-docommand=docommand; /*設置事件處理函數(shù)為docommand()*/if(Mb-mtail=NULL) /*如果Mb-mtail為NULL,說明要先構造Mb-mhead*/if(Mb-mhead=(Menu *)malloc(sizeof(

6、Menu)=NULL)doerror(System error);Mb-mhead-before=NULL;Mb-mtail=Mb-mhead;else if(Mb-mtail-next=(Menu *)malloc(sizeof(Menu)=NULL)doerror(System error);Mb-mtail-next-before=Mb-mtail;Mb-mtail=Mb-mtail-next;Mb-mtail-number=Mb-number; /*當前添加進去的菜單位置,下面有Mb-number的自加*/Mb-mtail-subwidth=0; /*菜單項的寬度為0*/Mb-mtai

7、l-subcount=0; /*菜單項數(shù)目為0/Mb-mtail-content=menutitle; /*把菜單的字符串指針指向menutitle*/Mb-mtail-next=NULL;Mb-mtail-sub=Mb-mtail-head=Mb-mtail-tail=NULL; /*把菜單項全部置NULL*/Mb-number+;/*菜單欄中number加1,表示加進去了一個菜單*/ 2. 菜單項構造函數(shù)/*該函數(shù)的功能是根據(jù)menu指定的字符串,往該菜單中添加以itemtitle為字符串的菜單項比如additem(“File”,”O(jiān)pen”)則執(zhí)行向File菜單中添加一項itemtitl

8、e菜單項*/void additem(char *menu,char *itemtitle) Mb-mpoint=Mb-mhead; /*先把指針指向菜單頭,這里借用Mb中的mpoint為了不用額外的變量*/ while(Mb-mpoint!=NULL) if(stricmp(Mb-mpoint-content,menu)=0) /*遍歷menu鏈表,如果找到一項和menu指定字符串相等的,則記錄下來,跳出,*/ break; Mb-mpoint=Mb-mpoint-next; if(Mb-mpoint-tail=NULL) /*如果tail為空,則說明沒有構造頭節(jié)點head*/ if(Mb-

9、mpoint-head=(submenu *)malloc(sizeof(submenu)=NULL) doerror(System error); Mb-mpoint-head-before=NULL; Mb-mpoint-sub=Mb-mpoint-tail=Mb-mpoint-head; else if(Mb-mpoint-tail-next=(submenu *)malloc(sizeof(submenu)=NULL) doerror(System error); Mb-mpoint-tail-next-before=Mb-mpoint-tail; Mb-mpoint-tail=Mb-

10、mpoint-tail-next; if(strlen(itemtitle)Mb-mpoint-subwidth) Mb-mpoint-subwidth=strlen(itemtitle); /*該語句主要計算一下剛加進來的菜單項的字符數(shù),如果比菜單的寬度還要大,則把該寬度賦值給subwidth,主要是為了畫菜單是寬度足夠*/ Mb-mpoint-subcount+;/*菜單項數(shù)目加一*/ Mb-mpoint-tail-number=Mb-mpoint-subcount; Mb-mpoint-tail-isactive=0; Mb-mpoint-tail-content=itemtitle;

11、Mb-mpoint-tail-next=NULL; 3. 繪畫菜單欄void drawmenu() Mb-mpoint=Mb-mhead; rectangle(0,0,getmaxx()-1,Mb-y+Mb-barheight);/*畫一個方框*/ while(Mb-mpoint!=NULL)outtextxy(Mb-mpoint-number*Mb-baritemwidth+Mb-x+5,Mb-y+6,Mb-mpoint-content); /*在菜單欄中逐項畫出菜單的內容*/Mb-mpoint=Mb-mpoint-next;4. 繪畫當前激活的菜單void drawsubmenu()sub

12、menu *temp;int x; /*x記錄當前畫菜單的x位置*/x=Mb-mpoint-number*Mb-baritemwidth+Mb-x;temp=Mb-mpoint-head;copyimage(x,Mb-barheight+2,x+Mb-mpoint-subwidth*8+5,(Mb-mpoint-subcount+1)*Mb-barheight+3); /*保存繪畫區(qū)的內容,copyimage為自寫的函數(shù)*/setfillstyle(1,getbkcolor();bar(x,Mb-barheight+2,x+Mb-mpoint-subwidth*8+5,(Mb-mpoint-s

13、ubcount+1)*Mb-barheight+3); /*用背景色把繪畫區(qū)覆蓋一下*/rectangle(x,Mb-barheight+2,x+Mb-mpoint-subwidth*8+5,(Mb-mpoint-subcount+1)*Mb-barheight+3); /*畫一個方框*/while(temp!=NULL)if(temp-isactive) /*如果是當前激活的菜單,則畫一個紅色方框背景*/setfillstyle(1,RED);bar(x+2,temp-number*Mb-barheight+4,x+Mb-mpoint-subwidth*8+3,(temp-number+1)

14、*Mb-barheight-1);outtextxy(x+5,temp-number*Mb-barheight+5,temp-content);temp=temp-next;4. 進入菜單/*根據(jù)menu指定的字符串,說明用戶從哪項菜單進入菜單,如gotomenucur(”File”)說明用戶激活了“File”菜單*/void gotomenucur(char *menu)Mb-mpoint=Mb-mhead;while(Mb-mpoint-next!=NULL)if(stricmp(Mb-mpoint-content,menu)=0)break;Mb-mpoint=Mb-mpoint-nex

15、t;Mb-mpoint-sub=Mb-mpoint-head;Mb-mpoint-sub-isactive=1;drawsubmenu();5. 菜單按鍵處理void menukey()int key;while(1)key=get_key();switch(key)case KEY_LEFT: /*說明用戶按下了向左按鍵,Mb-mpoint應該向前移一項*/Mb-mpoint-sub-isactive=0;backimage(Mb-mpoint-number*Mb-baritemwidth+Mb-x,Mb-barheight+2);if(Mb-mpoint-before!=NULL) /*如

16、果當前已經(jīng)是mhead了,應該指向mtail*/Mb-mpoint=Mb-mpoint-before;elseMb-mpoint=Mb-mtail;Mb-mpoint-sub=Mb-mpoint-head;Mb-mpoint-sub-isactive=1;drawsubmenu();/*重畫菜單,跳出*/break;case KEY_RIGHT: /*說明用戶按下了向右鍵,解釋同KEY_LEFT*/Mb-mpoint-sub-isactive=0;backimage(Mb-mpoint-number*Mb-baritemwidth+Mb-x,Mb-barheight+2);if(Mb-mpoi

17、nt-next!=NULL)Mb-mpoint=Mb-mpoint-next;elseMb-mpoint=Mb-mhead;Mb-mpoint-sub=Mb-mpoint-head;Mb-mpoint-sub-isactive=1;drawsubmenu();break;case KEY_UP: /*說明用戶按下了向上鍵,應把當前激活的菜單項向上移一項*/Mb-mpoint-sub-isactive=0;backimage(Mb-mpoint-number*Mb-baritemwidth+Mb-x,Mb-barheight+2);if(Mb-mpoint-sub-before!=NULL)Mb

18、-mpoint-sub=Mb-mpoint-sub-before;elseMb-mpoint-sub=Mb-mpoint-tail;Mb-mpoint-sub-isactive=1;drawsubmenu();break;case KEY_DOWN: /*說明用戶按下了向下鍵,當前菜單項應向下移一項*/Mb-mpoint-sub-isactive=0;backimage(Mb-mpoint-number*Mb-baritemwidth+Mb-x,Mb-barheight+2);if(Mb-mpoint-sub-next!=NULL)Mb-mpoint-sub=Mb-mpoint-sub-nex

19、t;elseMb-mpoint-sub=Mb-mpoint-head;Mb-mpoint-sub-isactive=1;drawsubmenu();break;case ENTER: /*說明用戶按下了回車鍵,調用Mb-docommand()*/Mb-mpoint-sub-isactive=0;backimage(Mb-mpoint-number*Mb-baritemwidth+Mb-x,Mb-barheight+2);Mb-docommand();return;case ESC: /*說明用戶按下了退出鍵,把拷貝的屏幕區(qū)域放回,不作任何處理*/Mb-mpoint-sub-isactive=0

20、;backimage(Mb-mpoint-number*Mb-baritemwidth+Mb-x,Mb-barheight+2);return;游標與滾屏l 思想在屏幕上顯示的是兩個隊列,一個是等待隊列,一個是就緒隊列。設置了一個游標,可以用上下鍵移動指向每個進程,然后對指向進程進行各種操作,包括掛起,解掛,刪除。我設置的屏幕上最多只能顯示12個進程,就緒最多6個,等待最多6個,那么當進程多于此數(shù)時,在用戶按上下鍵時,應該有滾屏功能。滾屏的思想如下:假設有就緒隊列里有N1個進程,每個進程編號1,2,3.N1-1,N1。等待隊列中有N2個進程,每個進程編號1,2,3N2-1,N2。假設當前游標指

21、向的進程編號小于6,則繪畫1到6個進程(如果進程數(shù)小于6則畫出所有進程),如果當前游標指向的進程編號為N(N6),則繪畫N6到N個,這樣就實現(xiàn)了滾屏。當當前游標位置位于就緒隊列結尾,則當用戶按下向下按鍵時,應該將游標移動到等待隊列的第一個;當當前游標位置位于就緒隊列第一個,則當用戶按下向上按鍵時,應該移動到等待隊列最后一個;同理,當當前游標位于等待隊列隊尾對首時,應移動就緒隊列隊首隊尾。l 函數(shù)實現(xiàn)因為我把等待隊列和就緒隊列放在同一個鏈表里,所以要實現(xiàn)上面的功能可能有點problem,但多用幾個函數(shù)就能實現(xiàn)。1. /*這個函數(shù)用來給每個進程編號*/void updateprocess()int

22、 i=1,j=1;process *temp;temp=phead;while(temp)if(temp-isrun) /*給就緒隊列中的進程編號*/temp-pos=i+;else /*給等待隊列中的進程編號*/temp-pos=j+;temp=temp-next;2. /*這個函數(shù)用來得到列表中就緒隊列中的第一個*/process *getfirstrun() process *temp; if(!phead) return NULL; temp=phead; while(temp!=NULL) if(temp-isrun) /*找到第一個,就跳出循環(huán)*/ break; temp=temp

23、-next; return temp-isrun?temp:NULL; /*如果找到就返回,否則就返回NULL,因為可能存在唯一一個等待隊列中的*/ 3. /*該函數(shù)用來獲取列表中就緒隊列中的最后一個*/ process *gettailrun() process *temp; if(!ptail) /*如果列表為空,則返回NULL*/ return NULL; temp=ptail; /*從列表尾部開始找*/ while(temp!=NULL) if(temp-isrun) /*如果找到,就跳出循環(huán)*/ break; temp=temp-before; return temp-isrun?t

24、emp:NULL; /*判斷找到的是不是就緒隊列中的如果不是就返回NULL,因為可能存在只有一個等待隊列中的*/ 4. /*這個函數(shù)用來找相對于p的下一個就緒隊列中的進程*/ process *getnextrun(process *p) process *temp; if(!p) return NULL; temp=p-next; while(temp!=NULL) if(temp-isrun) /*如果找到,就跳出循環(huán)*/ break; temp=temp-next; return temp; 5. /*這個函數(shù)用來找相對于p的前一個就緒隊列中的進程*/ process *getbefor

25、erun(process *p) process *temp; if(!p) return NULL; temp=p-before; while(temp!=NULL) if(temp-isrun) break; temp=temp-before; return temp; 6. /*這個函數(shù)用來找等待隊列中的第一個,一下三個函數(shù)原理跟就緒隊列中的操作函數(shù)一樣,只是把查找的條件改成!temp-isrun*/ process *getfirstready() process *temp; if(!phead) return NULL; temp=phead; while(temp!=NULL)

26、if(!temp-isrun) break; temp=temp-next; return temp-isrun?NULL:temp; 7. process *gettailready() process *temp; if(!ptail) return NULL; temp=ptail; while(temp!=NULL) if(!temp-isrun) break; temp=temp-before; return temp-isrun?NULL:temp; 8. process *getnextready(process *p) process *temp; if(!p) return

27、NULL; temp=p-next; while(temp!=NULL) if(!temp-isrun) break; temp=temp-next; return temp; 9. process *getbeforeready(process *p) process *temp; if(!p) return NULL; temp=p-before; while(temp!=NULL) if(!temp-isrun) break; temp=temp-before; return temp; 10. /*這個函數(shù)用來得到下一個游標的位置*/void getnext() process *te

28、mp; if(phead=ptail)/*如果鏈表中只有一個進程,則什么也不處理,返回*/ ppoint=phead; return; if(ppoint=gettailrun()/*如果當前游標位置是就緒隊列中的最后一個*/ temp=getfirstready();/*則指向第一個等待隊列*/ ppoint=temp?temp:getfirstrun(); else if(ppoint=gettailready()/*如果當前游標位置是等待隊列中的最后一個*/ temp=getfirstrun();/*則指向就緒隊列中的第一個*/ ppoint=temp?temp:getfirstread

29、y(); else if(ppoint-isrun) /*如果當前隊列在就緒隊列中移動*/ ppoint=getnextrun(ppoint); /*移向就緒隊列中的下一個*/ else ppoint=getnextready(ppoint); /*移向等待隊列中的下一個*/ 11. /*這個函數(shù)用來得到上一個游標的位置,基本的解釋同getnext()差不多*/ void getbefore() process *temp;if(phead=ptail) ppoint=phead;return; if(ppoint=getfirstrun() temp=gettailready(); ppoi

30、nt=temp?temp:gettailrun(); else if(ppoint=getfirstready() temp=gettailrun(); ppoint=temp?temp:gettailready(); else if(ppoint-isrun) ppoint=getbeforerun(ppoint); else ppoint=getbeforeready(ppoint); 12. /*按鍵處理函數(shù)*/void key_U_D(int key)switch(key)case KEY_DOWN:if(!phead) ppoint=NULL;else getnext();break

31、;/*如果按下的是向下鍵*/case KEY_UP:if(!ptail) ppoint=NULL;else getbefore();break; /*如果按下的是向上鍵*/if(ppoint) /*drawl_r(int,int)這個函數(shù)根據(jù)傳遞進來的兩個參數(shù)指明應該畫的起始編號*/if(ppoint-pos6)if(ppoint-isrun)drawl_r(ppoint-pos-6,0);else drawl_r(0,ppoint-pos-6);else drawl_r(0,0);else drawl_r(0,0);獲取用戶按鍵C語言庫函數(shù)提供的getch(),或bioskey()在處理字符

32、和菜單輸入時有點麻煩,改寫了一個函數(shù)int get_key() union REGS rg; rg.h.ah=0; int86(0x16,&rg,&rg); if(rg.h.al=0)/*說明按下了修飾鍵,把這個值左移8位*/return rg.h.ah=48&key=57|key=8) /*如果按下的是數(shù)字鍵或者是退格鍵*/if(key=8) /*如果是退格鍵,就用背景色把原來的字符畫一遍,相當于覆蓋,然后去掉結尾一個,用前景色畫字符,就相當于刪掉一個字符(實際上也刪掉了)*/color=getcolor();setcolor(getbkcolor();outtextxy(x+10,y+20

33、,strcat(desc,number);setcolor(color);number-i=0; /*這句相當于刪掉一個字符*/else if(ipos6) /*因為每個隊列最多只能顯示6個隊列,所以當當前光標指向的進程的pos6時,pos一定是底部pos=6;else pos=ppoint-pos;bar(1-ppoint-isrun)*450,(pos-1)*50+80,(1-ppoint-isrun)*450+15,(pos-1)*50+85);/*畫一個游標if(stop) /*stop是全局變量(為這是一個模擬程序,所以當用戶想暫?;蛘呤裁吹模梢詴和#┕鹲top是true,則什么事

34、都不做return;i=getnum(1); /*獲取就緒隊列中的進程總數(shù)*/j=getnum(0); /*獲取等待隊列中的進程總數(shù)*/if(i+j)=0) /*如果兩個隊列為空*/stop=1;fresh();/*刷新一下屏幕*/return;if(i0&canrun) /*如果就緒隊列中的進程數(shù)小于maxrun(maxrun為就緒隊列中的最大數(shù)目)且等待隊列不為空,且有足夠的內存(maxrun為true時表示有足夠內存)*/getfromeready();/*從等待隊列中選取一個優(yōu)先級最高,時間最少的*/coverfront();/*把游標重畫一遍(這里放這個函數(shù)好像有點多余)*/gett

35、ime(&t2);time=(t2.ti_hour-t1.ti_hour)*60*60*100+(t2.ti_min-t1.ti_min)*60*100+(t2.ti_sec-t1.ti_sec)*100+t2.ti_hund-t1.ti_hund; /*計算兩次執(zhí)行handle的時間差,其實可以用gettime()這個庫函數(shù),但當時沒發(fā)現(xiàn)。*/runtime-=time; /*runtime是時間片大小,是個全局變量*/drawsector();/*畫屏幕中間的時間片轉盤*/if(runtimeisrun)*screenweidth,這樣,如果它是就緒隊列中的(它的isrun是1),它就在屏

36、幕的左邊,如果它是等待隊列中的(它的isrun是0),它就在屏幕的右邊。關于集成圖形驅動做成exe文件在tc里頭,生成的exe文件如果是文本模式的,則可以運行,而如果是圖形模式的,生成的exe老是提示你沒有初始化圖形驅動,可以把圖形驅動集成到graphic里頭,方法如下:注冊圖形驅動:bgiobj EGAVGA 回車得到EGAVGA.OBJTLIB LIBGRAPHICS.LIB+EGAVGA.OBJ回車即可在程序中用registerbgidriver(EGAVGA_driver);其它對應的如下CAG.BGI CGA_driverEGA.VGA.BGI EGAVGA_driverHERC.B

37、GIHERC_driverATT.BGIATT_driverPC3270.BGIPC3270_driverIBM8514.BGIIBM8514_driver注冊字體:bgiobj trip|litt|sans|goth分別對應字體trip.chr|litt.chr|sans.chr|goth.chrtlib libgraphics.lib+litt.obj字型驅動registerbgifont()litt.chrtlib得到的字符名入samll_font源程序:#include #include #include #include #include #include #include /*包含

38、一些必要的頭文件*/#define INTR 0X1C/*定義時鐘中斷號*/#define ENTER 13/*定義回車鍵*/#define KEY_UP 18432/*定義向上鍵的整數(shù)值*/#define KEY_DOWN 20480/*定義向下鍵的整數(shù)值*/#define KEY_LEFT 19200/*定義向左鍵的整數(shù)值*/#define KEY_RIGHT 19712/*定義向右鍵的整數(shù)值*/#define ALT_F 8448/*定義按下altf返回的整數(shù)值*/#define ALT_S 7936/*定義按下alts返回的整數(shù)值*/#define ALT_O 6144/*定義alto

39、返回的整數(shù)值*/#define ALT_H 8960/*定義alth返回的整數(shù)值*/#define ESC 27/*定義esc返回的整數(shù)值,以上這些鍵值都是有get_key()函數(shù)獲得*/typedef struct menubar_sint number,x,y,barheight,baritemwidth;struct menu_s *mhead;struct menu_s *mtail;struct menu_s *mpoint;void (* docommand)();MenuBar; /*定義一個菜單欄數(shù)據(jù)結構,在上面已經(jīng)解釋過*/typedef struct menu_sint n

40、umber;int subwidth;int subcount;char *content;struct menu_s *next;struct menu_s *before;struct submenu_s *sub;struct submenu_s *head;struct submenu_s *tail;Menu; /*定義一個菜單結構體,具體在上面已經(jīng)解釋過*/typedef struct submenu_sint number;int isactive;char *content;struct submenu_s *next;struct submenu_s *before;subm

41、enu; /*定義一個菜單項,具體已在上面解釋過*/typedef struct process_tint pid;int isrun;int ishalt;int pos;int priority;int time_total;int time_left;long startaddr;long size;void (*fun)();struct process_t *next;struct process_t *before;process; /*定義一個pcb,在上面已經(jīng)解釋過*/typedef struct memory_tlong startaddr;long size;struct

42、memory_t *next;struct memory_t *before;memory; /*定義一個空閑內存塊結構,在上面已經(jīng)解釋過*/void docommand();void drawprocess(process *,int,int,int,int);void readfile();void writefile();void drawl_r(int,int);void addprocess();long getinput(char *);void savefile();void fresh();int findm_f_f(process *p);int findm_b_f(proc

43、ess *p);long getfreesize();void acceptm_f_f(process *p);void drawmembar();void creatememory(long,long);void rancreatep(long num);void randomcreate();void setmemsize();/*一些函數(shù)聲明,一下開始定義全局變量*/MenuBar *Mb; /*一個菜單欄*/void *buff; /*用來保存畫菜單時預先保存的區(qū)域*/process *phead,*ptail,*prunning,*ppoint; /*用來保存進程隊列的頭,尾,正在運

44、行,和當前游標指向的一個進程*/struct time t1,t2; /*定義兩個time結構體類型,用來記錄在兩次handle函數(shù)執(zhí)行之間的時間差*/memory *mhead,*mtail; /*空閑內存塊的頭尾指針*/int roundtime=500,runtime=500,maxrun=5,stop=1,canrun=1,memway=1; /*roundtime用來保存時間片大小,runtime用來保存當前時間片大小,maxrun用來保存系統(tǒng)所能運行的最大進程數(shù),stop用來控制是否停止模擬,canrun用來記錄系統(tǒng)是否有足夠內存,memway用來記錄當前內存的適應方式(最佳適應還

45、是最先適應)*/long memorysize=35460L; /*用來定義內存大小*/int get_key() union REGS rg; rg.h.ah=0; int86(0x16,&rg,&rg); if(rg.h.al=0)return rg.h.ahnumber=0;Mb-mpoint=Mb-mhead=Mb-mtail=NULL;Mb-x=0;Mb-y=0;Mb-barheight=18;Mb-baritemwidth=100;Mb-docommand=docommand; /*初始化Mb中的一些變量,具體的變量含義已在上面解釋過*/if(Mb-mtail=NULL) /*如果當

展開閱讀全文
溫馨提示:
1: 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
2: 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
3.本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
4. 未經(jīng)權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
5. 裝配圖網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

相關資源

更多
正為您匹配相似的精品文檔
關于我們 - 網(wǎng)站聲明 - 網(wǎng)站地圖 - 資源地圖 - 友情鏈接 - 網(wǎng)站客服 - 聯(lián)系我們

copyright@ 2023-2025  zhuangpeitu.com 裝配圖網(wǎng)版權所有   聯(lián)系電話:18123376007

備案號:ICP2024067431-1 川公網(wǎng)安備51140202000466號


本站為文檔C2C交易模式,即用戶上傳的文檔直接被用戶下載,本站只是中間服務平臺,本站所有文檔下載所得的收益歸上傳人(含作者)所有。裝配圖網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對上載內容本身不做任何修改或編輯。若文檔所含內容侵犯了您的版權或隱私,請立即通知裝配圖網(wǎng),我們立即給予刪除!