Nachos Overview & Project 1 - Thread Management
Outline
- Introduction of Nachos
- Installation of Nachos
- Project 1 – Thread Management
- Report & Policy
- Presentation Details
What Is Nachos?
- Designed by Thomas Anderson at UC Berkeley in 1992
- Written in C++, has JAVA version
- We use the C++ version here
- Educational OS that some components can be implemented by users
- Process management
- CPU scheduling
- Memory management
- File system management
- Networking
What Is Nachos? (Cont.)
- Nachos is just a UNIX process runs on real OS
- Nachos uses simple MIPS R2/3000 instructions
- Turn program to MIPS binary code
Installation of Nachos
Linux only …
Environment

NachOS Software Structure

Download & Install VirtualBox
- Oracle VM VirtualBox
- Download 32-bit Ubuntu 14.04
Setup
Install g++ and csh
| sudo apt-get install g++ |
| sudo apt-get install csh |
| sudo apt-get install make |
Download NachOS & Cross Compiler
| wget -d http://cc.ee.ntu.edu.tw/~farn/courses/OS/OS2015/projects/project.1/nachos-4.0.tar.gz |
| wget -d http://cc.ee.ntu.edu.tw/~farn/courses/OS/OS2015/projects/project.1/mips-x86.linux-xgcc.tar.gz |
Install NachOS
untar nachos-4.0.tar.gz
| tar -xvf nachos-4.0.tar.gz |
move mips-x86.linux-xgcc.tar.gz to root and untar
| sudo mv mips-x86.linux-xgcc.tar.gz / |
| cd / |
| sudo tar -zxvf mips-x86.linux-xgcc.tar.gz |
Install NachOS (Cont.)
Change Directory of Cross Compiler
editing file "~/nachos-4.0/code/test/Makefile"
...
GCCDIR = /mips-x86.linux-xgcc/
...
CPP = /mips-x86.linux-xgcc/cpp0
...
CFLAGS = -G 0 -c $(INCDIR) -B/mips-x86.linux-xgcc/
...
Install NachOS (Cont.)
Make NachOS-4.0
Test
| cd ./userprog |
| ./nachos -e ../test/test1 |
Total threads number is 1
Thread ../test/test1 is executing.
Print integer:9
Print integer:8
Print integer:7
Print integer:6
return value:0
Project 1
Thread Management
Issue to be solved…
| ./nachos -e ../test/test1 -e ../test/test2 |
Total threads number is 2
Thread ../test/test1 is executing.
Thread ../test/test2 is executing.
Print integer:9
Print integer:8
Print integer:7
Print integer:20
Print integer:21
Print integer:22
Print integer:23
Print integer:24
Print integer:6
Print integer:7
...
Report & Policy
Report contents, grading policy, late policy
Report
- Motivation
- Motivation and the problem analysis
- What’s your plan to deal with the problem
- Implementation
- How do you implement to solve the problem in Nachos
- You can including some (not all) important code segments and comments
- Result
- Experiment result and some discussion
- Extra effort or observation
Create a folder for the source code and report
{Student ID}_Nachos1/
|_ nachos-4.0/
|_ report.pdf
Compress
| tar -zcvf {Student ID}_Nachos1.tar.gz ./{Student ID}_Nachos1 |
Your source code and report should be handed out by Ceiba
Grading Policy
- Nachos source code: (40%)
- Report: (40%)
- Correct format: (20%)
- No plagiarism
Late Policy
- 10% penalty per day
- After 7 days, you will get 70% penalty, but no more penalty after that.
Some tips for Nachos
- Design before coding.
- Better create your own test program to get the idea.
- Trace before coding.
- Some IDE or text editor is useful if you are not a professional vim/emac user.
- Google is your best friend.
Presentation Details
- What’s your contribution to this project.
- Not necessary to make PPT.
- You can just use your report and source code to present.
- The main point is…
- Problem analysis and what’s you plan to solve it.
- What you do with this project.
- Extra observation.
Nachos Overview & Project 1 - Thread Management
{"metaMigratedAt":"2023-06-15T13:42:50.998Z","metaMigratedFrom":"YAML","title":"Nachos Overview & Project 1 - Thread Management","breaks":true,"slideOptions":"{\"theme\":\"sky\",\"transition\":\"fade\",\"spotlight\":{\"enabled\":false}}","contributors":"[{\"id\":\"afcdd5ec-1606-418a-8aeb-f4458cbd2f6c\",\"add\":6328,\"del\":719}]"}