-
大小: 503KB文件類型: .rar金幣: 2下載: 1 次發(fā)布日期: 2021-06-29
- 語言: 其他
- 標(biāo)簽: 操作系統(tǒng)??
資源簡介
操作系統(tǒng)課程設(shè)計(jì)多道批處理系統(tǒng)兩級(jí)調(diào)度的模擬,里面包括報(bào)告、源代碼、可執(zhí)行程序

代碼片段和文件信息
#include?
#include?
#include?
#include?
#define?getpch(type)(type*)malloc(sizeof(type))
#define?N?10
#define?M?100
#define?C?4
struct?time
{
int?hour;?//時(shí)
int?min;??//分
};
struct?jcb
{
????char?name[10];????????//進(jìn)程名
????struct?time?arr_time;?//到達(dá)時(shí)間
????struct?time?ent_time;?//進(jìn)入內(nèi)存時(shí)間
????struct?time?sta_time;?//開始時(shí)間
????struct?time?fin_time;?//結(jié)束時(shí)間
int?run_time;?????????//估計(jì)運(yùn)行時(shí)間
????int?tr_time;??????????//周轉(zhuǎn)時(shí)間
????int?men;??????????????//主存需要
????int?mac;??????????????//磁帶機(jī)
????int?sta;??????????????//狀態(tài)位
????struct?jcb*?next;
};
typedef?struct?jcb?JCB;
struct?link
{
????char?name[10];?????????//進(jìn)程名
????struct?time?arr_time;??//到達(dá)時(shí)間
????struct?time?ent_time;??//進(jìn)入內(nèi)存時(shí)間
????struct?time?sta_time;??//開始時(shí)間
????struct?time?fin_time;??//結(jié)束時(shí)間
int?run_time;??????????//估計(jì)運(yùn)行時(shí)間
????int?tr_time;???????????//周轉(zhuǎn)時(shí)間
????int?addr;??????????????//起始地址
????int?len;???????????????//分區(qū)大小
????int?mac;???????????????//磁帶機(jī)
????int?state;?????????????//狀態(tài)位0為空閑1為被使用
????struct?link?*f;????????//前指針
????struct?link?*b;????????//后指針
}?;
struct?jcb??save[N];
struct?jcb?*first_jcb=NULL*p;
struct?jcb??result[6][6];
struct?link?*s*q;
int?sort_result(int?i);
int?run();
int?apply(jcb?*p1);
compare(int?i);
print(int?i);
dis_job();
dis_mem();
merge(link?*y);
input_job1();
input_job2();
read();
release();
run();
p_fcfs();
p_spf();
sort_job1();
sort_job2();
sort_result(int?i);
time_cmp(time?atime?b);
j_attemper(int?type);
int?sys_men=100;?????//系統(tǒng)內(nèi)存分配為100
int?sys_mac=4;???????//磁帶機(jī)數(shù)
struct?time?sys_timesys_time1;
char?name[10];
int??print(int?i)????//顯示作業(yè)最終運(yùn)行情況
{
????struct?jcb?*p1;
????int?j;
????p1=first_jcb;
????for(j=1;j<=5;j++)
????{
????????result[i][j]=*p1;
????????p1=p1->next;
????}
????sort_result(i);
????printf(“\n\n??===========================================================================\n“);
????printf(“\n\t作業(yè)運(yùn)行結(jié)果情況:\n“);
????printf(“\n\t進(jìn)程名\t到達(dá)\t運(yùn)行\(zhòng)t主存\t磁帶機(jī)\t進(jìn)入\t開始\t完成\t周轉(zhuǎn)“);
????for(j=1;j<=5;j++)
????{
printf(“\n\t%s\t?%d:%d\t%d\t%d\t%d\t“result[i][j].nameresult[i][j].arr_time.hourresult[i][j].arr_time.minresult[i][j].run_timeresult[i][j].menresult[i][j].mac);
printf(“%d:%d\t%d:%d\t%d:%d\t%d“result[i][j].ent_time.hourresult[i][j].ent_time.minresult[i][j].sta_time.hourresult[i][j].sta_time.minresult[i][j].fin_time.hourresult[i][j].ent_time.minresult[i][j].tr_time);
????}
}
int?sort_result(int?i)??//對(duì)作業(yè)按到達(dá)時(shí)間重新排序顯示分析方便
{
????int?jk;
????for(k=1;k<=4;k++)
????{
????????for(j=1;j<=4;j++)
????????{
if(time_cmp(result[i][j].arr_timeresult[i][j+1].arr_time)==1)
{
result[i][0]=result[i][j];
result[i][j]=result[i][j+1];
result[i][j+1]=result[i][0];
}
????????}
????}
return?1;
}
int?time_cmp(struct?time?astruct?time?b)???//時(shí)間比較?ab返回1;
{
????if(a.hour ????else?if(a.hou
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件?????329728??2012-07-02?23:26??操作系統(tǒng)課程設(shè)計(jì)\3109006086李漢權(quán)操作系統(tǒng)課程設(shè)計(jì)報(bào)告.doc
?????文件?????229458??2012-06-29?23:55??操作系統(tǒng)課程設(shè)計(jì)\os.exe
?????文件????????130??2012-06-27?20:49??操作系統(tǒng)課程設(shè)計(jì)\os.txt
?????文件?????229458??2012-06-29?23:55??操作系統(tǒng)課程設(shè)計(jì)\源程序\Debug\os.exe
?????文件?????242396??2012-06-29?23:55??操作系統(tǒng)課程設(shè)計(jì)\源程序\Debug\os.ilk
?????文件??????37339??2012-06-29?23:55??操作系統(tǒng)課程設(shè)計(jì)\源程序\Debug\os.obj
?????文件?????227804??2012-06-29?22:59??操作系統(tǒng)課程設(shè)計(jì)\源程序\Debug\os.pch
?????文件?????459776??2012-06-29?22:59??操作系統(tǒng)課程設(shè)計(jì)\源程序\Debug\os.pdb
?????文件??????41984??2012-06-29?23:55??操作系統(tǒng)課程設(shè)計(jì)\源程序\Debug\vc60.idb
?????文件??????53248??2012-06-29?22:59??操作系統(tǒng)課程設(shè)計(jì)\源程序\Debug\vc60.pdb
?????文件??????15771??2012-06-29?22:59??操作系統(tǒng)課程設(shè)計(jì)\源程序\os.cpp
?????文件???????3353??2012-06-27?20:49??操作系統(tǒng)課程設(shè)計(jì)\源程序\os.dsp
?????文件????????512??2012-06-27?20:49??操作系統(tǒng)課程設(shè)計(jì)\源程序\os.dsw
?????文件??????58368??2012-06-29?23:59??操作系統(tǒng)課程設(shè)計(jì)\源程序\os.ncb
?????文件??????48640??2012-06-29?23:59??操作系統(tǒng)課程設(shè)計(jì)\源程序\os.opt
?????文件????????726??2012-06-29?23:55??操作系統(tǒng)課程設(shè)計(jì)\源程序\os.plg
?????文件????????130??2012-06-27?20:49??操作系統(tǒng)課程設(shè)計(jì)\源程序\os.txt
?????文件????????147??2012-06-30?00:01??操作系統(tǒng)課程設(shè)計(jì)\源程序\Readme.txt
?????目錄??????????0??2012-07-02?22:22??操作系統(tǒng)課程設(shè)計(jì)\源程序\Debug
?????目錄??????????0??2012-07-02?22:22??操作系統(tǒng)課程設(shè)計(jì)\源程序
?????目錄??????????0??2012-07-03?18:24??操作系統(tǒng)課程設(shè)計(jì)
-----------?---------??----------?-----??----
??????????????1978968????????????????????21
評(píng)論
共有 條評(píng)論