Nachos Projects Overview and Project 1 - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

Nachos Projects Overview and Project 1

Description:

Not Another Completely Heuristic Operating System ... Unix, Linux, Linux over VMware, or Cygwin. Environment. Checking g version. g -v ... – PowerPoint PPT presentation

Number of Views:132
Avg rating:3.0/5.0
Slides: 25
Provided by: cav94
Category:

less

Transcript and Presenter's Notes

Title: Nachos Projects Overview and Project 1


1
Nachos Projects Overview and Project 1
  • TA ???
  • 2007/10/24

2
Outline
  • Whats Nachos?
  • Why do we use Nachos?
  • Nachos Project Overview
  • Nachos installation
  • Nachos Assignment 1
  • Reference

3
Whats Nachos?
  • Nachos
  • Not Another Completely Heuristic Operating System
  • Developed by Tom Anderson and his students at UC,
    Berkeley.
  • http//www.cs.washington.edu/homes/tom/nachos/

4
Whats Nachos?
  • Nachos is an instrumental software that allows
    students to study and modify a real operating
    system.
  • The only difference between Nachos and a real
    operating system is that Nachos runs a Unix
    process, whereas a real operating system runs on
    a real machine.

5
Whats Nachos?
  • Nachos simulates a MIPS machine (MIPS R2/3000) on
    the host system (Unix, Linux, etc.)
  • Conceptually, Nachos has two modes of execution,
    namely, MIPS simulator and Nachos kernel

Reference http//course.cs.ust.hk/comp252/web07f
all/Lab1/Nachos20architecture/nachos.ps
6
Why do we use Nachos?
  • For understanding operating system concepts,
    nothing is better than building an operating
    system.
  • Nachos is simpler than UNIX.
  • Simulator makes debugging easier.
  • Deterministic

7
Nachos Project Overview
  • The project for this course is to build an
    operating system for scratch. The project
    contains four phases, corresponding to each of
    the major pieces of a modern OS.
  • Multiprogramming
  • Thread management
  • File Systems and Virtual Memory
  • Networking

8
Nachos Installation
  • Platforms you may use
  • Unix, Linux, Linux over VMware, or Cygwin.
  • Environment
  • Checking g version
  • g -v
  • Both g 3.3.3 or g 3.2.2 are ok.
  • Get Nachos-4.0
  • http//cc.ee.ntu.edu.tw/farn/courses/OS2007/nacho
    s/nachos-4.0.tar.gz
  • wget

9
Nachos Installation
  • Get Cross Compiler
  • http//cc.ee.ntu.edu.tw/farn/courses/OS2007/nacho
    s/mips-decstation.linux-xgcc.tgz
  • Move Cross Compiler to /
  • mv ./mips-decstation.linux-xgcc.tgz /
  • Untar Cross Compiler
  • cd /
  • tar zxvf mips-decstation.linux-xgcc.tgz

10
Nachos Installation
  • Untar Nachos
  • tar zxvf nachos-4.0.tar.gz
  • Make Nachos-4.0
  • cd ./nachos-4.0/code
  • make
  • Test
  • cd ./userprog
  • ./nachos e ../test/test1
  • ./nachos e ../test/test2

11
Nachos Installation
  • You should see the result of test1

12
Nachos Installation
  • You should see the result of test2

13
Some Important Things
  • Nachos arguments
  • Help
  • ./nachos h
  • Debugging Mode
  • ./nachos s
  • Execute files
  • ./nachos e file_name
  • Recompilation of modified nachos code
  • cd nachos-4.0/code
  • make clean (optional)
  • make

14
Nachos Assignment 1
  • Abstract
  • The assignment is to support multiprogramming. We
    give some of the code you need, and you have to
    complete the system.
  • Try execute two programs at the same time on
    Nachos
  • cd ./userprog
  • ./nachos e ../test/test1 e ../test/test2
  • you should see the following result.

15
Result of simultaneously execution
  • Total threads number is 2
  • Thread ../test/test1 is executing.
  • Thread ../test/test2 is executing.
  • Print integer9
  • Print integer8
  • Print integer7
  • Print integer20
  • Print integer21
  • Print integer22
  • Print integer23
  • Print integer24
  • Print integer6
  • Print integer7
  • Print integer8
  • Print integer9
  • Print integer10
  • Print integer12
  • Print integer13
  • Print integer14

16
Result of simultaneously execution
  • Print integer18
  • Print integer19
  • Print integer20
  • Print integer17
  • Print integer18
  • Print integer19
  • Print integer20
  • Print integer21
  • Print integer21
  • Print integer23
  • Print integer24
  • Print integer25
  • return value0
  • Print integer26
  • return value0
  • No threads ready or runnable, and no pending
    interrupts.
  • Assuming the program completed.
  • Machine halting!
  • Ticks total 800, idle 67, system 120, user 613

Why the output result of executing two program
simultaneously differs from the result of
executing two programs separately?
17
Why should you do?
  • Trace Nachos
  • Read .h and .cc to understand the whole system
    and see how it is implemented.
  • You might use some documentations to help
    yourself understand the system.
  • A Road Map Through Nachos
  • http//cc.ee.ntu.edu.tw/farn/courses/OS2007/ref/N
    achos20Road20Map.pdf
  • Trace for NachoOS-4.0 with GLOBAL
  • http//cc.ee.ntu.edu.tw/farn/courses/OS2007/nacho
    s/HTML/index.html

18
Hints
  • To know why the result is wrong, you may trace
    the following files.
  • nachos-4.0/code/userprog/addrspace.h
  • nachos-4.0/code/userprog/addrspace.cc
  • nachos-4.0/code/userprog/userkernel.cc
  • nachos-4.0/code/userprog/translate.h
  • nachos-4.0/code/userprog/translate.cc

19
Hints
  • You have to modify the Nachos code to achieve the
    correct result.
  • You may try to modify the following functions
  • nachos-4.0/code/userprog/addrspace.cc
  • constructor
  • destructor
  • initRegister
  • Load

20
Assignment Requirements
  • Progress Report (11/7 on the class)
  • Prepare a presentation about the following
    topics
  • Your understanding about Nachos
  • Your progress
  • Installation of Nachos
  • Knowing why the result is not congruent with
    expected
  • Your Plan for modifying Nachos
  • Everything you consider important

21
Assignment Requirements
  • Assignment Report (11/21 on the class)
  • Prepare a presentation about the following
    topics
  • Why the result is not congruent with expected
  • How you modified Nachos to make it support
    multiprogramming important code segments
  • Everything you consider important

22
Hand in your reports.
  • Please compress your code with tar.
  • source code only
  • tar zcvf r95943071.tar.gz nachos-4.0
  • E-mail your code and presentation files(report)
    to TA (mondale.tw_at_gmail.com).
  • Deadline 2007/11/21 2359

23
Grading Policy
  • Progress Report 20
  • Correct Result 30
  • Report 50

24
Reference
  • Authors Web Page
  • http//www.cs.washington.edu/homes/tom/nachos/
  • Thomas Narten's Nachos Roadmap
  • http//www.cs.duke.edu/narten/110.html
  • Other Reference
  • http//www.cse.ucsc.edu/classes/cmp111/Fall94/nach
    os/intro.html
  • http//course.cs.ust.hk/comp252/web07fall/nachos_i
    ntro.html
  • http//neuron.csie.ntust.edu.tw/homework/93/OS/hom
    ework_2/A9315010/html/
Write a Comment
User Comments (0)
About PowerShow.com