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.

Slides:



Advertisements
Similar presentations
CSC 360- Instructor: K. Wu Overview of Operating Systems.
Advertisements

More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Christo Wilson Project 2: User Programs in Pintos
CSCC69: Operating Systems
Operating Systems Lecture 10 Issues in Paging and Virtual Memory Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing.
1 Pintos Project #3 Virtual Memory The following slides were created by Xiaomo Liu and others for CS 3204 Fall And Modified by Nick Ryan for Spring.
Operating Systems COMP 4850/CISG 5550 Processes Introduction to Threads Dr. James Money.
Discussion Week 5 TA: Kyle Dewey. Overview HW 3.10 and 6.2 review Binary formats System call execution in NACHOS Memory management in NACHOS I/O in NACHOS.
Jaishankar Sundararaman
CS 300 – Lecture 22 Intro to Computer Architecture / Assembly Language Virtual Memory.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.
Process Processes are executing or executable instances of programs. Processes in a modern OS haveOS –management information –resources –unique process.
CSE 451 Section 4 Project 2 Design Considerations.
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
COP 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00-6:00 PM.
Welcome to the World of Nachos CPS 110 Spring 2004 Discussion Session 1.
Segmentation & O/S Input/Output Chapter 4 & 5 Tuesday, April 3, 2007.
CS1550 Assignment 5 Multiprogramming Implementation notes Matt Craven.
CSC 501 Lecture 2: Processes. Process Process is a running program a program in execution an “instantiation” of a program Program is a bunch of instructions.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Processes and Threads CS550 Operating Systems. Processes and Threads These exist only at execution time They have fast state changes -> in memory and.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Race Conditions Defined 1. Every data structure defines invariant conditions. defines the space of possible legal states of the structure defines what.
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
30 October Agenda for Today Introduction and purpose of the course Introduction and purpose of the course Organization of a computer system Organization.
Project 2: Initial Implementation Notes Tao Yang.
Chapter 4 Memory Management Virtual Memory.
Nachos Project 4 Lecturer: Hao-Hua Chu TA: Chun-Po Wang (Artoo) Date: 2008/10/25.
LINUX System : Lecture 7 Bong-Soo Sohn Lecture notes acknowledgement : The design of UNIX Operating System.
Concurrency, Processes, and System calls Benefits and issues of concurrency The basic concept of process System calls.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
Processes and Virtual Memory
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
COT 4600 Operating Systems Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:00-4:00 PM.
Pintos project 3: Virtual Memory Management
What is a Process ? A program in execution.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
CS 162 Discussion Section Week 6. Administrivia Project 2 Deadlines – Initial Design Due: 3/1 – Review Due: 3/5 – Code Due: 3/15.
Of Privilege, Traps, Interrupts & Exceptions Prof. Sirer CS 316 Cornell University.
Advanced Operating Systems CS6025 Spring 2016 Processes and Threads (Chapter 2)
CSE120 Discussion 5 Xinxin Jin. Where Are We?  Now we have finished some thread mechanisms to support Nachos kernel  Next, we want to enable user-level.
CS 140 Lecture Notes: Virtual Memory
Processes and threads.
Operating Systems CMPSC 473
Chapter 9: Virtual Memory
Operating Systems: A Modern Perspective, Chapter 6
Chapter 8: Main Memory.
CS 140 Lecture Notes: Virtual Memory
Chapter 1: Intro (excerpt)
Background Program must be brought into memory and placed within a process for it to be run. Input queue – collection of processes on the disk that are.
More examples How many processes does this piece of code create?
COP 4600 Operating Systems Spring 2011
Chapter 9: Virtual Memory
CS 140 Lecture Notes: Virtual Memory
Lecture 3: Main Memory.
Morgan Kaufmann Publishers Memory Hierarchy: Virtual Memory
Virtual Memory Overcoming main memory size limitation
Threads Chapter 5 2/17/2019 B.Ramamurthy.
Operating Systems Lecture 1.
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
Threads Chapter 5 2/23/2019 B.Ramamurthy.
LINUX System : Lecture 7 Lecture notes acknowledgement : The design of UNIX Operating System.
CS149D Elements of Computer Science
CSE 451: Operating Systems Autumn 2003 Lecture 10 Paging & TLBs
CS510 Operating System Foundations
CS 140 Lecture Notes: Virtual Memory
Chapter 1: Introduction CSS503 Systems Programming
Necessary Background for OS
Presentation transcript:

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 on MIPS!

userprog package UserKernel.java - a multiprogramming kernel. UserProcess.java - a user process; manages the address space, and loads a program into virtual memory. UThread.java - a thread capable of executing user MIPS code. SynchConsole.java - a synchronized console; makes it possible to share the machine's serial console among multiple threads.

Interrupt Handler Specification test/syscall.h File Management Syscall –Create/Open/Read/Write/Close/Unlink –Use Machine.stubFileSystem.java to access file files in the test directory –File Descriptor

Interrupt Handler Process Management Syscall –exit: terminate the current process immediately. –exec: execute the program stored in the specified file, with the specified arguments, in a new child process. –join: suspend execution of the current process until the child process specified by the processID argument has exited.

Memory Management No dynamic memory allocation needed You can allocate a fixed number of pages for the processe's stack, 8 pages should be sufficient. Pagetable in UserKernel

Memory Management Implement –UserProcess.readVirtualMemory –UserProcess.writeVirtualMemory –UserProcess.loadSections

Run programs Write source files(*.c) Compile source files into object files (*.o) Produce MIPS binary file (*.coff) Run it on your OS

Phase 3- Caching and Virtual Memory TLB –Machine.processor().readTLBEntry() –Machine.processor().writeTLBEntry() –Handle TLB miss

Memory Management Use a single global inverted page table Use swap file to save pages Implement lazy loading –Read/Write when necessary Design your memory management carefully and make it work efficiently The efficiency will be considered in the final score

Background process Run program –matmult & –…. Can your program run correctly?

Background process Criteria –Single matmult –matmult & + matmult –matmult & + matmult & –matmult & + matmult & + matmult & …