Nachos Project 3.

Slides:



Advertisements
Similar presentations
Chapter 4 Memory Management Basic memory management Swapping
Advertisements

Tutorial 8 March 9, 2012 TA: Europa Shang
CS 140 Project 3 Virtual Memory
Memory management.
Chapter 9 Virtual Memory Bernard Chen 2007 Spring.
Case Study: Virtual Memory in UNIX Reference – Maurice J.Bach, The Design of the UNIX Operating System Terminology - Physical Memory (Main Memory) Secondary.
Virtual Memory. Hierarchy Cache Memory : Provide invisible speedup to main memory.
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.
CS 153 Design of Operating Systems Spring 2015
Memory Management Design & Implementation Segmentation Chapter 4.
03/26/2010CSCI 315 Operating Systems Design1 Virtual Memory Notice: The slides for this lecture have been largely based on those accompanying an earlier.
Virtual Memory. Why do we need VM? Program address space: 0 – 2^32 bytes –4GB of space Physical memory available –256MB or so Multiprogramming systems.
1 Memory Management Virtual Memory Chapter 4. 2 The virtual memory concept In a multiprogramming environment, an entire process does not have to take.
Memory Management April 28, 2000 Instructor: Gary Kimura.
File System Implementation
CSE378 Virtual memory.1 Evolution in memory management techniques In early days, single program ran on the whole machine –used all the memory available.
Virtual Memory Chantha Thoeun. Overview  Purpose:  Use the hard disk as an extension of RAM.  Increase the available address space of a process. 
CS1550 Assignment 5 Multiprogramming Implementation notes Matt Craven.
Chapter 9: Virtual Memory Background Demand Paging Copy-on-Write Page Replacement Allocation of Frames Thrashing Memory-Mapped Files Allocating Kernel.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
Chapter 8 – Main Memory (Pgs ). Overview  Everything to do with memory is complicated by the fact that more than 1 program can be in memory.
Chapter 18 Paging Chien-Chung Shen CIS, UD
SOCSAMS e-learning Dept. of Computer Applications, MES College Marampally VIRTUALMEMORY.
Project 2: Initial Implementation Notes Tao Yang.
Nachos Project 4 Lecturer: Hao-Hua Chu TA: Chun-Po Wang (Artoo) Date: 2008/10/25.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Virtual Memory.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 9: Virtual Memory.
Nachos Project Assignment 3
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Demand Paging.
Nachos Lecture 2 Xiaorui Sun. Phase 2 You have got one machine (machine package) You have to implements the incomplete OS (userprog package) Run programs.
Operating Systems Lesson 5. Plan Memory Management ◦ Memory segments types ◦ Processes & Memory ◦ Virtual Memory ◦ Virtual Memory Management ◦ Swap File.
Virtual Memory Various memory management techniques have been discussed. All these strategies have the same goal: to keep many processes in memory simultaneously.
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.
Lecture 19 Virtual Memory Demand Paging. Background Virtual memory – separation of user logical memory from physical memory. –Only part of the program.
Pintos project 3: Virtual Memory Management
CSC 360, Instructor Kui Wu Memory Management I: Main Memory.
Nachos Overview and Project 1. Nachos Introduction Official website
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.
COMP091 – Operating Systems 1 Memory Management. Memory Management Terms Physical address –Actual address as seen by memory unit Logical address –Address.
Chapter 18 Paging Chien-Chung Shen CIS/UD
Virtual Memory (Section 9.3). The Need For Virtual Memory Many computers don’t have enough memory in RAM to accommodate all the programs a user wants.
Nachos Project Assignment 3 Memory Management
SLC/VER1.0/OS CONCEPTS/OCT'99
CS 140 Lecture Notes: Virtual Memory
Lecture 11 Virtual Memory
Vivek Seshadri 15740/18740 Computer Architecture
Paging.
Memory Caches & TLB Virtual Memory
Virtual Memory User memory model so far:
PA1 is out Best by Feb , 10:00 pm Enjoy early
Lecture 28: Virtual Memory-Address Translation
CS 140 Lecture Notes: Virtual Memory
O.S Lecture 13 Virtual Memory.
Paging Lecture November 2018.
Operating Systems Lecture November 2018.
Lecture 32 Syed Mansoor Sarwar
CPSC 457 Operating Systems
CS 140 Lecture Notes: Virtual Memory
Chapter 9: Virtual Memory
Chapter 9: Virtual Memory
Lecture 37 Syed Mansoor Sarwar
Virtual Memory Prof. Eric Rotenberg
Evolution in memory management techniques
Evolution in memory management techniques
Evolution in memory management techniques
CS 140 Lecture Notes: Virtual Memory
Clock Algorithm Example
Presentation transcript:

Nachos Project 3

Goal Make Nachos can run following test cases in the same time /test/matmult.c /test/sort.c The problem is that both of the test cases require a lot of memory(larger then physical memory)

Create Disk swap = new SynchDisk Use the disk as the swap space Access the disk by kernel->swap->WriteSector kernel->swap->ReadSector See “synchdisk.cc” and other files in /filesys

Maintain Three Tables Physical memory FrameTable 1 2 3 4 PageTable 1 2 SwapTable 1 2 3 4

PageTable For each entry in PageTable unsigned int virtualPage; //virtual memory page unsigned int physicalPage; //if in physical memory bool valid; //if in physical memory bool use; //been used(read or write) bool dirty; //been modified

FrameTable For each entry in FrameTable Bool valid; //if being used Bool lock; AddrSpace *addrSpace; //which process is using this page Unsigned int vpn; //which virtual page of the process is stored in this page

SwapTable For each entry in SwapTable Bool valid; //if being used Bool lock; AddrSpace *addrSpace; //which process is using this page Unsigned int vpn; //which virtual page of the process is stored in this page (same as the FrameTable)

Address Mapping Physical Address = pageTable[(virtual address / PageSize)].physicalPage * PageSize + (virtual address % PageSize)

Addrspace::Load Load 1 page a time Ask for 1 page, if the FrameTable is full, select 1 frame and put it into SwapTable Mapping Address

Create new class “Memory Manager” Int TransAddr(AddrSpace *space, int virtAddr); //return phyAddr Bool AcquirePage(AddrSpace *space, int vpn); //ask a page for vpn Bool ReleasePage(AddrSpace *space, int vpn); //free the page Void PageFaultHandler(); //will be called when manager want to swap a page from SwapTable to FrameTable and the FrameTable is full

Hand in report Report Mail your code and report to yyergg@gmail.com tar zcvf b99xxxxxx.tar.gz ./nachos-4.0 Report Why the result is not congruent with expected How you modified Nachos to make it support multiprogramming – important code segments Mail your code and report to yyergg@gmail.com Deadline Jan.7.2014