-
大小: 2KB文件類(lèi)型: .cpp金幣: 1下載: 0 次發(fā)布日期: 2021-01-10
- 標(biāo)簽:
資源簡(jiǎn)介
分頁(yè)式虛擬存儲(chǔ)系統(tǒng)是把作業(yè)信息的副本存放在磁盤(pán)上,當(dāng)作業(yè)被選中時(shí),可把作業(yè)的開(kāi)始幾頁(yè)先裝入主存且啟動(dòng)執(zhí)行。為此,在為作業(yè)建立頁(yè)表時(shí),應(yīng)說(shuō)明哪些頁(yè)已在主存,哪些頁(yè)尚未裝入主存,
代碼片段和文件信息
//?interrupt.cpp?:?Defines?the?entry?point?for?the?console?application.
//
#include?“stdafx.h“
#include?
#include?
#include?
//#pragma?comment(?linker?“/subsystem:\“windows\“?/entry:\“mainCRTStartup\““?)?//?設(shè)置入口地址
const?int?MAX_TASKS=100;
const?int?MAX_MEM=MAX_TASKS;
using?namespace?std;
struct?memory?
{
int?page;
int?sign?;
int?blockid;
string?diskid;
};
struct?task?
{
string?type;
int?page;
int?cell;
};
int?main(int?argc?char*?argv[])
{
int?memoryblock=0;
int?tasknum=0;
memory?MEM[MAX_MEM];
task?TASK[MAX_TASKS];
ifstream?ifile1ifile2;
ifile1.open(“memory.txt“);
string?a;
int?i=0;
memory?tmp;
while?(!ifile1.eof())
{
ifile1>>a;
switch(i)
{
case?0:
tmp.page=atoi(a.c_str());
break;
評(píng)論
共有 條評(píng)論