Nachos Overview Lecturer: Hao-Hua Chu TA: Chun-Po Wang (Artoo) Date: 2008/09/18 Material Provided by Yuan-Hao Chang, Yung-Feng Lu.

Slides:



Advertisements
Similar presentations
CS 11 C track: lecture 7 Last week: structs, typedef, linked lists This week: hash tables more on the C preprocessor extern const.
Advertisements

Computer Software 3 Section A Software Basics CHAPTER PARSONS/OJA
Module R2 CS450. Next Week R1 is due next Friday ▫Bring manuals in a binder - make sure to have a cover page with group number, module, and date. You.
Java.  Java is an object-oriented programming language.  Java is important to us because Android programming uses Java.  However, Java is much more.
Operating System Tracing the Nachos code in Java Instructor: Dr. Lee, Hahn-Ming. ( 李漢銘 教授 ) TA (Reporter): Mao, Ching-Hao 毛敬豪 Chen, Wei-Da 陳威達 2006/3/14.
COSC 120 Computer Programming
Introduction to Object- Oriented Programming with Java Spring Semester 2003 Paul Krause.
Rossella Lau Lecture 8, DCO10105, Semester B, DCO10105 Object-Oriented Programming and Design  Lecture 8: Polymorphism & C++ pointer  Inheritance.
 2006 Pearson Education, Inc. All rights reserved Midterm review Introduction to Classes and Objects.
