1 nachos introduction lecturer: tei-wei kuo ta: ya-su chen, yuan-hao chang date: 2005/10/19

17
1 Nachos Introduction Lecturer: Tei-Wei Kuo TA: Ya-Su Chen, Yuan-Hao chang Date: 2005/10/19

Upload: mercy-robinson

Post on 27-Dec-2015

236 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1 Nachos Introduction Lecturer: Tei-Wei Kuo TA: Ya-Su Chen, Yuan-Hao chang Date: 2005/10/19

1

Nachos Introduction

Lecturer: Tei-Wei KuoTA: Ya-Su Chen, Yuan-Hao changDate: 2005/10/19

Page 2: 1 Nachos Introduction Lecturer: Tei-Wei Kuo TA: Ya-Su Chen, Yuan-Hao chang Date: 2005/10/19

2

Nachos Nachos: – Not Another Completely Heuristic Operating System

Written by Tom Anderson and his students at UC Berkeley

http://www.cs.washington.edu/homes/tom/nachos/

Page 3: 1 Nachos Introduction Lecturer: Tei-Wei Kuo TA: Ya-Su Chen, Yuan-Hao chang Date: 2005/10/19

3

Nachos 4.0 An educational OS used to

teach monolithic 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

Page 4: 1 Nachos Introduction Lecturer: Tei-Wei Kuo TA: Ya-Su Chen, Yuan-Hao chang Date: 2005/10/19

4

Nachos 4.0

Page 5: 1 Nachos Introduction Lecturer: Tei-Wei Kuo TA: Ya-Su Chen, Yuan-Hao chang Date: 2005/10/19

5

Nachos 4.0 Simulates MIPS architecture on host system (Unix /Linux/ Windows / MacOS X ) User programs need a cross-compiler (target MIP

S) Nachos appears as a single threaded process to th

e host operating system

Page 6: 1 Nachos Introduction Lecturer: Tei-Wei Kuo TA: Ya-Su Chen, Yuan-Hao chang Date: 2005/10/19

6

Recommended Platform Redhat Linux 7.3

Install linux directly on your pc. Install linux on virtual machine.

http://www.vmware.com/ http://www.connectix.com/

Page 7: 1 Nachos Introduction Lecturer: Tei-Wei Kuo TA: Ya-Su Chen, Yuan-Hao chang Date: 2005/10/19

7

Desiginated Platform in This Class Linux in Workstation Room 217

Installation guidehttp://newslab.csie.ntu.edu.tw/course/OS2005/files/nachos/217.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

2.4.26. Please contact the TA in Workstation Room 217 to

apply an account if you need it.

Page 8: 1 Nachos Introduction Lecturer: Tei-Wei Kuo TA: Ya-Su Chen, Yuan-Hao chang Date: 2005/10/19

8

Nachos content

Page 9: 1 Nachos Introduction Lecturer: Tei-Wei Kuo TA: Ya-Su Chen, Yuan-Hao chang Date: 2005/10/19

9

Root directoryC++ introduction to teach how to write C++

Root directory of Nachos’s source code

Building directories for different systems(Platform dependent)

File system

Nachos’s library

MIPS machine

In/Out message queues

Source code of Nachos kernel and MIPS simulatorNachos’s sample uer programs

threads

The tool to convert user programs from MIPS’s COFF into Nachos’s NOFF format

NOFF: Nachos Object File Format

User programs’ interfaces: system calls, address space, noff format.

Page 10: 1 Nachos Introduction Lecturer: Tei-Wei Kuo TA: Ya-Su Chen, Yuan-Hao chang Date: 2005/10/19

10

How does it work?(1)

Page 11: 1 Nachos Introduction Lecturer: Tei-Wei Kuo TA: Ya-Su Chen, Yuan-Hao chang Date: 2005/10/19

11

How does it work?(2)

Page 12: 1 Nachos Introduction Lecturer: Tei-Wei Kuo TA: Ya-Su Chen, Yuan-Hao chang Date: 2005/10/19

12

How does it work?(3)

Page 13: 1 Nachos Introduction Lecturer: Tei-Wei Kuo TA: Ya-Su Chen, Yuan-Hao chang Date: 2005/10/19

13

Setup the System Refer to the following document:

http://newslab.csie.ntu.edu.tw/course/OS2005/files/nachos/217.htm

Page 14: 1 Nachos Introduction Lecturer: Tei-Wei Kuo TA: Ya-Su Chen, Yuan-Hao chang Date: 2005/10/19

14

GLOBAL A source code tag system that works the same wa

y across diverse environments.

Useful for hacking a large project containing many subdirectories, many #ifdef and many main() functions.

You can download GLOBAL fromhttp://www.gnu.org/software/global/download.html

Page 15: 1 Nachos Introduction Lecturer: Tei-Wei Kuo TA: Ya-Su Chen, Yuan-Hao chang Date: 2005/10/19

15

GLOBAL (Cont.) How To Start?

http://www.gnu.org/software/global/download.html

Installation% ./configure% make% make install

gtags, htags

Page 16: 1 Nachos Introduction Lecturer: Tei-Wei Kuo TA: Ya-Su Chen, Yuan-Hao chang Date: 2005/10/19

16

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-4.0http://newslab.csie.ntu.edu.tw/course/OS2005/files/nachos/NachOS-4.0/HTML/

Page 17: 1 Nachos Introduction Lecturer: Tei-Wei Kuo TA: Ya-Su Chen, Yuan-Hao chang Date: 2005/10/19

17

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

http://www.cs.duke.edu/~narten/110/nachos/main/main.html

http://newslab.csie.ntu.edu.tw/course/OS2005/index.php?SelectedItem=Nachos