2022年模拟分页式虚拟存储管理中硬件的地址转换和缺页中断--选择页面调度算法处理缺页中断 .pdf





《2022年模拟分页式虚拟存储管理中硬件的地址转换和缺页中断--选择页面调度算法处理缺页中断 .pdf》由会员分享,可在线阅读,更多相关《2022年模拟分页式虚拟存储管理中硬件的地址转换和缺页中断--选择页面调度算法处理缺页中断 .pdf(11页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、操作系统实验二第一题一实验内容模拟分页式虚拟存储管理中硬件的地址转换和缺页中断,以及选择页面调度算法处理缺页中断。二实验目的在电脑系统总,为了提高主存利用率,往往把辅助存储器作为主存储器的扩充,使多道运行的作业的全部逻辑地址空间综合可以超出主存的绝对地址空间。用这种方法扩充的主存储区成为虚拟存储器。三实验题目模拟分页式存储管理中硬件的地址转换和产生缺页中断。是否开始取 一 条 指取指令中访问的页号查页表该也标志 =1?输出“* ”页号表示发生缺页中断形成绝对地址输出绝对地址有后继指令?取下一条指令结束精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第
2、1 页,共 11 页四程序清单/ / 操作实验二 .cpp : 定义控制台应用程序的入口点。/ #include stdafx.h #include #include #include using namespace std; class ins private:string ope; long int page; long int unit; public: ins() ins(string o,long int p,long int u):ope(o),page(p),unit(u) void setope(string o) ope=o; void setpage(long int p)
3、 page=p; void setunit(long int u) unit=u; string getope()return ope; long int getpage()return page; long int getunit()return unit; ; class work private: long int Page; int sym; long int inum; long int onum; public: work() work(long int P, int s,long int i,long int o):Page(P),sym(s),inum(i),onum(o) v
4、oid setPage(long int P) Page=P; void setsym( int s) sym=s; void setinum(long int i) inum=i; 精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 2 页,共 11 页void setonum(long int o) onum=o; long int getPage()return Page; int getsym()return sym; long int getinum()return inum; long int getonum()return onum; ;
5、 void diaodu(work *w,ins * i,int numofins) for(int j=0;jnumofins;j+) long int tempofk; long int a =ij.getpage(); for(int k=0;k7;k+) /7 是页表的页数if(wk.getPage()!=a) continue; else tempofk=k; break; if(wtempofk.getsym()=1) cout 绝对地址:wtempofk.getinum()*128+ij.getunit() 磁盘地址为: wtempofk.getonum() 操作为: ij.ge
6、tope()endl; else cout* 发生缺页中断 endl; int main() ins*INS=new ins12; INS0.setope (+); INS0.setpage(0); INS0.setunit(70); INS1.setope (+); INS1.setpage(1); INS1.setunit(50); INS2.setope ( ); 精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 3 页,共 11 页INS2.setpage(2); INS2.setunit(15); INS3.setope ( 存 ); IN
7、S3.setpage(3); INS3.setunit(21); INS4.setope ( 取 ); INS4.setpage(0); INS4.setunit(56); INS5.setope (-); INS5.setpage(6); INS5.setunit(40); INS6.setope ( 移位 ); INS6.setpage(4); INS6.setunit(53); INS7.setope (+); INS7.setpage(5); INS7.setunit(23); INS8.setope ( 存 ); INS8.setpage(1); INS8.setunit(37);
8、INS9.setope ( 取 ); INS9.setpage(2); INS9.setunit(78); INS10.setope (+); INS10.setpage(4); INS10.setunit(1); INS11.setope ( 存); INS11.setpage(6); INS11.setunit(84); work*W =new work7; ifstream in(g:/operate1.txt); long int p; int s; long int i; long int o; for(int jj=0;jjp;ins;ini;ino ; Wjj.setPage(p
9、); Wjj.setsym(s);Wjj.setinum(i);Wjj.setonum(o); diaodu(W,INS,12); 五结果显示精选学习资料 - - - - - - - - - 名师归纳总结 - - - - - - -第 5 页,共 11 页操作系统实验二第二题一用先进先出FIFO是否是否否是是否开始取一条指令取指令中访问的页号-L 查页表该页标志 =1?形成绝对地址是存指令?置 L 页修改标志为“1”输出绝对地址有后继指令?取下一条指令结束j=pk J页修改标志为1?输出j,修改L 页的标志及在内存中的地址,输出L Pk=L,k=(k=m-1)?0:(k+1)修改页表精选学习资
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022年模拟分页式虚拟存储管理中硬件的地址转换和缺页中断-选择页面调度算法处理缺页中断 2022 模拟 分页 虚拟 存储 管理 硬件 地址 转换 中断 选择 页面 调度 算法 处理

链接地址:https://www.taowenge.com/p-25572712.html
限制150内