亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? addrspace.cc

?? Nachos platform for Ubuntu
?? CC
字號:
// addrspace.cc //	Routines to manage address spaces (executing user programs).////	In order to run a user program, you must:////	1. link with the -N -T 0 option //	2. run coff2noff to convert the object file to Nachos format//		(Nachos object code format is essentially just a simpler//		version of the UNIX executable object code format)//	3. load the NOFF file into the Nachos file system//		(if you haven't implemented the file system yet, you//		don't need to do this last step)//// Copyright (c) 1992-1993 The Regents of the University of California.// All rights reserved.  See copyright.h for copyright notice and limitation // of liability and disclaimer of warranty provisions.#include "copyright.h"#include "system.h"#include "addrspace.h"#include "noff.h"#ifdef HOST_SPARC#include <strings.h>#endif//----------------------------------------------------------------------// SwapHeader// 	Do little endian to big endian conversion on the bytes in the //	object file header, in case the file was generated on a little//	endian machine, and we're now running on a big endian machine.//----------------------------------------------------------------------static void SwapHeader (NoffHeader *noffH){	noffH->noffMagic = WordToHost(noffH->noffMagic);	noffH->code.size = WordToHost(noffH->code.size);	noffH->code.virtualAddr = WordToHost(noffH->code.virtualAddr);	noffH->code.inFileAddr = WordToHost(noffH->code.inFileAddr);	noffH->initData.size = WordToHost(noffH->initData.size);	noffH->initData.virtualAddr = WordToHost(noffH->initData.virtualAddr);	noffH->initData.inFileAddr = WordToHost(noffH->initData.inFileAddr);	noffH->uninitData.size = WordToHost(noffH->uninitData.size);	noffH->uninitData.virtualAddr = WordToHost(noffH->uninitData.virtualAddr);	noffH->uninitData.inFileAddr = WordToHost(noffH->uninitData.inFileAddr);}//----------------------------------------------------------------------// AddrSpace::AddrSpace// 	Create an address space to run a user program.//	Load the program from a file "executable", and set everything//	up so that we can start executing user instructions.////	Assumes that the object code file is in NOFF format.////	First, set up the translation from program memory to physical //	memory.  For now, this is really simple (1:1), since we are//	only uniprogramming, and we have a single unsegmented page table////	"executable" is the file containing the object code to load into memory//----------------------------------------------------------------------AddrSpace::AddrSpace(OpenFile *executable){    NoffHeader noffH;    unsigned int i, size;    executable->ReadAt((char *)&noffH, sizeof(noffH), 0);    if ((noffH.noffMagic != NOFFMAGIC) && 		(WordToHost(noffH.noffMagic) == NOFFMAGIC))    	SwapHeader(&noffH);    ASSERT(noffH.noffMagic == NOFFMAGIC);// how big is address space?    size = noffH.code.size + noffH.initData.size + noffH.uninitData.size 			+ UserStackSize;	// we need to increase the size						// to leave room for the stack    numPages = divRoundUp(size, PageSize);    size = numPages * PageSize;    ASSERT(numPages <= NumPhysPages);		// check we're not trying						// to run anything too big --						// at least until we have						// virtual memory    DEBUG('a', "Initializing address space, num pages %d, size %d\n", 					numPages, size);// first, set up the translation     pageTable = new TranslationEntry[numPages];    for (i = 0; i < numPages; i++) {	pageTable[i].virtualPage = i;	// for now, virtual page # = phys page #	pageTable[i].physicalPage = i;	pageTable[i].valid = TRUE;	pageTable[i].use = FALSE;	pageTable[i].dirty = FALSE;	pageTable[i].readOnly = FALSE;  // if the code segment was entirely on 					// a separate page, we could set its 					// pages to be read-only    }    // zero out the entire address space, to zero the unitialized data segment // and the stack segment    bzero(machine->mainMemory, size);// then, copy in the code and data segments into memory    if (noffH.code.size > 0) {        DEBUG('a', "Initializing code segment, at 0x%x, size %d\n", 			noffH.code.virtualAddr, noffH.code.size);        executable->ReadAt(&(machine->mainMemory[noffH.code.virtualAddr]),			noffH.code.size, noffH.code.inFileAddr);    }    if (noffH.initData.size > 0) {        DEBUG('a', "Initializing data segment, at 0x%x, size %d\n", 			noffH.initData.virtualAddr, noffH.initData.size);        executable->ReadAt(&(machine->mainMemory[noffH.initData.virtualAddr]),			noffH.initData.size, noffH.initData.inFileAddr);    }}//----------------------------------------------------------------------// AddrSpace::~AddrSpace// 	Dealloate an address space.  Nothing for now!//----------------------------------------------------------------------AddrSpace::~AddrSpace(){   delete pageTable;}//----------------------------------------------------------------------// AddrSpace::InitRegisters// 	Set the initial values for the user-level register set.//// 	We write these directly into the "machine" registers, so//	that we can immediately jump to user code.  Note that these//	will be saved/restored into the currentThread->userRegisters//	when this thread is context switched out.//----------------------------------------------------------------------voidAddrSpace::InitRegisters(){    int i;    for (i = 0; i < NumTotalRegs; i++)	machine->WriteRegister(i, 0);    // Initial program counter -- must be location of "Start"    machine->WriteRegister(PCReg, 0);	    // Need to also tell MIPS where next instruction is, because    // of branch delay possibility    machine->WriteRegister(NextPCReg, 4);   // Set the stack register to the end of the address space, where we   // allocated the stack; but subtract off a bit, to make sure we don't   // accidentally reference off the end!    machine->WriteRegister(StackReg, numPages * PageSize - 16);    DEBUG('a', "Initializing stack register to %d\n", numPages * PageSize - 16);}//----------------------------------------------------------------------// AddrSpace::SaveState// 	On a context switch, save any machine state, specific//	to this address space, that needs saving.////	For now, nothing!//----------------------------------------------------------------------void AddrSpace::SaveState() {}//----------------------------------------------------------------------// AddrSpace::RestoreState// 	On a context switch, restore the machine state so that//	this address space can run.////      For now, tell the machine where to find the page table.//----------------------------------------------------------------------void AddrSpace::RestoreState() {    machine->pageTable = pageTable;    machine->pageTableSize = numPages;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
丝袜国产日韩另类美女| 欧美日韩日日夜夜| 5566中文字幕一区二区电影| 欧美激情一区不卡| 看电视剧不卡顿的网站| 在线一区二区观看| 国产精品激情偷乱一区二区∴| 青青草91视频| 欧美伊人久久久久久午夜久久久久| 精品福利一二区| 水野朝阳av一区二区三区| 91天堂素人约啪| 日本一区二区三区久久久久久久久不 | 91老司机福利 在线| 精品国产免费一区二区三区四区| 亚洲第一福利视频在线| 色就色 综合激情| 综合色天天鬼久久鬼色| 粉嫩aⅴ一区二区三区四区五区| 久久综合色8888| 捆绑紧缚一区二区三区视频| 欧美一区二区女人| 亚洲福利视频一区二区| 日本电影亚洲天堂一区| 一区二区三区在线播放| 色综合久久久网| 亚洲精品高清在线| 欧美在线观看视频一区二区三区| 亚洲乱码日产精品bd| 99久久er热在这里只有精品15| 中文字幕的久久| 99久久夜色精品国产网站| 国产精品三级av在线播放| 大胆欧美人体老妇| 中文字幕一区二区三区蜜月| www.99精品| 一区二区三区不卡视频| 欧美日韩精品一区二区三区 | 欧美欧美午夜aⅴ在线观看| 午夜在线电影亚洲一区| 宅男在线国产精品| 精彩视频一区二区三区| 久久精品视频网| 91原创在线视频| 亚洲国产欧美日韩另类综合| 3atv在线一区二区三区| 国模大尺度一区二区三区| 久久久久久免费网| 99久久精品费精品国产一区二区| 亚洲欧美日韩精品久久久久| 欧美群妇大交群中文字幕| 久久精品理论片| 中文字幕成人在线观看| 欧美午夜影院一区| 精品影视av免费| 国产精品国产精品国产专区不片| 91成人免费在线| 狠狠色综合日日| 1024亚洲合集| 欧美成人精精品一区二区频| 国产成a人无v码亚洲福利| 亚洲一区二区三区四区在线| 日韩精品在线一区二区| 成人黄色电影在线| 婷婷丁香激情综合| 久久久久亚洲蜜桃| 欧美日韩一区小说| 成人高清视频在线观看| 偷拍一区二区三区| 国产免费观看久久| 这里只有精品视频在线观看| eeuss鲁一区二区三区| 日韩精品电影在线观看| 国产精品女同一区二区三区| 欧美高清激情brazzers| 粉嫩久久99精品久久久久久夜| 亚洲成人动漫一区| 亚洲欧洲无码一区二区三区| 日韩三区在线观看| 欧美亚洲高清一区二区三区不卡| 韩国在线一区二区| 日韩影院精彩在线| 亚洲欧美中日韩| 久久精品视频在线看| 日韩一区二区三区av| 91国偷自产一区二区三区成为亚洲经典 | 日韩不卡一区二区三区 | 精品国产伦一区二区三区观看体验| 99re66热这里只有精品3直播 | 日韩高清不卡一区二区三区| 中文字幕一区二区三区不卡 | 成人av网站免费| 久久99精品久久久久久动态图| 亚洲一区二区高清| 亚洲女人****多毛耸耸8| 久久精品欧美日韩精品| 欧美xfplay| 91精品国产高清一区二区三区| 在线日韩国产精品| 色呦呦国产精品| 色综合久久久久网| 色综合久久88色综合天天| 99久久夜色精品国产网站| 成人免费毛片aaaaa**| 久草这里只有精品视频| 视频一区二区不卡| 日韩国产精品大片| 午夜电影久久久| 日韩高清国产一区在线| 日日摸夜夜添夜夜添国产精品 | 欧美一区二区三区男人的天堂| 欧美亚洲另类激情小说| 在线免费观看日本欧美| 欧美视频一区二区三区| 色噜噜夜夜夜综合网| 欧美亚洲综合一区| 欧美日韩在线一区二区| 911精品国产一区二区在线| 欧美理论在线播放| 欧美一级黄色大片| 欧美不卡一区二区三区| 精品处破学生在线二十三| 久久天天做天天爱综合色| 国产午夜精品福利| 成人欧美一区二区三区1314| 亚洲欧美日韩国产综合在线 | 亚洲视频一区二区在线| 一区二区激情视频| 婷婷开心激情综合| 精品一区二区在线看| 高清不卡一二三区| 色综合天天性综合| 69堂精品视频| 日本一区二区三区四区| 亚洲精品午夜久久久| 日产欧产美韩系列久久99| 国产在线精品一区二区夜色| caoporen国产精品视频| 欧美性大战久久| 精品国产乱码久久久久久浪潮| 国产精品乱码久久久久久| 一区二区三区产品免费精品久久75| 一级日本不卡的影视| 精品一区二区三区久久| 91视频免费观看| 91精品国产综合久久精品图片| 日本一区二区三区在线不卡| 亚洲国产aⅴ天堂久久| 国产成人精品免费一区二区| 欧美中文字幕一区二区三区| 亚洲精品一区二区三区蜜桃下载| 亚洲视频在线一区| 久久精品免费看| 日本高清不卡视频| 2020国产精品久久精品美国| 亚洲免费在线视频一区 二区| 美美哒免费高清在线观看视频一区二区| 国产传媒一区在线| 欧美色倩网站大全免费| 欧美激情在线免费观看| 免费观看一级欧美片| 99精品久久只有精品| 久久综合色一综合色88| 亚洲成人tv网| 91丝袜呻吟高潮美腿白嫩在线观看| 欧美一级日韩免费不卡| 尤物视频一区二区| 国产麻豆精品一区二区| 在线不卡一区二区| 亚洲三级在线播放| 国产精品1024| www国产精品av| 日本欧美在线看| 欧美日韩久久久久久| 亚洲欧美另类久久久精品2019| 国产精品一区二区久激情瑜伽| 91麻豆精品91久久久久同性| 亚洲激情五月婷婷| 成人免费高清在线| 国产欧美精品一区aⅴ影院| 秋霞电影一区二区| 欧美精品一卡二卡| 一区二区三区四区高清精品免费观看| 国产精品66部| 久久综合久久综合久久| 久久国产剧场电影| 日韩亚洲欧美在线观看| 日韩国产在线观看一区| 欧美日韩高清一区二区不卡| 亚洲欧洲中文日韩久久av乱码| 国产91在线|亚洲| 中文字幕巨乱亚洲| 岛国精品在线播放| 中文字幕在线观看一区二区| 国产精品 日产精品 欧美精品| 2020国产精品| 国产成人超碰人人澡人人澡| 中文字幕欧美日韩一区| 不卡av在线网| 椎名由奈av一区二区三区|