1 / 15

Nachos Introduction

Nachos Introduction. CS342301 Operating System 2005. What is Nachos?. Nachos N ot A nother C ompletely H euristic O perating S ystem Developed by Tom Anderson and his students at UC Berkley http://www.cs.washington.edu/homes/tom/nachos/

Download Presentation

Nachos Introduction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Nachos Introduction CS342301 Operating System 2005

  2. What is Nachos? • Nachos • Not Another Completely Heuristic Operating System • Developed by Tom Anderson and his students at UC Berkley • http://www.cs.washington.edu/homes/tom/nachos/ • An educational system used to teach kernel design and implementation

  3. Why Nachos? • Real hardware is difficult to handle • Real kernel is too complicated to maintain • Nachos • Use a MIPS virtual machine • Provide some basic OS elements

  4. Nachos structure • The Nachos kernel runs inside a process • The simulator runs alongside the kernel inside a process • The user program runs inside the simulator User programs Nachos user program Nachos system call Nachos kernel Simulated Nachos hardware System calls OS kernel Machine (hardware)

  5. How to install Nachos? • Copy files to your home directory • cp /tmp/nachos/nachos_4.0.tar.gz ./ • Extract files • tar -zxvf nachos_4.0.tar.gz • Change directory • cd nachos-4.0/code • Make files • make • You can ignore the warning messages • This step takes some time…please be patient

  6. How to execute Nachos? • There are several different directories in Nachos. You need to execute in different directories for different homework • cd threads/ ./nachos • cd userprog/ ./nachos

  7. How to write your program • Coding directly on the course machine • ssh 140.114.78.183 • Free ssh tool on Windows: putty (or pputty) • Use vi to read and modify files • Use grep to search in files • Coding in Windows environment • Your familiar editors • AEdiX suite (free) / UltraEdit / VC++ • Use ftp to download / upload files

  8. How to debug your program • Use the debug options of Nachos • ./nachos –d + • Print all debug messages • In case the output is too many to fit the screen • ./nachos -d + 2>&1 > FileName

  9. How to recompile your program completely • If you want to recompile the whole programs completely • cd ~/nachos-4.0/code/ make clean make

  10. Project 1: Multiprogramming • Please execute the nachos under ~/nachos-4.0/code/userprog directory • Nachos executes two programs: ~/nachos-4.0/code/test/test1.c and test2.c • For some reasons, execute the two programs concurrently will cause some errors • Please modify the kernel code such that Nachos can execute the two programs concurrently • In this project, you don’t really need to make files under code directory, make file in userprog directory is okay • cd ~/nachos-4.0/code/userprog make

  11. Project 1: Multiprogramming (cont’) • Please trace the following code to figure out how Nachos decide which programs to execute • userprog/userkernel.cc  void UserProgKernel::Run() • In this project, you can only modify the following code segments (you may not need to modify all of them): • Constructor of AddrSpace in userprog/addrspace.* • Destructor of AddrSpace in userprog/addrspace.* • AddrSpace::Load(char*) in userprog/addrspace.* • Destructor of UserProgKernel in userprog/userkernel.* • UserProgKernel::Initialize() in userprog/userkernel.* • You may need to use “semaphore”, please refer: • thread/synch.*

  12. How to submit your program • Please make a new directory “hw1” in your home directory • Please copy your addrspace.*, userkernel.* in this directory • TA will run “build.sh” to compile your program • You can copy build.sh from /tmp/nachos/build.sh to test if your program can compile and execute correctly

  13. Some matters needing attention • The source code has been modified by TA. Please don’t mix them with other versions • Mail the school IDs and names of your group members (2~3 people) to TA • hhchen@vc.cs.nthu.edu.tw • Please leave a copy of your codes in your own PC. Course machine is for coding and testing only. We do NOT guarantee the safety of your codes • TA will provide you something you should know, but TA will NOT debug for you

  14. Grading • Correctness: 70% • README file: 20% • Programming style: 10%

  15. Reference links • Nachos official site • http://www.cs.washington.edu/homes/tom/nachos/ • A road map through Nachos • http://www.cs.duke.edu/~narten/110/nachos/main/main.html • A quick introduction to C++ written by Tom Anderson • http://www.cs.washington.edu/homes/tom/c++example/c++.ps

More Related