提供高质量的essay代写,Paper代写,留学作业代写-天才代写

首頁 > > 詳細

c/c++編程設計代做、代寫program程序、c++編程調試代做數據庫SQL|調試Matlab程序

Tasks
The goal of this assignment is implement demand-paged virtual memory. The backing store used is a file called SWAP and it can be accessed using the NACHOS OpenFile class.
The main programming tasks of this project are:
?Task 1. Enhance the page fault handler of the given starter code by modifying vm/virtualmemorymanager.cc to incorporate a page replacement policy using the second change algorithm that approximates LRU.
?Task 2. The starter code uses a field "locationOnDisk" for each page table entry defined in machine/translate.h which is the offset of a virtual page stored in SWAP. In practice, the number of bits allocated to a page table entry is limited. This task is to remove this field from machine/translate.h and implement such a functionality in addrspace.h so that each process space maintains a mapping from each virtual page to a SWAP offset. The revised translate.h is included in the released stater code and is called machine/translate.h.TOREPLACE. You will need to modify userprog/addrspace.h and userprog/addrspace.cc in addition to vm/virtualmemorymanager.cc.

Starter Code and Testing
Full project 3 starter code is here. The starter code has already included many functions for you to accomplish Project 3. To learn the execution flow in handling a page fault, three most relevant files are: vm/virtualmemorymanager.cc, userprog/exception.cc, and userprog/addrspace.cc.
When you have the full starter tar file, to compile, type "make" under the main directory "p3-starter". That should go to vm directory to compile Nachos source code, and go to test directory to compile the test c programs. The nachos binary is produced in vm directory.
In test directory, type "../vm/nachos -x testvmfork", you will see the current code works and prints some trace file. You can type "../vm/nachos -x testvmfork > output" to see only the expected output.
You should test your code under various conditions of system load, including one process with an address space larger than physical memory, several concurrently running processes with combined address spaces larger than physical memory, and random process switching (random yielding). The c test programs under this test directory will be used for gradescope.com tests. Some of them are working already. Check the README file under that directory.
The function that needs to be modified for Task 1 is: VirtualMemoryManager::swapPageIn() in vm/virtualmemorymanager.cc. This function loads the desired physical page from SWAP to memory. This physical page corresponds a virtual page that contains the input virtual address being accessed. Your task is to add the second-chance page replacement policy and make sure a dirty page is copied back to the SWAP area.
Click here for Q/A on the starter code and project suggestions.

Report/code submission
For task 1, please submit to Project 3A; for task 2, please submit to Project 3B.
Submission file list for Task 1 (it is expected that your passes all tests under the test directory without revising machine/translate.h)
Submit the following 2 files to Project 3A:
?vm/virtualmemorymanager.cc
?P3_report
In P3_report, describe your system design, which portions of the assignment is completed, and for the ones that are incomplete, what is their current status. When you just submit something that does not work and give no explanations, expect to receive no credit.
Submission file list for Task 2 (it is expected that your code passes all tests under the test directory with revised machine/translate.h after removing field locationOnDisk)
Submit the following 3 files to Project 3B:
?vm/virtualmemorymanager.cc
?userprog/addrspace.cc
?userprog/addrspace.h

Additional Information
In this assignment, we will leverage the following three bits maintained in each page table entry defined in p3-starter/machine/translate.h: valid, dirty, and use bits.
?The valid bit indicates if a page is resident in physical memory or not. If the valid bit in a particular page table entry is set, the MIPS machine assumes that the corresponding virtual page is loaded into physical memory in the physical page frame specified by the physicalPage field. Whenever the program generates an access to that virtual page, the MIPS machine accesses the physical page. If the valid bit is not set, the system generates a page fault exception whenever the program accesses that virtual page. Your exception handler will then find a free physical page frame, read the page in from the backing store SWAP to that physical page frame, update the page table to reflect the new virtual to physical mapping, and restart the program. The MIPS machine will then resume the execution of the program at the instruction that generated the fault. This time the access should go through, since the page has been loaded into physical memory.
?The dirty bit indicates if this page has been modified or not. To find a free frame, your page fault handler may need to eject an in-memory victim page. If the ejected victim page has been modified in the physical memory indicated by the dirty bit in the corresponding page table entry, the page fault handling code must write the page out to the backing store before reading the accessed page into its physical page frame .
?The use bit indicates if this page has been recently accessed. On a page fault, the kernel must decide which page to replace; ideally, it will throw out a page that will not be referenced for a long time, keeping pages in memory those that are soon to be referenced. You are asked to implement the second chance algorithm leveraging this use bit. This bit is set to TRUE every time a user program reads or writes this page. The second chance algorithm follows a clockwise order to find the next victim whose use bit is FALSE. If it sees a page with the use bit value TRUE, it gives this page the second chance to stay, and the use bit of this page should be set as FALSE.

聯系我們
  • QQ:1067665373
  • 郵箱:1067665373@qq.com
  • 工作時間:8:00-23:00
  • 微信:Badgeniuscs
熱點文章
程序代寫更多圖片

聯系我們 - QQ: 1067665373 微信:Badgeniuscs
? 2021 uk-essays.net
程序代寫網!

在線客服

售前咨詢
售后咨詢
微信號
Essay_Cheery
微信
全优代写 - 北美Essay代写,Report代写,留学生论文代写作业代写 北美顶级代写|加拿大美国论文作业代写服务-最靠谱价格低-CoursePass 论文代写等留学生作业代做服务,北美网课代修领导者AssignmentBack 北美最专业的线上写作专家:网课代修,网课代做,CS代写,程序代写 代码代写,CS编程代写,java代写北美最好的一站式学术代写服务机构 美国essay代写,作业代写,✔美国网课代上-最靠谱最低价 美国代写服务,作业代写,CS编程代写,java代写,python代写,c++/c代写 代写essay,作业代写,金融代写,business代写-留学生代写平台 北美代写,美国作业代写,网课代修,Assignment代写-100%原创 北美作业代写,【essay代写】,作业【assignment代写】,网课代上代考