操作系统课程设计小型的操作系统_第1页
操作系统课程设计小型的操作系统_第2页
操作系统课程设计小型的操作系统_第3页
操作系统课程设计小型的操作系统_第4页
操作系统课程设计小型的操作系统_第5页
已阅读5页,还剩36页未读 继续免费阅读

付费下载

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

操作系统课程设计报告题目:一个小型的操作系统班级:计122(杏)学号:姓名:贾苏日期:2023/06/23实验平台(1)软件平台:开发系统平台:Windows7(64)Microsoftvisualc++6.0测试系统平台:Windows7(64)硬件平台:cpu:AMDA6-3420APU内存:4GB硬盘:500G2.所需实现的功能及相应的阐述:(1)进程调度管理为了贴切现实中的os,采用RR(轮转调度算法),且不提供用户显式的选择调度算法,即对用户是透明的。现实中的解决器主频为1Ghz~3Ghz,选取中间点为1.5Ghz,得时间片大小为0.7ns,为方便计算*10,则时间片大小定为7ns。假设进程之间的调度和切换不花费cpu时间。(2)死锁的检测与解决检测当然采用的是银行家算法解决:让用户选择kill一个进程,释放他所占有的所有资源。(3)虚拟分页调度管理虚拟分页:给出的是逻辑值访问磁盘将那个数据块放入到内存中内存中的地址采用一定的算法相相应于磁盘的地址。特规定访存采用的是按字节寻址内存的大小128KB外存的大小1MB即整个系统可以提供1MB的逻辑地址空间供进程进行访问(在地址总线足够扫描内存的情况下)。虚拟地址映射采用:直接映射法规定的8kB为一个页面,故内存有16个页面,外存有128个页面。假如产生了内存已满,便会产生缺页中断,淘汰采用FIFO算法,运用一个队列来做。部分内外存的相应表00,128,2*128+0.......11,129,2*128+1.......22,130,2*128+2.......16127,128+16,2*128+16.........(4)I/O中断解决设中断来自两个方面:1.DMA输送开始和结束时的中断设定一个宏定义为DMA一次传输的数据量的大小->DmaNum假定为10kb每次DMA开始:花费1nscpu时间进行中断解决DMA结束:花费2nscpu时间进行中断解决由操作系统课程知,DMA传输数据时不需要CPU的干预。随机的中断发生外部随机中断,cpu无条件的立即响应,并执行中断解决程序,同样的假设中断解决程序的调度和切换不花费cpu时间。(5)内存地址越界或内存局限性进程访问内存时超过了进程所要的最大值,此时发生中断,已达成内存保护的功能。内存局限性时即为当前的动态地址重定位寄存器中的值+进程所需的内存大小超过了内存的上限,此时进行内存紧凑,同时修改被移动的进程中的各个有关参数。3.总体设计开始开始内存管理查看运营情况开始运营外存空间查看查看cpu运营内存空间查看死锁检测与解除进程信息查看内存管理查看运营情况开始运营外存空间查看查看cpu运营内存空间查看死锁检测与解除进程信息查看4.程序所需的数据结构及其抽象过程先定义本次操作系统外设的资源,假设有A类资源10个,B类资源5个,C类资源6个->NeedRescourse;作业中的各个进程都需要一个代号->ProcessName,各个进程到来的时间不同,故需要记录一下->ArriveTime,每个进程所需要的cpu时间是不够的->NeedCpuTime,每个进程所需的内存空间大小是不同样的->NeedMem。各个进程中的任务是不同的故需要预先设定本进程中所要执行的操作类型->OpKind,假如是计算型的直接给出所需要的cpu时间即可,假如是I/O型的还需要给出所传输的数据量的大小->NeedTranDataNum,在此可以给OpKind做一个union型的结构。多道程序程序在运营的过程中需要对进程所需内存的地址进行动态地址重定位,故在系统之中需要设立一个动态地址重定位寄存器,其中的内容是下次进程可以使用的内存始址->DynReg。抽象结果:structProcess{ charProcessName[10];//进程的名字 intArriveTime;//ns级别 intNeedCpuTime;//此进程所需要的时间 intNeedMem;//所需要的cpu时间 FlagForOpOpKind;//用于指示是何种操作 intNeedTranDataNum;//给IO用的数据块 intOpCpus;//计算类型的操作所需的cpu时间 intNeedRescourse[3];//需要资源的数目NULL代表不需要使用 Process*next;};5.具体设计1.进程信息查看依次遍历所有的链表,并将它们的信息依次打印出来。实现函数名:voidShowProcessInfo()2.死锁的检测和解除假定本系统中的各个所需资源均是独占型资源,在进程运营的过程中不再释放,故只需要遍历链表将各个进程中所需的资源记录出来,只要不大于系统中预设的即可,一旦进程所需的资源大于系统中的最大量,给予用户选择kill一进程,已达成释放资源的目的。死锁检测函数:voidDeedLock() voidDeedLock_LookNeedRescourse()死锁解除函数:voidDeedLock_KillProcess()内存空间查看查看各个进程所占用的内存的空间,借助于DynReg这个全局变量实行内存空间的动态重定位。实现函数:voidLookMem()查看CPU运营以CPU的角度,查看作业的运营情况,实现函数:voidLookCpu() voidLookCpu_ShowRunningProcess()外存空间查看外存空间是用户的工作区间,故只要遍历整个进程链表,记录出所有进程占有的所有空间即可。实现函数:voidLookDiskMem()查看运营查看系统运营中各个资源的使用情况:实现函数: voidShowRunningProcess() voidShowRunningProcess_CalculateCpuNeed(int*,int)内存管理缺页调度算法:FIFO(借助于循环队列实现)实现函数:voidMemToDiskMem()6.程序运营和调试1.打开程序的初始界面:按系统提醒输入进程数,及其相关的各个参数2.输入完毕后的主界面:用户可以按下相关的选择键实行有关的各个操作。按下1查看各个进程的信息可以看到刚刚输入的各个进程的有关信息4.按下2按下3查看运营时CPU的使用情况可见此时系统是安全的。系统出差提醒按下1显示当前各个进程所需的资源然后kill进程1后在查看一下作业中的进程,发现被kill的进程没有的,实现了此功能。按下4查看内存的使用情况按下5查看外存空间按下6查看运营情况按下7产看内存使用情况没有产生缺页产生缺页10.按下9退出此系统7.碰到的问题自己编写映射表相称的困难,一度想改用Java语言,在于对C++语言的了解不够。犯错解决没有完全做完,做的不够精细,很多地方直接结束对用户输入的数据做的类型检查不够充足deletejob时总是出现系统错误,后debug发现,由于对象之中存在不为空的指针,导致犯错,故再释放指针所占空间后系统正常运营。源代码#include<iostream>#include<cstring>#include<windows.h>#include<cstdlib>#include"CirQueue.h"//循环队列的头文献usingnamespacestd;#defineMAXMEM128//定义本次操作系统的最大内存容量#defineMAXDISKMEM1024//定义本次操作系统的最大外存容量#defineYE10//定义本次操作系统的分页大小并以此实现虚拟存储intUsedMAXMEM=0;intUsedMAXDISKMEM=0;//定义进程也许用到的外部资源#defineA10#defineB5#defineC6//cpu#defineRR7//定义时间片大小为7ns#defineBEFOREDMA1//DMA之前所需的cpu时间#defineAFTERDMA2//DMA之后所需的cpu时间#defineONEDMANUM10//DMA一次最多传送10kb的数据enumFlagForOp{ IO,Calculate,others};intDynReg=0;//定义用于描述动态地址重定位寄存器的全局变量structProcess{ charProcessName[10];//进程的名字 intArriveTime;//ns级别 intNeedCpuTime;//此进程所需要的时间 intNeedMem;//所需要的cpu时间 FlagForOpOpKind;//用于指示是何种操作 intNeedTranDataNum;//给IO用的数据块 intOpCpus;//计算类型的操作所需的cpu时间 //假设others不需要其他的各个操作。 intNeedRescourse[3];//需要资源的数目NULL代表不需要使用0——a.... Process*next;};classJOB{ Process*p; Process*head; Process*head1;//建立一个备用的链表 // Process*wait,*runing;//wait为等待链表running是正在运营的进程public: JOB(){ head1=p=head=NULL;//初始化为空 cout<<"Pleasewaiting.TheSystemisinitial."<<endl; Sleep(2023);//暂停一秒maybeSleep() cout<<"Systemisalready.Nowyoushouldenterinformationofyoujob."<<endl; intn; cout<<"enteryourjob'sprocessnum."<<endl; cin>>n; while(n){ p=newProcess(); cout<<"pleaseenterthenameofprocess."<<endl; cin>>p->ProcessName; cout<<"pleaseenterthearrivetimeofprocess."<<endl; cin>>p->ArriveTime; cout<<"pleaseentertheNeedCpuTimeofprocess."<<endl; cin>>p->NeedCpuTime; cout<<"pleaseentertheNeedMemofprocess."<<endl; cin>>p->NeedMem; while(p->NeedMem>128){ cout<<"ThisSystemcan'tnotacceptyourjob!Maybeyourjobistoolarge!Pleaseenteranum<128"<<endl; cin>>p->NeedMem; } cout<<"pleaseentertheoperationofprocess.0toTranDiskNum,1tocpu"<<endl; intnn; cin>>nn; if(nn==0){ cout<<"pleaseentertheNeedTranDataNum."<<endl; cin>>p->NeedTranDataNum; p->OpKind=IO; }else{ cout<<"pleaseentertheOpCpus."<<endl; cin>>p->OpCpus; p->OpKind=Calculate; } cout<<"PLeaseentertheA,BorCyouneed"<<endl; for(inti=0;i<3;i++){ cin>>p->NeedRescourse[i]; } p->next=NULL;//尾结点为空表达一个节点的完毕下面进行插入链表的工作 head=SortLinkTable(head,p); n--; }//while LinkCopy();//将本次整理好的链表依次赋值赋给备用链表 Provide_Same_Process_Name();//检查重名现象 } voidProvide_Same_Process_Name(); voidVisitLinkTable(); Process*SortLinkTable(Process*,Process*); voidBeginRunning(); voidShowProcessInfo(); voidDeedLock(); voidDeedLock_KillProcess(); voidDeedLock_LookNeedRescourse(); voidLookCpu(); voidLookCpu_ShowRunningProcess(); voidLookMem(); voidShowRunningProcess(); voidShowRunningProcess_CalculateCpuNeed(int*,int); voidLookDiskMem(); voidLookMem_ChangeMem(); boolCheckMem(); voidLookDiskMem_Change(); voidLinkCopy();voidMemToDiskMem();~JOB(){ deletehead; deletehead1; deletep;}};JOB*job;//设立全局变量voidJOB::Provide_Same_Process_Name(){system("cls");charbuffer[10];Process*temp=head1;Process*temp1=head1;while(temp){ temp1=temp->next; while(temp1){ if(strcmp(temp->ProcessName,temp1->ProcessName)==0){ cout<<"Mini_OperationSystemhaddetectthesamenameprocessinyourjob!"<<endl; cout<<"ThisSystemcan'tacceptthissitution.PleaseRenameyourProcess!\nThanksforyourcorporation!"<<endl;cout<<"ThisisALLyourprocessname:"<<endl;VisitLinkTable(); cout<<"Enter1torenametheformer,0torenamethelater!"<<endl; intn=0; cin>>n; cout<<"NowEnternewName:"<<endl; if(n==0){ cin>>buffer; strcpy(temp1->ProcessName,buffer); }else{cin>>buffer; strcpy(temp->ProcessName,buffer); } }//endif temp1=temp1->next; }//endwhiletemp1 temp=temp->next;}//while}voidAgainEnterJOB(){ system("cls"); deletejob; job=newJOB();}voidJOB::VisitLinkTable(){//不加JOB前缀的时候编译但是加上代表此函数是JOBclass之中的 while(head1){ cout<<head1->ProcessName<<endl; head1=head1->next; }cout<<"\nNow,YoucanseeTheListtocheckout."<<endl;}voidJOB::LinkCopy(){Process*temp=NULL,*temp2=head;if(head1==NULL){cout<<"LinkCopy()isHere!"<<endl;}if(head1)//不为空时将其下一个置为空head1->next=NULL;head1=NULL;while(temp2){ //applyanewnode temp=newProcess();strcpy(temp->ProcessName,temp2->ProcessName); temp->ArriveTime=temp2->ArriveTime;temp->NeedCpuTime=temp2->NeedCpuTime; temp->NeedMem=temp2->NeedMem; if(temp2->OpKind==IO){ temp->OpKind=IO;temp->NeedTranDataNum=temp2->NeedTranDataNum; }else{ temp->OpKind=Calculate;temp->OpCpus=temp2->OpCpus; } for(inti=0;i<3;i++){temp->NeedRescourse[i]=temp2->NeedRescourse[i]; } //applyendtemp->next=NULL; //cout<<"copyisright!"<<endl;if(head1==NULL){head1=temp; }else{ Process*k=head1;while(k->next){//寻找到最后一个节点不断的循环退不出去 k=k->next; } k->next=temp; } //cout<<"copyisright!"<<endl;temp2=temp2->next;}//whileif(head1==NULL)cout<<"LinkCopy()isout!"<<endl;system("pause");}voidJOB::MemToDiskMem(){ system("cls");CirQueue<int>q(16);//一共定义的16个页面q.EnQueue(e); int*Mem; intcount=0;//记录下进程的数目 Process*temp_head1=head1; while(temp_head1){count++; temp_head1=temp_head1->next; }temp_head1=head1;Mem=newint[count];inttemp_count=0; while(temp_head1){intBegin=0; cout<<"Process:"<<temp_head1->ProcessName<<"memeryusesituation:"<<endl;Begin+=temp_head1->NeedMem; intk=0;//所需的页面数目 if(Begin%YE==0){k=Begin/YE; }else{k=Begin/YE+1; }Mem[temp_count++]=k; cout<<k<<"页被占用!"<<endl; temp_head1=temp_head1->next; }//endwhilecout<<endl; temp_head1=head1; cout<<"Wanttosee缺页调度过程Y/N."<<endl; charoption; inttotal=0,AllTotal=0; cin>>option; if(option=='y'||option=='Y'){ for(inti=0;i<count;i++){ AllTotal+=Mem[i]; for(intj=0;j<Mem[i];j++){if(q.EnQueue(true)){ temp_count=0; while(temp_count<i){temp_head1=temp_head1->next; temp_count++; }cout<<"Process:"<<temp_head1->ProcessName<<"needmemisloading.ok"<<endl; temp_head1=head1; }else{temp_count=0; while(temp_count<i){temp_head1=temp_head1->next; temp_count++; }cout<<"Process:"<<temp_head1->ProcessName<<"needmemisloadingerror缺页调度"<<endl; temp_head1=head1; total++;boolflag=q.DeQueue(); if(q.EnQueue(true)){cout<<"Process:"<<temp_head1->ProcessName<<"needmemisloadingok缺页调度"<<endl; } } }//for2 cout<<endl; }//for1} cout<<"一共产生了:"<<total<<"次缺页中断.\n"<<"缺页中断率为:"<<(float)total/AllTotal<<"%"<<endl; system("pause");}voidJOB::LookCpu_ShowRunningProcess(){ system("cls"); intNowTime=0; Process*run=head1;//临时试用一下最终需要归还为NULL Process*wait=head1;//dsvrfgvregrefswgvregegsdgre intcount=0; while(run){//计算等待运营的进程的个数count++; run=run->next; } run=head1;//还原运营链表 //建立一个映射表 char**Run_Process_Name=newchar*[count];//申请一个动态的二维表 for(inti=0;i<count;i++){//响应的二维空间申请完毕Run_Process_Name[i]=newchar[10]; strcpy(Run_Process_Name[i],run->ProcessName); run=run->next; } run=NULL;int*Run_Process_CpuNeed=newint[count]; //映射表建立完毕//计算各个进程中所需的cpu时间 ShowRunningProcess_CalculateCpuNeed(Run_Process_CpuNeed,count); Process*priorNode=NULL; //Process*tail=head; while(true){ //inttime11=wait->ArriveTime; if(wait&&NowTime>=wait->ArriveTime){ if(run==NULL){ run=wait; priorNode=run; }else{//连接到尾部Process*temp=run; while(temp->next!=priorNode){//寻找到前驱节点 temp=temp->next; } temp->next=wait;//将结点连接上链表 priorNode=wait; //wait->next=run; } wait=wait->next;//释放一个结点 priorNode->next=run;//连接上头部形成循环链表 } if(run){ run=run->next;//重新调度 cout<<NowTime<<"->"<<NowTime+RR<<"Process:"<<run->ProcessName<<"isRunning"<<endl; cout<<"cpu调度下一个运营的进程。"<<endl; NowTime+=RR; //依据上面建设的映射 按名取出所需运营的时间 intALLNeedCpu; for(inti=0;i<count;i++){if(strcmp(Run_Process_Name[i],run->ProcessName)==0) break; } ALLNeedCpu=Run_Process_CpuNeed[i];ALLNeedCpu-=RR;//减去本次运营的时间 if(ALLNeedCpu>0){ Run_Process_CpuNeed[i]=ALLNeedCpu;//重新写回到数组中保持一致性 }else{//此节点已经做完了请直接释放 if(run->next==run){ run=NULL; }else{ Process*k=run; while(k->next!=run){//寻找当前运营节点的前一个结点 k=k->next; } k->next=k->next->next; run=k; } } }//endif(run) if(wait==NULL&&run==NULL)//没有等待CPU的进程了和没有正在运营的进程满足退出的规定->退出 break; NowTime++; }//while system("pause"); LinkCopy();////将受损的链表修复}voidJOB::ShowRunningProcess(){ system("cls"); intNowTime=0; Process*run=head1;//临时试用一下最终需要归还为NULL Process*wait=head1;//dsvrfgvregrefswgvregegsdgre intcount=0; while(run){//计算等待运营的进程的个数count++; run=run->next; } run=head1;//还原运营链表 //建立一个映射表 char**Run_Process_Name=newchar*[count];//申请一个动态的二维表 for(inti=0;i<count;i++){//响应的二维空间申请完毕Run_Process_Name[i]=newchar[10]; strcpy(Run_Process_Name[i],run->ProcessName); run=run->next; } run=NULL;int*Run_Process_CpuNeed=newint[count]; //映射表建立完毕 ShowRunningProcess_CalculateCpuNeed(Run_Process_CpuNeed,count); Process*priorNode=NULL; while(true){ //inttime11=wait->ArriveTime; if(wait&&NowTime>=wait->ArriveTime){ if(run==NULL){ run=wait; priorNode=run; }else{//连接到尾部Process*temp=run; while(temp->next!=priorNode){//寻找到前驱节点 temp=temp->next; } temp->next=wait;//将结点连接上链表 priorNode=wait; //wait->next=run; } wait=wait->next;//释放一个结点 priorNode->next=run;//连接上头部形成循环链表 } if(run){ run=run->next;//重新调度 cout<<NowTime<<"->"<<NowTime+RR<<"Process:"<<run->ProcessName<<"isRunning"<<endl; cout<<"NeedRescourse:A"<<run->NeedRescourse[0]<<"B"<<run->NeedRescourse[1]<<"c"<<run->NeedRescourse[2]<<"isusing."<<endl; cout<<"cpu调度下一个运营的进程。"<<endl; NowTime+=RR; //依据上面建设的映射 按名取出所需运营的时间 intALLNeedCpu; for(inti=0;i<count;i++){if(strcmp(Run_Process_Name[i],run->ProcessName)==0) break; } ALLNeedCpu=Run_Process_CpuNeed[i];ALLNeedCpu-=RR;//减去本次运营的时间 if(ALLNeedCpu>0){ Run_Process_CpuNeed[i]=ALLNeedCpu;//重新写回到数组中保持一致性 }else{//此节点已经做完了请直接释放 if(run->next==run){ run=NULL; }else{ Process*k=run; while(k->next!=run){//寻找当前运营节点的前一个结点 k=k->next; } k->next=k->next->next; run=k; } } }//endif(run) if(wait==NULL&&run==NULL)//没有等待CPU的进程了和没有正在运营的进程满足退出的规定->退出 break; NowTime++; }//while system("pause"); LinkCopy();////将受损的链表修复}voidJOB::ShowRunningProcess_CalculateCpuNeed(int*Run_Process_CpuNeed,intcount){Process*temp=head1;for(inti=0;i<count;i++){intALLNeedCpu=temp->NeedCpuTime; if(temp->OpKind==IO){ if(temp->NeedTranDataNum%ONEDMANUM==0){ ALLNeedCpu+=(temp->NeedTranDataNum/ONEDMANUM)*(BEFOREDMA+AFTERDMA); }else{ ALLNeedCpu+=(temp->NeedTranDataNum/ONEDMANUM+1)*(BEFOREDMA+AFTERDMA); } }else{ ALLNeedCpu+=temp->OpCpus; } Run_Process_CpuNeed[i]=ALLNeedCpu; temp=temp->next; }}voidJOB::ShowProcessInfo(){system("cls"); Process*temp=head1; intcount=0; while(temp){ cout<<"------The"<<count+1<<"processinfo"<<endl; cout<<"Name:"<<temp->ProcessName<<'.'<<endl; cout<<"ArriveTime:"<<temp->ArriveTime<<'.'<<endl; cout<<"NeedCpuTime:"<<temp->NeedCpuTime<<'.'<<endl; cout<<"NeedMem:"<<temp->NeedMem<<'.'<<endl; cout<<"OpKind:"<<temp->OpKind<<'.'<<endl; cout<<"NeedRescourse:"<<"A:"<<temp->NeedRescourse[0]<<",B:"<<p->NeedRescourse[1] <<",C:"<<p->NeedRescourse[2]<<endl; temp=temp->next; cout<<'\n'; count++; } cout<<"enteranykeyreturnmain()."<<endl; getchar(); getchar();}voidJOB::DeedLock(){ system("cls");Process*temp=head1; intLocalA=0,LocalB=0,LocalC=0; while(temp){LocalA+=temp->NeedRescourse[0]; LocalB+=temp->NeedRescourse[1];LocalB+=temp->NeedRescourse[2]; temp=temp->next; } if(LocalA>A||LocalB>B||LocalC>C){cout<<"NeedRescourseisover!"<<endl;cout<<"Enter1toSeeNeedRescourse,elsetomain()!"<<endl; intn; cin>>n; if(n==1){DeedLock_LookNeedRescourse(); } }else{cout<<"YourJObisok!SystemNowissafe!"<<endl; } system("pause");}voidJOB::DeedLock_LookNeedRescourse(){Process*temp=head1; cout<<"\nNeedRescourse:ABC\n";while(temp){cout<<temp->ProcessName<<""<<temp->NeedRescourse[0]<<""<<temp->NeedRescourse[1]<<""<<temp->NeedRescourse[2]<<endl; temp=temp->next; } system("pause"); cout<<"AreyouwanttoKilloneProcesstoReleaseNeedRescourse.Y/N"<<endl; charoption;cin>>option; if(option=='Y'||option=='y'){DeedLock_KillProcess(); }}voidJOB::DeedLock_KillProcess(){Process*temp=head;cout<<"Enter1,2,....toKill1th,2th,....Process."<<endl;intn;cin>>n;intcount=1;while(count<n){count++; temp=temp->next;}if(count==1){head=head->next;}else{Process*temp2=head;n=1; while((n+1)<count){ n++; temp2=temp2->next; } temp2->next=temp->next;//删除temp结点}LinkCopy();}voidJOB::LookCpu(){ system("cls");LookCpu_ShowRunningProcess();}voidJOB::LookMem(){intMem[128];intDiskMem[1024]; memset(Mem,0,128); memset(DiskMem,0,1024); DynReg=0; Process*temp=head1; while(temp&&DynReg<=128){ cout<<"MemeryFrom"<<DynReg<<"to"<<DynReg+temp->NeedMem-1<<"giveto"<<temp->ProcessName<<endl; DynReg+=temp->NeedMem; temp=temp->next; } cout<<"EnterAnyKeytoReturnMain()."<<endl; getchar(); getchar();}boolJOB::CheckMem(){//检查虚拟存储器是否可以接纳 intsum=0; Process*temp=head; while(temp){ sum+=temp->NeedMem; } if(sum>=1024) returnfalse; else returntrue;}voidJOB::LookDiskMem(){ intsum=0; Process*temp=head; while(temp){ sum+=temp->NeedMem; temp=temp->next; } if(sum>1024){ cout<<"ThissystemDiskMemeryisout!\npleaseenter1tochangeyouprocessNeedMem\nelsesystemmayhavesomethingwrong"<<endl; intn; cout<<"Enter1toChangeMemerysizeelseSystemwillexit."<<endl; cin>>n; if(n==1){ LookDiskMem_Change(); }else{exit(0); } }else{ cout<<"\nJOBtotaluse:"<<sum<<"Memery!"<<endl; } cout<<"enteranykeyreturnmain()."<<endl; getchar(); getchar(); }voidJOB::LookDiskMem_Change(){ Process*temp=head; while(temp){ cout<<"Process:"<<temp->ProcessName<<"need"<<temp->NeedMem<<endl; temp=temp->next; } temp=head; while(temp){ charn; cout<<"Change"<<temp->ProcessName<<"NeedMem?Y/N(y/n)"<<endl; cin>>n; if(n=='Y'||n=='y'){ cout<<"EnteryouNewNeedMem:"<<endl; cin>>temp->NeedMem; }elseif(n==

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论