EssayGhost Assignment代写,Essay代写,网课代修,Quiz代考

EssayGhost-Essay代写,作业代写,网课代修代上,cs代写代考

一站式网课代修,论文代写

高质量的Assignment代写、Paper代写、Report代写服务

EG1hao
网课代修代上,cs代写代考
Java代写
您的位置: 主页 > 编程案例 > Java代写 >
代写Java:java nachos代写 | Project 3: Demand Paging | OS代写 - Java代写
发布时间:2021-07-25 20:49:06浏览次数:
Begin testing with a running program that does not use exec. When you start implementing swapping, you can control the number of pages (and thus, indirectly, the necessity to swap) with the -mparamater to nachos:% nachos -m 8 -x swap4.coffor by modifying nachos.conf in the proj3 subdirectory. Your implementation should not depend upon any particular number of physical pages, but we will always test with at least four physical pages.Implement a method to print memory state, and use it liberally when hunting for errors. debug()and Lib.assertTrue() will also continue to be helpful.Fall 2018Due: Wednesday, December 12 at 11:59pm (No extensions)In project 2, each process had a page table that was initialized with physical pages and their contents when the process was created. In project 3, you will be implementing a more sophisticated memory management system where physical pages are allocated on demand and pages that cannot fit in physical memory will be stored on disk.BackgroundYou will implement and debug virtual memory in two steps. First, you will implement demand paging using page faults to dynamically initialize process virtual pages on demand, rather than initializing page frames for each process in advance at exec time as you did in project 2. Next, you will implement page replacement, enabling your kernel to evict a virtual page from memory to free up a physical page frame to satisfy a page fault.Demand paging and page replacement together allow your kernel to overbook memory by executing more processes than would fit in machine memory at any one time, using page faults to multiplex the available physical page frames among the larger number of process virtual pages. When implemented correctly, virtual memory is undetectable to user programs unless they monitor their own performance.You project will implement the following functionality:Demand Paging. Pages will be in physical memory only as needed. When no physical pages are free, it is necessary to free pages, possibly evicting pages to swap.Lazy Loading. To fulfill the spirit of demand paging, processes should load no pages when started, and depend on demand paging to provide even the first instruction they execute. When you are done, loadSectionswill not allocate even a single page.Page Pinning. At times it will be necessary to pin a page in memory, making it temporarily impossible to evict.The changes you make to Nachos will be in these two files in the vm directory:java— an extension of UserKerneljava— an extension of UserProcessYou will notice that these classes inherit from UserKernel and UserProcess. Try to depend on the implementation of your base classes as much as possible. Note that, with readVirtualMemory and writeVirtualMemory, very little code needs to know the details of virtual addressing.For example, you should not have to change any of the primary code which serviced the read syscall. That said, you should not change the base classes in any way that makes them dependent on project 3. It should still be possible to run nachos from the proj2 subdirectory to run user-level programs.You will compile and run the project in the proj3 directory. Unlike the first two projects, you will not need to learn any new Nachos modules and will continue to use functionality that you became familiar with in project 2. Before starting your implementation, also see the Tips section below.Design AspectsCentral to this project are the following design aspects:TranslationEntry bits.You will extend your kernel s handling of the page tables to use three special bits in each TranslationEntry (TE):Valid bit: Nachos will set or clear the valid bit in each TE to tell the CPU which virtual pages are resident in memory (a valid translation) and which are not resident (an invalid translation). If a user process references an address for which the TE is marked invalid, then the CPU raises a page fault exception and transfers control to the Nachos exception handler.Used bit: The CPU sets the used bit (aka reference bit) in the TE to pass information to Nachos about page access patterns. If a virtual page is referenced by a process, the machine sets the corresponding TE reference bit to inform the kernel that the page is active. Once set, the reference bit remains set until the kernel clears it.Dirty bit: The CPU sets the dirty bit in the TE whenever a process executes a store (write) to the corresponding virtual page. This step informs the kernel that the page is dirty; if the kernel evicts the page from memory, then it must first clean the page by writing its contents to disk. Once set, the dirty bit remains set until the kernel clears it.

所有的编程代写范围:essayghost为美国、加拿大、英国、澳洲的留学生提供C语言代写、代写C语言、C语言代做、代做C语言、数据库代写、代写数据库、数据库代做、代做数据库、Web作业代写、代写Web作业、Web作业代做、代做Web作业、Java代写、代写Java、Java代做、代做Java、Python代写、代写Python、Python代做、代做Python、C/C++代写、代写C/C++、C/C++代做、代做C/C++、数据结构代写、代写数据结构、数据结构代做、代做数据结构等留学生编程作业代写服务。