操作系统学习笔记:内存学习随笔
1.
我用代码实现如下:
#include<iostream> using namespace std; int main() { int page_size=1024; int page2block[4]={2,3,1,6}; int local_address; while(cin>>local_address) { int p=local_address/page_size; int d=local_address%page_size; if(p>=4) { printf("页号%d超过页表长度%d,逻辑地址%d非法",p,4,local_address); } else { int real_address=1024*page2block[p]+d; printf("物理地址为%d\n",real_address); } } }
2.
不要把这个K看走眼哦2333,这可是很大很大滴