分页式存储管理系统

页面大小: 1024 字节 内存大小: 64 页面 置换空间: 96 页面 初始装入页数: 3 页面

系统控制

内存位示图

内存块使用情况 (0-空闲, 1-占用)

置换空间使用情况

进程队列状态

运行队列:

就绪队列:

阻塞队列:

当前进程页表

当前没有运行进程

系统统计

0
总访问次数
0
缺页次数
0%
缺页率
系统初始化完成...
function wakeupProcess() { if (blockedQueue.length === 0) { log('阻塞队列为空'); return; } const wakeupProcess = blockedQueue.shift(); wakeupProcess.status = 'ready'; readyQueue.push(wakeupProcess); log(`进程 ${wakeupProcess.name} 被唤醒,加入就绪队列`); updateQueues(); } function terminateProcess() { if (!runningProcess) { log('当前没有运行进程'); return; } log(`终止进程 ${runningProcess.name}`); // 回收资源 for (let i = 0; i < runningProcess.pageCount; i++) { const entry = runningProcess.pageTable[i]; if (entry.present && entry.frameNo !== -1) { freeMemoryBlock(entry.frameNo); } if (entry.swapBlock !== -1) { freeSwapBlock(entry.swapBlock); } } // 从进程列表中移除 const processIndex = processes.indexOf(runningProcess); if (processIndex > -1) { processes.splice(processIndex, 1); } runningProcess = null; // 自动调度下一个进程 if (readyQueue.length > 0) { readyQueue.sort((a, b) => b.priority - a.priority); runningProcess = readyQueue.shift(); runningProcess.status = 'running'; log(`进程 ${runningProcess.name} 自动调度运行`); }