Operating System Tracing the nachos code in Java
Nachos Introduction CS Operating System 2007.
Fall 2011 Nassau Community College ITE153 – Operating Systems Session 24 NTFS Permissions and Sharing Printers 1.
Nachos Introduction CS Operating System 2005.
PHP Scripting Language. Introduction “PHP” is an acronym for “PHP: Hypertext Preprocessor.” It is an interpreted, server-side scripting language. Originally.
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
Review of C++ Programming Part II Sheng-Fang Huang.
1 Introduction to Tool chains. 2 Tool chain for the Sitara Family (but it is true for other ARM based devices as well) A tool chain is a collection of.
Programming Languages and Paradigms Object-Oriented Programming.
Lecture 22 Miscellaneous Topics 4 + Memory Allocation.
Copy Control Joe Meehean. More Class Responsibilities When making a new type (i.e., class) we must specify what happens when it is: Copied Assigned Destroyed.
Java and C++, The Difference An introduction Unit - 00.
COMPUTER SOFTWARE Section 2 “System Software: Computer System Management ” CHAPTER 4 Lecture-6/ T. Nouf Almujally 1.
Welcome to the World of Nachos CPS 110 Spring 2004 Discussion Session 1.
1 Nachos Introduction Lecturer: Tei-Wei Kuo TA: Ya-Su Chen, Yuan-Hao chang Date: 2005/10/19.
Nachos Project 1 Start-up and System call
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
Eric Keller, Evan Green Princeton University PRESTO /22/08 Virtualizing the Data Plane Through Source Code Merging.
Nachos Projects Overview and Project 1 TA : 吳哲榮 2010/10/21.
Nachos Projects Overview and Project 1 TA : 王映智 2007/10/24.
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
Copyright  Hannu Laine C++-programming Part 3 Hannu Laine.
Copyright © 2012 Pearson Education, Inc. Chapter 13: Introduction to Classes.
Nachos Project Assignment 1 MultiprogrammingTA:mamafun.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13: Introduction to Classes.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
Race Conditions Defined 1. Every data structure defines invariant conditions. defines the space of possible legal states of the structure defines what.
Operating System What is an Operating System? A program that acts as an intermediary between a user of a computer and the computer hardware. An operating.
Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.
Nachos Project 4 Lecturer: Hao-Hua Chu TA: Chun-Po Wang (Artoo) Date: 2008/10/25.
1 C++ Classes and Data Structures Jeffrey S. Childs Chapter 4 Pointers and Dynamic Arrays Jeffrey S. Childs Clarion University of PA © 2008, Prentice Hall.
Chapter 7 Pointers: Java does not have pointers. Used for dynamic memory allocation.
1. Introduction to Nachos Shandong University 2014 秋.
Nachos Project Assignment 1 Multi-programming TA: Hung-Leng Chen.
Java Basics Opening Discussion zWhat did we talk about last class? zWhat are the basic constructs in the programming languages you are familiar.
Computer Graphics 3 Lecture 1: Introduction to C/C++ Programming Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
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.
Nachos Project 3 Lecturer: Hao-Hua Chu TA: Chun-Po Wang (Artoo) Date: 2008/10/25.
JAVA INTRODUCTION. What is Java? 1. Java is a Pure Object – Oriented language 2. Java is developing by existing languages like C and C++. How Java Differs.
1 Becoming More Effective with C++ … Day Two Stanley B. Lippman
1 Classes II Chapter 7 2 Introduction Continued study of –classes –data abstraction Prepare for operator overloading in next chapter Work with strings.
1 Lecture 6 “Nachos” n nachos overview n directory structure n nachos emulated machine n nachos OS n nachos scheduler n nachos threads.
C:\Temp\Templates 4 5 Use This Main Program 6.
Virtual Machines. A virtual machine takes the layered approach to its logical conclusion. It treats hardware and the operating system kernel as though.
1 2 2 Call The Project Dynamic-Memory 4 4 # include "Utilities.hpp" int main(int argc, char * argv[]) { short int *PtrNo; (*PtrNo) = 5; printf ("(*PtrNo)
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 13: Introduction to Classes.
OPERATING SYSTEM BY KINSHUK RASTOGI. WHAT IS AN OPERATING SYSTEM? What is an operating system in the first place? An operating system is a software that.
Nachos Project 2 Lecturer: Hao-Hua Chu TA: Chun-Po Wang (Artoo) Date: 2008/10/14 Material Provided by Yuan-Hao Chang, Yung-Feng Lu.
Exception Handling How to handle the runtime errors.
Programming Fundamentals1 Chapter 7 INTRODUCTION TO CLASSES.
Dynamic Memory Management & Static Class Members Lecture No 7 Object Oriented Programming COMSATS Institute of Information Technology.
RealTimeSystems Lab Jong-Koo, Lim
Pyragen A PYTHON WRAPPER GENERATOR TO APPLICATION CORE LIBRARIES Fernando PEREIRA, Christian THEIS - HSE/RP EDMS tech note:
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.
Virtual Machines.
CMSC 341 Prof. Michael Neary
Operation System Program 4
Tutorial: The Programming Interface
ENERGY 211 / CME 211 Lecture 17 October 29, 2008.
Miscellaneous Topics I
Presentation transcript:

Nachos Overview Lecturer: Hao-Hua Chu TA: Chun-Po Wang (Artoo) Date: 2008/09/18 Material Provided by Yuan-Hao Chang, Yung-Feng Lu

2 Nachos Nachos: – Not Another Completely Heuristic Operating System Written by Tom Anderson and his students at UC Berkeley / /

3 Nachos 4.0 An educational OS used to –teach kernel design and implementation –do experiments Fact: –Real hardware is difficult to handle. –May break if handled wrong. Approach: –Use a virtual MIPS machine –Provide some basic OS elements

4 Nachos 4.0

5 Simulates MIPS architecture on host system (Unix /Linux/ Windows / MacOS X ) User programs need a cross-compiler (target MIPS) –Eg. To compile user programs to MIPS on Linux Nachos appears as a single threaded process to the host operating system

6 Designated Platform in This Class Linux in Workstation Room 217 –Installation guide htm htm If your project submission can’t execute on Linux in Workstation Room 217, we will consider it as fail. –The Linux kernel in Workstation Room 217 is –Please contact me to apply a workstation account if you need it.

7 How does it work?

8 How does it work? (Cont.)

9 How does it work? (Cont..)

