Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build...
-
Upload
clare-welch -
Category
Documents
-
view
237 -
download
2
Transcript of Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build...
![Page 1: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.](https://reader031.fdocuments.net/reader031/viewer/2022012402/56649f0e5503460f94c226c2/html5/thumbnails/1.jpg)
Nachos Overview
2011 级 OS 课程设计2013 秋
![Page 2: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.](https://reader031.fdocuments.net/reader031/viewer/2022012402/56649f0e5503460f94c226c2/html5/thumbnails/2.jpg)
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.](https://reader031.fdocuments.net/reader031/viewer/2022012402/56649f0e5503460f94c226c2/html5/thumbnails/3.jpg)
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.](https://reader031.fdocuments.net/reader031/viewer/2022012402/56649f0e5503460f94c226c2/html5/thumbnails/4.jpg)
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.](https://reader031.fdocuments.net/reader031/viewer/2022012402/56649f0e5503460f94c226c2/html5/thumbnails/5.jpg)
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.](https://reader031.fdocuments.net/reader031/viewer/2022012402/56649f0e5503460f94c226c2/html5/thumbnails/6.jpg)
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.](https://reader031.fdocuments.net/reader031/viewer/2022012402/56649f0e5503460f94c226c2/html5/thumbnails/7.jpg)
Contents
• Introduction• Installation• Nachos directory structure
![Page 8: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.](https://reader031.fdocuments.net/reader031/viewer/2022012402/56649f0e5503460f94c226c2/html5/thumbnails/8.jpg)
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.](https://reader031.fdocuments.net/reader031/viewer/2022012402/56649f0e5503460f94c226c2/html5/thumbnails/9.jpg)
1.1 The architecture of Nachos
![Page 10: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.](https://reader031.fdocuments.net/reader031/viewer/2022012402/56649f0e5503460f94c226c2/html5/thumbnails/10.jpg)
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.](https://reader031.fdocuments.net/reader031/viewer/2022012402/56649f0e5503460f94c226c2/html5/thumbnails/11.jpg)
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.](https://reader031.fdocuments.net/reader031/viewer/2022012402/56649f0e5503460f94c226c2/html5/thumbnails/12.jpg)
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.](https://reader031.fdocuments.net/reader031/viewer/2022012402/56649f0e5503460f94c226c2/html5/thumbnails/13.jpg)
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.](https://reader031.fdocuments.net/reader031/viewer/2022012402/56649f0e5503460f94c226c2/html5/thumbnails/14.jpg)
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.](https://reader031.fdocuments.net/reader031/viewer/2022012402/56649f0e5503460f94c226c2/html5/thumbnails/15.jpg)
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.](https://reader031.fdocuments.net/reader031/viewer/2022012402/56649f0e5503460f94c226c2/html5/thumbnails/16.jpg)
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.](https://reader031.fdocuments.net/reader031/viewer/2022012402/56649f0e5503460f94c226c2/html5/thumbnails/17.jpg)
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.](https://reader031.fdocuments.net/reader031/viewer/2022012402/56649f0e5503460f94c226c2/html5/thumbnails/18.jpg)
![Page 19: Nachos Overview 2011 级 OS 课程设计 2013 秋. to get your hands dirty Read and analyze Build observe.](https://reader031.fdocuments.net/reader031/viewer/2022012402/56649f0e5503460f94c226c2/html5/thumbnails/19.jpg)
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.](https://reader031.fdocuments.net/reader031/viewer/2022012402/56649f0e5503460f94c226c2/html5/thumbnails/20.jpg)
Assignments
• Assignment 1: Overview and process• Assignment 2: Synchronization and monitors• Assignment 3: File System Interface and
Implementation