Presentation is loading. Please wait.

Presentation is loading. Please wait.

Nachos Project Assignment 1 MultiprogrammingTA:mamafun.

Similar presentations


Presentation on theme: "Nachos Project Assignment 1 MultiprogrammingTA:mamafun."— Presentation transcript:

1 Nachos Project Assignment 1 MultiprogrammingTA:mamafun

2 Outline ► Introduction to Nachos ► Install Nachos on Linux ► Assignment 1

3 Introduction ► Nachos:  Not Another Completely Heuristic Operating System ► Written by Tom Anderson and his students at UC Berkeley http://www.cs.washington.edu/homes/tom/nachos/

4 Trace Nachos ► Get Nachos 4.0  http://cc.ee.ntu.edu.tw/~farn/courses/OS2004/index.html http://cc.ee.ntu.edu.tw/~farn/courses/OS2004/index.html ► C++ tutorial  http://www.cs.washington.edu/homes/tom/c++example/c++.ps http://www.cs.washington.edu/homes/tom/c++example/c++.ps ► Read *.h and *.cc to have an overview about the whole system and see how it is implemented. ► Documentation (A Road Map Through Nachos)  http://www.cs.duke.edu/~narten/110/nachos/main/main.html http://www.cs.duke.edu/~narten/110/nachos/main/main.html

5 Install Nachos ► Platform: Linux, Linux over VMware or Cygwin  Install steps on Linux or Linux over VMware ► Get Nachos-4.0 Nachos-4.0 ► Get Cross Compiler Cross CompilerCross Compiler ► Move Cross Compiler to /  mv./mips-decstation.linux-xgcc.tgz / ► Untar Cross Compiler  tar zxvf /mips-decstation.linux-xgcc.tgz ► Untar Nachos-4.0  tar zxvf./nachos-4.0.tar.gz

6 Install Nachos (cont.) ► Make Nachos-4.0  cd./nachos-4.0/code  make ► Test if installation is succeeded  cd./userprog ./nachos – e../test/test1 ► You should see the following …

7 You should see 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 No threads ready or runnable, and no pending interrupts. Assuming the program completed. Machine halting! Ticks: total 200, idle 66, system 40, user 94 Disk I/O: reads 0, writes 0 Console I/O: reads 0, writes 0 Paging: faults 0 Network I/O: packets received 0, sent 0

8 Operate Nachos ► Nachos command help ./nachos -h ► Debugging mode ./nachos -s ► Execute files on Nachos ./nachos – e../test/test1

9 Recompile Modified Nachos Code ► cd nachos-4.0/code ► make clean (optional) ► make  If you want to fully re-compile the source code, “ make clean ” is required. Or make will only re- compile the modified and related files. (save time)

10 Assignment 1 ► Go to nachos-4.0/code/userprog and type “./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

11 Print integer:8 Print integer:9 Print integer:10 Print integer:12 Print integer:13 Print integer:14 Print integer:15 Print integer:16 Print integer:17 Print integer:18 Print integer:19 Print integer:20 Print integer:17 Print integer:18 Print integer:19 Print integer:20 Print integer:21 Print integer:23 Print integer:24 Print integer:25

12 ► In some reasons, the output results didn ’ t match the behavior of “../test/test1.c ” and “../test/test2.c ” return value:0 Print integer:26 return value:0 No threads ready or runnable, and no pending interrupts. Assuming the program completed. Machine halting! Ticks: total 800, idle 67, system 120, user 613 Disk I/O: reads 0, writes 0 Console I/O: reads 0, writes 0 Paging: faults 0 Network I/O: packets received 0, sent 0

13 Assignment 1 ► Please trace the following files to see why the output results are wrong  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/machine/translate.h  Nachos-4.0/code/machine/translate.cc

14 Assignment 1 ► Please modified the Nachos code to run the correct results.  You may need to modify the following functions ► Nachos-4.0/code/userprog/addrspace.cc  constructor  destructor  initRegister  Load

15 Deadline ► 4/9 Friday 6:00 ► Please tar your code and e-mail to r92921076@ntu.edu.tw entitled as your_student_ID.tar.gz r92921076@ntu.edu.tw ► make clean ► tar zcvf r92921076.tar.gz nachos-4.0 accompany with your report about what did you done to the Nachos source code (why and how), or what did you get when tracing the Nachos source code. accompany with your report about what did you done to the Nachos source code (why and how), or what did you get when tracing the Nachos source code.

16 Grading policy ► Note: your handout files must contain two parts  1.modified nachos source code (ID.tar.gz)  2.report ► Correct result30% ► Report70% ► Contact me if you have any any problems  r92921076@ntu.edu.tw 電二 219 r92921076@ntu.edu.tw


Download ppt "Nachos Project Assignment 1 MultiprogrammingTA:mamafun."

Similar presentations


Ads by Google