Operating System Tracing the Nachos code in Java Instructor: Dr. Lee, Hahn-Ming. ( 李漢銘 教授 ) TA (Reporter): Mao, Ching-Hao 毛敬豪 Chen, Wei-Da 陳威達 2006/3/14.

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

User-Mode Linux Ken C.K. Lee
Chapter 2 Operating System Overview Operating Systems: Internals and Design Principles, 6/E William Stallings.
WHAT IS AN OPERATING SYSTEM? An interface between users and hardware - an environment "architecture ” Allows convenient usage; hides the tedious stuff.
Chap 2 System Structures.
1 OS Structure, Processes & Process Management. 2 Recap OS functions  Coordinator  Protection  Communication  Resource management  Service provider.
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
Thursday, June 08, 2006 The number of UNIX installations has grown to 10, with more expected. The UNIX Programmer's Manual, 2nd Edition, June, 1972.
Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Dr. Mohamed Hefeeda.
1: Operating Systems Overview
Operating System Tracing the nachos code in Java
OS Spring’03 Introduction Operating Systems Spring 2003.
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.
1/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
Figure 1.1 Interaction between applications and the operating system.
Operating Systems CS208. What is Operating System? It is a program. It is the first piece of software to run after the system boots. It coordinates the.
CS 162 Nachos Tutorial Image courtesy of Thomas Andersen:
OS Concepts An Introduction operating systems. At the end of this module, you should have a basic understanding of what an operating system is, what it.
Threads CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
Copyright Arshi Khan1 System Programming Instructor Arshi Khan.
Operating Systems Nachos Project 2 Thread Scheduling.
Operating System Overview
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.
LOGO OPERATING SYSTEM Dalia AL-Dabbagh
Operating System Review September 10, 2012Introduction to Computer Security ©2004 Matt Bishop Slide #1-1.
Nachos Projects Overview and Project 1 TA : 吳哲榮 2010/10/21.
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.
Nachos Projects Overview and Project 1 TA : 王映智 2007/10/24.
Multithreading in Java Project of COCS 513 By Wei Li December, 2000.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
CS 390 Unix Programming Summer Unix Programming - CS 3902 Course Details Online Information Please check.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 7 OS System Structure.
CE Operating Systems Lecture 11 Windows – Object manager and process management.
Operating Systems Lecture 7 OS Potpourri Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software.
CS 346 – Chapter 4 Threads –How they differ from processes –Definition, purpose Threads of the same process share: code, data, open files –Types –Support.
Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.
Nachos Tutorial 马 融 03-ACM Honor Class Dept. of Computer Science and Engineering Shanghai Jiao Tong University 2007 / 11.
C o n f i d e n t i a l 1 Course: BCA Semester: III Subject Code : BC 0042 Subject Name: Operating Systems Unit number : 1 Unit Title: Overview of Operating.
Chapter 2 Processes and Threads Introduction 2.2 Processes A Process is the execution of a Program More specifically… – A process is a program.
CS 346 – Chapter 2 OS services –OS user interface –System calls –System programs How to make an OS –Implementation –Structure –Virtual machines Commitment.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
1. Introduction to Nachos Shandong University 2014 秋.
Nachos Project Assignment 1 Multi-programming TA: Hung-Leng Chen.
A compiler is a computer program that translate written code (source code) into another computer language Associated with high level languages A well.
Concurrency, Processes, and System calls Benefits and issues of concurrency The basic concept of process System calls.
Chapter 11: Operating System Support Dr Mohamed Menacer Taibah University
Nachos Overview Lecturer: Hao-Hua Chu TA: Chun-Po Wang (Artoo) Date: 2008/09/18 Material Provided by Yuan-Hao Chang, Yung-Feng Lu.
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.
Chapter 2 Process Management. 2 Objectives After finish this chapter, you will understand: the concept of a process. the process life cycle. process states.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
S ALVATORE DI G IROLAMO (TA) Networks and Operating Systems: Exercise Session 1.
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.
Introduction to Operating Systems Concepts
Operating System Overview
Applied Operating System Concepts
Operating Systems CMPSC 473
CS 6560: Operating Systems Design
Operating System Structure
Chapter 3: Windows7 Part 2.
Chapter 1: Intro (excerpt)
CGS 3763 Operating Systems Concepts Spring 2013
CGS 3763 Operating Systems Concepts Spring 2013
Chapter 3: Windows7 Part 2.
Lecture Topics: 11/1 General Operating System Concepts Processes
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Presentation transcript:

Operating System Tracing the Nachos code in Java Instructor: Dr. Lee, Hahn-Ming. ( 李漢銘 教授 ) TA (Reporter): Mao, Ching-Hao 毛敬豪 Chen, Wei-Da 陳威達 2006/3/14

