freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

geekos操作系統(tǒng)的研究與實(shí)現(xiàn)操作系統(tǒng)課程設(shè)計(jì)-文庫(kù)吧資料

2025-06-30 06:16本頁(yè)面
  

【正文】 ory, size / PAGE_SIZE, USER_PRIVILEGE )。 //新建一個(gè)LDT選擇子 UserContextldtSelector = Selector(KERNEL_PRIVILEGE, true, Get_Descriptor_Index(UserContextldtDescriptor))。 if (0 == UserContextldtDescriptor) goto fail。 UserContextsize = size。\039。 //內(nèi)存為空 if (0 == UserContextmemory) goto fail。 //為用戶態(tài)進(jìn)程 if (UserContext != 0) UserContextmemory = Malloc(size)。 size = Round_Up_To_Page(size)。//設(shè)置內(nèi)核堆棧指針/* New user context is active */ s_currentUserContext = userContext。 //if (userDebug) // Print(S[%lx]\n, esp0)。 Switch_To_Address_Space(userContext)。 } if (userContext != s_currentUserContext) { ulong_t esp0。//指向User_Conetxt的指針,并初始化為準(zhǔn)備切換的進(jìn)程 KASSERT(!Interrupts_Enabled())。 /* last user context used */ //extern int userDebug。}//切換至用戶上下文void Switch_To_User_Context(struct Kernel_Thread* kthread, struct Interrupt_State* state){ //TODO(Switch to a new user address space, if necessary)。//釋放內(nèi)存 if (userContext != 0) Destroy_User_Context(userContext)。 return rc。 rc = processpid。 if (process != 0) { //不是核心級(jí)進(jìn)程(即為用戶級(jí)進(jìn)程) KASSERT(processrefCount == 2)。 exeFileData = 0。 goto fail。exeFormat, mand, amp。 goto fail。 } if((rc = Parse_ELF_Executable(exeFileData, exeFileLength, amp。exeFileLength)) != 0 ) {//調(diào)用Read_Fully函數(shù)將名為program的可執(zhí)行文件全部讀入內(nèi)存緩沖區(qū) Print(Failed to Read File %s!\n, program)。//調(diào)用Parse_ELF_Executable函數(shù)得到的可執(zhí)行文件信息 if ((rc = Read_Fully(program, (void**) amp。//指向User_Conetxt的指針 struct Kernel_Thread *process = 0。//保存在內(nèi)存緩沖中的用戶程序可執(zhí)行文件 ulong_t exeFileLength。 int rc。 要求用戶實(shí)現(xiàn)的有Sys_Exit()函數(shù)、Sys_PrintString()函數(shù)、Sys_GetKey()、Sys_SetAttr()、Sys_GetCursor()、Sys_PutCursor()、Sys_Spawn()函數(shù)、Sys_Wait()函數(shù)和Sys_GetPID( )函數(shù)。(6)src/GeekOS/。 Setup_User_Thread()函數(shù)的功能是為進(jìn)程初始化內(nèi)核堆棧,堆棧中是為進(jìn)程首次進(jìn)入用戶態(tài)運(yùn)行時(shí)設(shè)置處理器狀態(tài)要使用的數(shù)據(jù)。 Copy_From_User()和Copy_To_User()函數(shù)的功能是在用戶地址空間和內(nèi)核地址空間之間復(fù)制數(shù)據(jù),在分段存儲(chǔ)器管理模式下,只要段有效,調(diào)用memcpy函數(shù)就可以實(shí)現(xiàn)這兩個(gè)函數(shù)的功能。 Destroy_User_Context()函數(shù)的功能是釋放用戶態(tài)進(jìn)程占用的內(nèi)存資源。該函數(shù)的實(shí)現(xiàn)要求和項(xiàng)目1相同。(2)src/GeekOS/(),調(diào)度程序在執(zhí)行一個(gè)新的進(jìn)程前調(diào)用該函數(shù)以切換用戶地址空間。 return 0。 } exeFormatnumSegments = hdrphnum。 phdr++。 segmentstartAddress = phdrvaddr。 i++) { segmentoffsetInFile = phdroffset。 for( i=0。 programHeader *phdr=(programHeader *)(exeFileData + hdrphoff)。}(2)編譯文件終端打開(kāi) $ cd project0/build 的目錄: 在其目錄下:$ make $ make depend 編譯,生成文件 (3)建立配置文件bochsrc終端打開(kāi) $ cd project0/build 的目錄:建立配置文件: $ gedit .bochs修改其內(nèi)容如下:vgaromimage: file=$BXSHARE/VGABIOSlgpllatestromimage: file=$BXSHARE/BIOSbochslatest, address=0xf0000megs: 8boot: afloppya: 1_44=, status=insertedfloppya: 1_44=, status=insertedlog: ./keyboard_serial_delay: 200floppy_mand_delay: 500vga_update_interval: 300000ips: 1000000mouse: enabled=0private_colormap: enabled=0i440fxsupport: enabled=0(4)運(yùn)行在build目錄下輸入:$ bochs –f bochsrc 2. Project1項(xiàng)目的具體實(shí)現(xiàn)(1)終端打開(kāi) $include geekos/include geekos/include geekos/include geekos/ /* for debug Print() statements */include geekos/include geekos/include geekos/include geekos/int Parse_ELF_Executable(char *exeFileData, ulong_t exeFileLength,struct Exe_Format *exeFormat){ int i。project0,0,PRIORITY_NORMAL,false)。 struct Kernel_Thread *thread。 Print(Wele to GeekOS!\n)。Init_Keyboard()。 Init_Traps()。 Init_Interrupts()。 Init_CRC32()。 Init_Screen()。 : asciiCode)。) ? 39。 }else { Print(%c,(asciiCode==39。) //按下Ctrl鍵 { Print(\nBYE!\n)。 asciiCode==39。 KEY_CTRL_FLAG)==KEY_CTRL_FLAG amp。 0xff。 KEY_SPECIAL_FLAG) || (keycode amp。 while(1) { if( Read_Key(amp。 項(xiàng)目設(shè)計(jì)的實(shí)現(xiàn)1. Project0項(xiàng)目的具體實(shí)現(xiàn)(1)include geekos/include geekos/include geekos/include geekos/include geekos/include geekos/include geekos/include geekos/include geekos/include geekos/include geekos/void project0(){ Print(To Exit hit Ctrl + d.\n)。3. Project2與priject1一樣,并與用戶程序一起編譯。以及一些可選輔助信息,如調(diào)試信息、硬件信息等??蓤?zhí)行文件是通過(guò)源程序被編譯成目標(biāo)文件,多給目標(biāo)文件連接生成的,然后被加載到內(nèi)存運(yùn)行。其中, Wait_For_Key(void),循環(huán)等待一個(gè)鍵盤(pán)事件,然后返回一個(gè)16位的數(shù)據(jù) Keycode型的, 。其中BIOSbochslastest文件模擬bochs硬件的BIOS。(9)GeekOS系統(tǒng)編譯和仿真成功。 它就是字符操作方式下的項(xiàng)目管理工具。利用make工具,可以將大型的開(kāi)發(fā)項(xiàng)目分解成為多個(gè)更易于管理的模塊,對(duì)于一個(gè)包括幾百個(gè)源文件的應(yīng)用程序,使用make和makefile工具就可以簡(jiǎn)潔明快地理順各個(gè)源文件之間紛繁復(fù)雜的相互關(guān)系。2. 開(kāi)發(fā)環(huán)境的構(gòu)建(1)下載并安裝VMware虛擬機(jī);(2)在VMware虛擬機(jī)上安裝CentOS版本的linux操作系統(tǒng)。目前, Bochs 可以模擬 386, 486, Pentium Pro 或者 AMD64 CPU 。安裝在VMware操作系統(tǒng)性能上比直接安裝在硬盤(pán)上的系統(tǒng)低不少,因此,比較適合學(xué)習(xí)和測(cè)試。VMWare是真正“同時(shí)”運(yùn)行,多個(gè)操作系統(tǒng)在主系統(tǒng)的平臺(tái)上,就象標(biāo)準(zhǔn)Windows應(yīng)用程序那樣切換。與“多啟動(dòng)”系統(tǒng)相比,VMWare采用了完全不同的概念。(2)VMware WorkstationVMware Workstation 是一款功能強(qiáng)大的桌面虛擬計(jì)算機(jī)軟件,提供用戶可在單一的桌面上同時(shí)運(yùn)行不同的操作系統(tǒng),和進(jìn)行開(kāi)發(fā)、測(cè)試 、部署新的應(yīng)用程序的最佳解決方案。學(xué)生可以在Linux或Unix環(huán)境下對(duì)其進(jìn)行功能擴(kuò)充,也可以在windows下使用Cygwin工具進(jìn)行開(kāi)發(fā),其主要特點(diǎn)是:簡(jiǎn)單、實(shí)用、易懂,便于學(xué)生們理解
點(diǎn)擊復(fù)制文檔內(nèi)容
法律信息相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1