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

正文內(nèi)容

geekos操作系統(tǒng)的研究與實(shí)現(xiàn)操作系統(tǒng)課程設(shè)計-文庫吧在線文庫

2025-07-27 06:16上一頁面

下一頁面
  

【正文】 ===================//需在此文件各函數(shù)前增加一個函數(shù),此函數(shù)的功能是按給定的大小創(chuàng)建一個用戶級進(jìn)程上下文,具體實(shí)現(xiàn)如下://函數(shù)功能:按給定的大小創(chuàng)建一個用戶級進(jìn)程上下文static struct User_Context* Create_User_Context(ulong_t size){ struct User_Context * UserContext。, size)。 //新建一個數(shù)據(jù)段 Init_Data_Segment_Descriptor( amp。 } return 0。// Free(userContext)。}int Load_User_Program(char *exeFileData, ulong_t exeFileLength,struct Exe_Format *exeFormat, const char *mand, struct User_Context **pUserContext){ //TODO(Load a user executable into a user memory space using segmentation)。 i exeFormatnumSegments。//獲取參數(shù)塊信息 size = Round_Up_To_Page(maxva) + DEFAULT_USER_STACK_SIZE。exeFormatsegmentList[i]。//成功}//將用戶態(tài)的進(jìn)程復(fù)制到內(nèi)核緩沖區(qū)bool Copy_From_User(void* destInKernel, ulong_t srcInUser, ulong_t bufSize){ //TODO(Copy memory from user buffer to kernel buffer)。 return true。//DS選擇子 Attach_User_Context(kthread, userContext)。 //中斷號(0) //初始化通用寄存單元,將ESI用戶傳遞參數(shù)塊地址 Push(kthread, 0)。 /* ds */ Push(kthread, dsSelector)。} ================ =================//需在此文件別的函數(shù)前增加一個函數(shù),函數(shù)名為Copy_User_String,它被函數(shù)Sys_PrintString調(diào)用,具體實(shí)現(xiàn)如下:static int Copy_User_String(ulong_t uaddr, ulong_t len, ulong_t maxLen, char **pStr){ int rc = 0。 goto fail。 int rc = 0。}static int Sys_GetKey(struct Interrupt_State* state){ //TODO(GetKey system call)。row, amp。}static int Sys_Spawn(struct Interrupt_State* state){ //TODO(Spawn system call)。mand)) != 0) {//從用戶空間復(fù)制用戶命令 goto fail。 if (mand != 0) Free(mand)。 Disable_Interrupts()。}=========================================2. 編譯GeekOS項目project21) cd /.../2) 執(zhí)行 make depend build] make depend3) 執(zhí)行 make build] make 成功之后在build 。最初的想法是在虛擬機(jī)掛載U盤,并上網(wǎng)下載了不少資料,但以失敗告終。最后,看了很久的課本,把一些基本的函數(shù)搞清楚了,程序運(yùn)行的過程感覺明了許多。之前學(xué)習(xí)到的都是課本上概念性的東西,當(dāng)要自己做一個東西的時候就覺得不知從何下手了,看老師給的PPT講解Geekos內(nèi)核、bochs安裝、make的工作原理、makefile的使用等,也還是不怎么清楚。$ cd $ ./configure$ cd $ make$ cd $ make install之后出現(xiàn)了make[1]: *** [allrecursive]}================= ==================static void Spawn_Init_Process(void){ //TODO(Spawn the init process)。 struct Kernel_Thread *kthread = Lookup_Thread(stateebx)。//得到進(jìn)程名稱和用戶命令后便可生成一個新進(jìn)程 if (rc == 0) {//若成功則返回新進(jìn)程ID號 KASSERT(process != 0)。 //用戶命令 struct Kernel_Thread *process。col, sizeof(int))) return 1。 return 0。buf)) != 0) goto done。fail: return rc。 if (0 == str){ rc = ENOMEM。 struct Kernel_Thread* kthread = Create_Thread(PRIORITY_USER, detached)。 /* edx */ Push(kthread, userContextargBlockAddr)。 //Eflags Push(kthread, csSelector)。} ================= ===============添加頭文件 include geekos///創(chuàng)建一個用戶進(jìn)程/*static*/ void Setup_User_Thread(struct Kernel_Thread* kthread, struct User_Context* userContext){ //TODO(Create a new thread to execute in user mode)。 return true。 userContextargBlockAddr = argBlockAddr。//按相應(yīng)大小創(chuàng)建一個進(jìn)程 if (userContext == 0)//如果為核心態(tài)進(jìn)程 return 1。 /* FIXME: range check */ if (topva maxva) maxva = topva。//進(jìn)程數(shù)目 ulong_t argBlockSize。 //釋放內(nèi)存空間 Free(userContextmemory)。s LDT descriptor */// Free_Segment_Descriptor(userContextldtDescriptor)。 //將引用數(shù)清0 UserContextrefCount = 0。 //初始化段描述符 Init_LDT_Descriptor(UserContextldtDescriptor, UserContextldt, NUM_USER_LDT_ENTRIES)。 //為核心態(tài)進(jìn)程 else goto fail。//為用戶態(tài)進(jìn)程時則切換地址空間 esp0 = ((ulong_t) kthreadstackPage) + PAGE_SIZE。 static struct User_Context* s_currentUserContext。/* 返回核心進(jìn)程的指針 */ *pThread = process。 } if((rc = Load_User_Program(exeFileData, exeFileLength, amp。//指向Kernel_Thread *pThread的指針 struct Exe_Format exeFormat。(7)src/GeekOS/”文件中主要是實(shí)現(xiàn)用戶程序要求內(nèi)核進(jìn)行服務(wù)的一些系統(tǒng)調(diào)用函數(shù)定義。(4)src/GeekOS/。 segment++。 struct Exe_Segment * segment= exeFormatsegmentList。 Set_Current_Attr(ATTRIB(BLACK, GRAY))。 Init_TSS()。\r39。 //低8位為Ascii碼 if( (keycode amp。再根據(jù)傳遞的中斷向量查找并調(diào)用相關(guān)的中斷處理程序,并實(shí)現(xiàn)調(diào)度進(jìn)程的選擇。VGABIOSlgpllastest文件模擬bochs顯示系統(tǒng)的BIOS。(3)在VMware虛擬機(jī)上的linux環(huán)境下對GeekOS源文件進(jìn)行編譯和鏈接,;(4)下載并安裝系統(tǒng)仿真工具Bochs;(5)$ ./configure 配置bochs的文件(6)make 工具無論是在Linux還是在UNIX環(huán)境中,make都是一個非常重要的系統(tǒng)開發(fā)工具。多啟動系統(tǒng)在一個時刻只能運(yùn)行一個系統(tǒng),在系統(tǒng)切換時需要重新啟動機(jī)器。要求用戶實(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ù)。(4) 在bochs中運(yùn)行GeekOS系統(tǒng)顯示結(jié)果。2. Project1:熟悉ELF文件格式,了解GeekOS系統(tǒng)如何將ELF格式的可執(zhí)行程序裝入到內(nèi)存,建立內(nèi)核進(jìn)程并運(yùn)行的實(shí)現(xiàn)技術(shù)。2. Project1(1) 修改/geekos/:在函數(shù)Parse_ELF_Executable( )中添加代碼,分析ELF格式的可執(zhí)行文件(包括分析得出ELF文件頭、程序頭,獲取可執(zhí)行文件長度,代碼段、數(shù)據(jù)段等信息),并填充Exe_Format數(shù)據(jù)結(jié)構(gòu)中的域值。Setup_User_Thread()函數(shù)的功能是為進(jìn)程初始化內(nèi)核堆棧,堆棧中是為進(jìn)程首次進(jìn)入用戶態(tài)運(yùn)行時設(shè)置處理器狀態(tài)要使用的數(shù)據(jù)。(2)VMware WorkstationVMware Workstation 是一款功
點(diǎn)擊復(fù)制文檔內(nèi)容
法律信息相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1