Outline What is Nachos? –Capabilities, purpose, history How to setup the Nachos OS? How does it work? Object-Oriented-Programming in Java –Interface, Abstract class, class

What is Nachos?

An instructional operating system Includes many facets of a real OS: –Threads –Interrupts –Virtual Memory –I/O driven by interrupts You can (and will) modify and extend it

What else is Nachos? Nachos also contains some hardware simulation. –MIPS processor Can handle MIPS code in standard COFF, except for floating point instructions You can (and will) write code in Java, compile it to MIPS and run it on Nachos. –Console –Network interface –Timer

Nachos Architecture

History of Nachos Originally created at Berkeley in 1992 in C++ By Wayne A. Christopher, Steven J. Procter, and Thomas E. Anderson Used at many universities Rewritten in Java by Daniel Hettena –Now simpler, easier to grade, type-safe, portable, and more students now know Java.

How are we using it? Four Nachos assignments - “Phases”: –Phase 1 - Threading –Phase 2 - Multiprogramming –Phase 3 - Caching and Virtual Memory –Phase 4 - Networks and Distributed Systems

How to setup the Nachos OS?

You must download these files and toolkits first Nachos OS source Cygwin (Windows only) Java 2 Tool kits Cross Compilers

Recommend software You also can download these file to help your code tracing. It is a free software, and not have heavy load for your computer.

Pay attention!! Cygwin should installed the gcc package. In Cygwin, you should set jdk path in Cygwin. Please follow the nachos README file to set up your environment. More Detail please read the Nachos README file

Successfully This is proj 1 execute result

How does it work?

How does Nachos work? Entirely written in Java Broken into Java packages: –nachos.ag (autograder classes) –nachos.machine (most of the action) –nachos.network (Phase 4) –nachos.security (tracks priviledge) –nachos.threads (Phase 1) –nachos.userprog (Phase 2) –nachos.vm (Phase 3)

Booting Nachos When you run Nachos, it starts in nachos.machine.Machine.main Machine.main initializes devices - interrupt controller, timer, MIPS processor, console, file system Passes control to the autograder. AutoGrader will create a kernel and start it (this starts the OS)

The Machine! nachos.machine.Machine Kicks off the system, and provides access to various hardware devices: –Machine.interrupt() –Machine.timer() –Machine.console() –Machine.networkLink()

Interrupt Controller Kicks off hardware interrupts nachos.machine.Interrupt class maintains an event queue, clock Clock ticks under two conditions: –One tick for executing a MIPS instruction –Ten ticks for re-enabling interrupts After any tick, Interrupt checks for pending interrupts, and runs them. Calls device event handler, not software interrupt handler

Interrupt Controller (cont.) Important methods, accessible to other hardware simulation devices: –schedule() takes a time, handler –tick() takes a boolean (1 or 10 ticks) –checkIfDue() invokes due interrupts –enable() –disable() All hardware devices depend on interrupts - they don’t get threads.

Timer nachos.machine.Timer Hardware device causes interrupts about every 500 ticks (not exact) Important methods: –getTime() tells many ticks so far –setInterruptHandler() tells the timer what to do when it goes off Provides preemption

Serial Console Java interface nachos.machine.SerialConsole Contains methods: –readByte() returns one byte (or -1) and waits to interrupt when it has more –writeByte() takes one byte and waits to interrupt when its ready for more –setInterruptHandlers() tells the console who to call when it receives data or finishes sending data Normally implemented by nachos.machine.StandardConsole, hooked up to stdin and stdout

The Kernel Abstract class nachos.machine.Kernel Important methods –initialize() initializes the kernel –selfTest() performs test (not used by ag) –run() runs any user code (none for 1st phase) –terminate() Game over. Never returns. Each Phase will have its own Kernel subclass

Object-Oriented-Programming in Java

Java Object Oriented Language You must take care the relation among the interface, abstract class and class. Besides the OO concepts, it is also important in Multi-Threads.

There are two kinds “method” public void go(){ //implementation } public abstractvoid go(); //None implementation Normal method Abstract method

Interface, Abstract class, class All methods are abstract methods Is Interface All methods are not abstract methods Is class A part of methods are abstract, Another are normal methods. Is Abstract Class

Inner class, anonymous class Let’s talk about the class’s architecture. Class Name Attributes Method Inner Class Anonymous Class

Pay Attention While tracing and design a Java program, the java API document is very important.

For More Information README file in the installation has lots of good stuff See the last year Class Web Page for more informationlast year Class Web Page Read the code! You can see exactly what is going on.

If You have any more questions, please send mail to here: Thanks~