Top Banner
Nachos Overview 2011 级 OS 级级级级 2013 级
21

Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

Jan 04, 2016

Download

Documents

Clare Welch
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

Nachos Overview

2011 级 OS 课程设计2013 秋

Page 2: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

to get your hands dirty

Read and analyze Build

observe

Page 3: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

the only way to teach operating systems concepts and their design and implementation effectively is

to have students read and experiment with an operating

system at the source code level.

Page 4: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

Nachos

• The Nachos operating system is a small working operating system on MIPS architecture written by Prof. Tom Anderson from the University of California at Berkeley and used widely for teaching operating systems throughout the world

• The only difference between Nachos and a ``real'' operating system is that Nachos runs as a single Unix process, whereas real operating systems run on bare machines.

Page 5: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

How to study

• Our goal is to give you guidance not only to study the concepts in the text, but also to read and understand the source code of the Nachos operating system

• we use the Nachos source code to illustrate the concepts. This is probably the only way to enable you to have a sound grasp of the concepts described in the text.

Page 6: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

How to study

• the first round of reading. As a matter of fact, you will need to go back and forth between the text and the relevant Nachos source code many times before you can really grasp the concepts in this module

• Understanding and experimenting

Page 7: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

Contents

• Introduction• Installation• Nachos directory structure

Page 8: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

1. Introduction

• Nachos has an excellent balance between simplicity and realism– Nachos is a UNIX process– Nachos was originally developed for use on DEC MIPS

systems (DEC was acquired by Compaq years ago, which was acquired in turn by HP recently) and user programs are in binary format, making Nachos real enough avoiding the sense of a toy.

• side- by- side– The program nachos implements both the machine

simulation and the operating system

Page 9: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

1.1 The architecture of Nachos

Page 10: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

1.2 MIPS simulator

• Timer• Disk• Network• Console– a display and a keyboard

• MIPS instruction processor

Page 11: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

1.3 MIPS/intel

• user- level code– Run at MIPS– gcc cross- compile

• Nachos– Run at intel

Page 12: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

2 Installation

• 2.1 Cross compiler• 2.2 Nachos

Page 13: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

3. Nachos directory structure

• code– contains all source code and configuration files for

Nachos– bin.

• COFF for unix; NOFF for Nachos

– machine• The machine simulation

– threads• Thread support• main() routine of the nachos program, in main.cc• the best place to start reading the Nachos code

Page 14: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

3. Nachos directory structure cont.

• code– userprog

• the creation of address spaces• loading of user• (test) programs, and execution of test programs on the simulated

machine

– filesys• The ”real” file system uses • A“stub” file system

– Network• support for networking

– test• User test programs to run on the simulated machine

Page 15: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

4 Assumption of UNIX skills

• basic UNIX commands and file systems• make utility and Makefiles• gdb debugger tool

Page 16: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

5. What This Course Is About

• It concentrates on the concepts and techniques in design and implementation of operating systems

• This course covers the design and implementa-tion of three principle components of operating systems– Process Management– Memory Management– File Systems Management

Page 17: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

6. Teaching Material

• Textbook– Operating System Concepts"

• Nachos Source Code– about 9,500 lines of C++ code with extensive

comments• Study book

Page 18: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.
Page 19: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

Laboratoris

• Laboratory 1: Installation of Nachos System• Laboratory 2: Makefiles of Nachos • Laboratory 3: Synchronization Using Semaphores • Laboratory 4:Nachos File system• Laboratory 5: Extendable Files• Laboratory 6: User Programs and System Calls• Laboratory 7: Extension of AddrSpace• Laboratory 8: System Calls Exec() and Exit()

Page 20: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

Assignments

• Assignment 1: Overview and process• Assignment 2: Synchronization and monitors• Assignment 3: File System Interface and

Implementation

Page 21: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.

教学资料下载

• http://202.194.28.2/osp/