10 Setup the System Refer to the following document: tm tm You need: –Nachos source code –MIPS Cross compiler –A patch for Nachos to work on 217 workstations

11 Nachos content

12 Setup the System (cont.) You can build Nachos on Linux –Your linux –Virtual machine –217 linux (1~14) (recommended) 217 runs 64-bit machines –Apply the patch before you build anything

13 Setup the System (cont.) MIPS Cross compiler –Nachos simulates MIPS machine –The user program built by this compiler cannot run on Linux Please make sure that you follow the steps in the instruction –You should extract Nachos and the cross compiler to the same directory (NachOS-4.0 and usr) –Or, user programs could not be built

14 Test files There are some test user programs in NachOS-4.0/code/test/ –Use “make” to build them, the MIPS binary would be generated in the same directory Use these files to test if your Nachos is properly modified and built

15 How to run “nachos –x userprog –d u” –Nachos binaries is in NachOS- 4.0/code/build.linux/nachos –Use –x to run the user programs –Use –d to show debug messages A full list of options is under NachOS- 4.0/code/lib/debug.h Nachos would startup, load and run the user program, then halt

16 GLOBAL A source code tag system for you to trace large source files (Eg. Nachos) Useful for hacking a large project containing many subdirectories, many #ifdef and many main() functions. You can download GLOBAL from wnload.html wnload.html

17 GLOBAL (Cont.) How To Start? – mlhttp:// ml –Installation %./configure % make % make install Two utilities –gtags, htags

18 GLOBAL (Cont..) gtags – Create Tag Database % cd NachOS-4.0/ % gtags htags – Create Hypertext Files (under HTML/) for a Web-Based Interface for Global % htags –Ff The GLOBAL for NachOS /HTML/ 4.0/HTML/

19 How to Start Trace Codes Read interfaces in the *.h files first. –To have overview of the whole system. Then, read the implementations in the *.cc files. –See how the executable code supports each interface. Documentation – main.htmlhttp:// main.html

20 C++ Object-Oriented Looks like JAVA, based on C C  C++ C++ has lots of features, but Nachos only uses a few –So take it easy

21 C++ Class Declaration (Usually in header files) class CoffeCup { private: // or protected, these members can only be // accessed by CoffeeCup members int max_volume, current; char name[100]; bool checkVolume (void); public: // these members can be accessed by anyone CoffeeCup (char * new_name); // constructor ~CoffeeCup (); // destructor int fill (int vol); int drink (int vol); };

22 C++ Class (cont.) Definition (Usually in.cc or.cpp files) CoffeeCup::CoffeeCup (char *new_name) : max_volume(100), current(0) { strcpy(name, new_name); } CoffeeCup::~CoffeeCup () { if(current > 0) cout << “You left ” << current << “ in the cup ” << name << endl; } bool CoffeeCup::checkVolume (void) { return (current <= max_volume); }

23 C++ Class (cont.) void CoffeeCup::fill (int vol) { current += vol; if(!checkVolume()) { cout << “Too much!” << endl; current = max_volume; } void CoffeeCup::drink (int vol) { current -= vol; if(current < 0) current = 0; }

24 C++ Class (cont.) // We demonstrate the difference between an object and // a pointer to object CoffeeCup cup1(“Espresso”); CoffeeCup *cup2 = new CoffeeCup(“Latte”); cup1.fill(50); cup2->fill(60); cup1.drink(30); (*cup2).drink(30); // Delete or we’ll have memory leak delete cup2; // Now cup1 has 20, cup2 has 30

25 Other features Dynamic allocated array char *array = new char[100]; array[0] = … delete [] array; “this” –A pointer point to the class instance itself –“checkVolumne()” is equal to “this->checkVolume()” ASSERT(…) –Check if the condition is meet. Abort if it is not. –Not really a C++ feature, though ASSERTNOTREACHED( ) –Check if this line is not executed –Eg. placed after a “return” Feel free to ask me if you have C++ problems