Nachos Project Assignment 3

Slides:



Advertisements
Similar presentations
Tutorial 8 March 9, 2012 TA: Europa Shang
Advertisements

CS 140 Project 3 Virtual Memory
CSCC69: Operating Systems
Chapter 9 Virtual Memory Bernard Chen 2007 Spring.
Chapter 3 Memory Management. 3.1 From Programs To Address Space 3 steps to run the programs of an application – A Compiler translates the source code.
CGS 3763 Operating Systems Concepts Spring 2013 Dan C. Marinescu Office: HEC 304 Office hours: M-Wd 11: :30 AM.
CS 153 Design of Operating Systems Spring 2015
CAS3SH3 Final Review. The Final Tue 28 th, 7pm, IWC3 closed book, closed note Non-comprehensive: memory management, storage & file system Types of questions:
Chapter 101 Virtual Memory Chapter 10 Sections and plus (Skip:10.3.2, 10.7, rest of 10.8)
03/26/2010CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying an earlier.
Memory Management (II)
Virtual Memory Review CSE 121 Spring 2003 Keith Marzullo.
Memory Management Policies: UNIX
Memory Management April 28, 2000 Instructor: Gary Kimura.
Answers to the VM Problems Spring First question A computer has 32 bit addresses and a virtual memory with a page size of 8 kilobytes.  How many.
7/3/20151 Announcement (No deadline extension for the rest of quarter) Project 2 final deadline is Tuesday midnight May 19 Project 0 resubmission for autograding.
CSCI2413 Lecture 6 Operating Systems Memory Management 2 phones off (please)
EECS 370 Discussion 1 SMBC. EECS 370 Discussion Exam 2 Solutions posted online Will be returned in next discussion (12/9) – Grades hopefully up on CTools.
Memory Management ◦ Operating Systems ◦ CS550. Paging and Segmentation  Non-contiguous memory allocation  Fragmentation is a serious problem with contiguous.
Virtual Memory Chantha Thoeun. Overview  Purpose:  Use the hard disk as an extension of RAM.  Increase the available address space of a process. 
Virtual Memory.
CS 346 – Chapter 8 Main memory –Addressing –Swapping –Allocation and fragmentation –Paging –Segmentation Commitment –Please finish chapter 8.
CS1550 Assignment 5 Multiprogramming Implementation notes Matt Craven.
Nachos Projects Overview and Project 1 TA : 吳哲榮 2010/10/21.
Nachos Projects Overview and Project 1 TA : 王映智 2007/10/24.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
© 2004, D. J. Foreman 1 Virtual Memory. © 2004, D. J. Foreman 2 Objectives  Avoid copy/restore entire address space  Avoid unusable holes in memory.
VIRTUAL MEMORY By Thi Nguyen. Motivation  In early time, the main memory was not large enough to store and execute complex program as higher level languages.
Nachos Project Assignment 2 CPU scheduling
Nachos Project 4 Lecturer: Hao-Hua Chu TA: Chun-Po Wang (Artoo) Date: 2008/10/25.
Virtual Memory. Virtual Memory: Topics Why virtual memory? Virtual to physical address translation Page Table Translation Lookaside Buffer (TLB)
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Nachos Project 3.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 9: Virtual Memory.
Nachos Project Assignment 1 Multi-programming TA: Hung-Leng Chen.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts Essentials – 9 th Edition Chapter 9: Virtual-Memory Management.
Operating Systems Lesson 5. Plan Memory Management ◦ Memory segments types ◦ Processes & Memory ◦ Virtual Memory ◦ Virtual Memory Management ◦ Swap File.
Silberschatz, Galvin and Gagne  Operating System Concepts Virtual Memory Virtual memory – separation of user logical memory from physical memory.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Virtual Memory Implementation.
1 Virtual Memory. Cache memory: provides illusion of very high speed Virtual memory: provides illusion of very large size Main memory: reasonable cost,
Lecture 19 Virtual Memory Demand Paging. Background Virtual memory – separation of user logical memory from physical memory. –Only part of the program.
Consider the Java code snippet below. Is it a legal use of Java synchronization? What happens if two threads A and B call get() on an object supporting.
Pintos project 3: Virtual Memory Management
Nachos Instructional OS: Part 3 CS 170, Tao Yang, Fall 2011.
CSCI 156: Lab 11 Paging. Our Simple Architecture Logical memory space for a process consists of 16 pages of 4k bytes each. Your program thinks it has.
1 Lecture 8: Virtual Memory Operating System Fall 2006.
1 Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples (not covered.
10.1 Chapter 10: Virtual Memory Background Demand Paging Process Creation Page Replacement Allocation of Frames Thrashing Operating System Examples.
1 Contents Memory types & memory hierarchy Virtual memory (VM) Page replacement algorithms in case of VM.
Nachos Project Assignment 3 Memory Management
VIRTUAL MEMORY.
Vivek Seshadri 15740/18740 Computer Architecture
Paging.
Virtual Memory Chapter 7.4.
Memory Caches & TLB Virtual Memory
Chapter 9: Virtual Memory
COMBINED PAGING AND SEGMENTATION
Lecture 28: Virtual Memory-Address Translation
Chapter 9: Virtual-Memory Management
Lecture 27: Virtual Memory
Paging Lecture November 2018.
Operating Systems Lecture November 2018.
Module IV Memory Organization.
CPSC 457 Operating Systems
Contents Memory types & memory hierarchy Virtual memory (VM)
Virtual Memory Prof. Eric Rotenberg
COMP3221: Microprocessors and Embedded Systems
Nachos Project Assignment 2 CPU scheduling
Clock Algorithm Example
Presentation transcript:

Nachos Project Assignment 3 Virtual Memory TA:吳哲榮

Assignment Test case Both test programs are greater than whole memory. /test/matmult.c /test/sort.c Both test programs are greater than whole memory. Goal – run this two programs concurrently, and get the correct result. Under RR scheduling.

Hints File system – swap space Add some table to help you record all the information. PageTable FrameTable SwapTable Catch PageFaultException Construct your Virtual Memory Manager

Hints swap = new SynchDisk All headers you need to see are in /filesys/ Use this disk to be the swap space

Hints PageTable FrameTable SwapTable one pagetable per process Record every physical page information SwapTable Record every sector’s information in swap.

Hints PageTable TranslationEntry{ decide your virtual page number unsigned int virtualPage; unsigned int physicalPage; bool valid; //whether in physical memory bool readOnly; bool use; //whether been referenced or modified bool dirty; //whether been modified }

Hints FrameTable FrameInfoEntry { bool valid; bool lock; Each frame represent one physical page FrameInfoEntry { bool valid; bool lock; unsigned int vpn; //which virtual page is in this frame AddrSpace *addrSpace; //which process is using this frame };

Hints SwapTable FrameInfoEntry { bool valid; //whether entry been used The number of entries in swapTable is the same as swap sectors. Each entry represent one frame in the disk. FrameInfoEntry { bool valid; //whether entry been used bool lock; unsigned int vpn; //which virtual page is in this entry AddrSpace *addrSpace;//which process is using this entry }; Access virtual memory in the disk by kernel->swap->WriteSector and kernel->swap->ReadSector.

Hints Virtual Address Map to Physical Address Physical Address = pageTable[(virtual address / PageSize)].physicalPage * PageSize + (virtual address % PageSize)

Modify Addrspace::Load(char *fileName) Hints Modify Addrspace::Load(char *fileName) load one page once 1.acquire one page When all physical memory frames are occupied, please design a page replacement method to get a frame. 2.Map virtual address to physical address Invoke ‘executable->ReadAt(&(kernel->machine->mainMemory[physical address]), sizeToLoadNow, inFileAddr)’

Virtual Memory Manager Public: int TranslateAddr(AddrSpace *space, int virtAddr); // translate virtual address to physical address bool AcquirePage(AddrSpace *space, unsigned int vpn); // get a frame void ReleasePage(AddrSpace *space, unsigned int vpn); // release a page void PageFaultHandler(void); // manage page fault

PageFaultHandler PageFaultHandler Put the pages in swaptable into frametable. When all physical memory frames are occupied, please design a page replacement method to get a frame.

Assignment Requirements Assignment Report (1/20 on the class) How you modified Nachos to make it support virtual memory – important code segments Test cases and demonstration to show the correctness of your design Everything you consider important

Hand in your reports. Please compress following with zip. source code Final report power-point file tar zcvf b99901000.tar.gz E-mail your code and presentation files(report) to TA (b93901098@ntu.edu.tw). Deadline: 2011/1/20 23:59

Grading Policy Correct Result 30% Report 70%