0. This distribution of Nachos should work on any RedHat Linux distribution up to (and including) 9.0. It has been tested on RedHat 7.1, 8.0, and 9.0. To install Nachos you need to: 1. download Nachos sources from the course's webpage 2. unpack. (suppose you saved the source in file "nachos.tar.gz") prompt% gunzip -c nachos.tar.gz | tar xvf - the output should look like: ----------- x Nachos/Makefile, 1167 bytes, 3 tape blocks x Nachos/Makefile.common, 3977 bytes, 8 tape blocks ... x Nachos/machine/translate.cc, 8253 bytes, 17 tape blocks x Nachos/machine/sysdep.cc.orig, 14239 bytes, 28 tape blocks ---------- this command creates a subdirectory called Nachos where the sources are located 3. configure for OS For a linux machine: prompt% cd Nachos prompt% cp makefile.dep.linux Makefile.dep 4. compile. prompt% make if the compilation is successful the output looks like: ---------------- 20> make cd threads; gmake depend gmake[1]: Entering directory `/.automount/b2/users/cs/faculty/farrell/ass/os/fall03/RH9 .0/Nachos/threads' g++ -I../threads -I../machine -DTHREADS -DHOST_i386 -DHOST_SVR4 -DCHANGED -M ../threads /main.cc ../threads/list.cc ../threads/scheduler.cc ../threads/synch.cc ../threads/sync hlist.cc ../threads/system.cc ../threads/thread.cc ../threads/utility.cc ../threads/thr eadtest.cc ../machine/interrupt.cc ../machine/sysdep.cc ../machine/stats.cc ../machine/ timer.cc > makedep echo '/^# DO NOT DELETE THIS LINE/+2,$d' >eddep echo '$r makedep' >>eddep echo 'w' >>eddep ed - Makefile < eddep rm eddep makedep echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile echo '# see make depend above' >> Makefile gmake[1]: Leaving directory `/.automount/b2/users/cs/faculty/farrell/ass/os/fall03/RH9. 0/Nachos/threads' cd threads; gmake nachos gmake[1]: Entering directory `/.automount/b2/users/cs/faculty/farrell/ass/os/fall03/RH9 .0/Nachos/threads' g++ -g -Wall -Wshadow -fwritable-strings -I../threads -I../machine -DTHREADS -DHOST_i38 6 -DHOST_SVR4 -DCHANGED -c ../threads/main.cc g++ -g -Wall -Wshadow -fwritable-strings -I../threads -I../machine -DTHREADS -DHOST_i38 6 -DHOST_SVR4 -DCHANGED -c ../threads/list.cc g++ -g -Wall -Wshadow -fwritable-strings -I../threads -I../machine -DTHREADS -DHOST_i38 6 -DHOST_SVR4 -DCHANGED -c ../threads/scheduler.cc g++ -g -Wall -Wshadow -fwritable-strings -I../threads -I../machine -DTHREADS -DHOST_i38 6 -DHOST_SVR4 -DCHANGED -c ../threads/synch.cc g++ -g -Wall -Wshadow -fwritable-strings -I../threads -I../machine -DTHREADS -DHOST_i38 6 -DHOST_SVR4 -DCHANGED -c ../threads/synchlist.cc g++ -g -Wall -Wshadow -fwritable-strings -I../threads -I../machine -DTHREADS -DHOST_i38 6 -DHOST_SVR4 -DCHANGED -c ../threads/system.cc g++ -g -Wall -Wshadow -fwritable-strings -I../threads -I../machine -DTHREADS -DHOST_i38 6 -DHOST_SVR4 -DCHANGED -c ../threads/thread.cc ../threads/thread.cc: In member function `void Thread::CheckOverflow()': ../threads/thread.cc:123: warning: comparison between signed and unsigned integer expressions g++ -g -Wall -Wshadow -fwritable-strings -I../threads -I../machine -DTHREADS -DHOST_i38 6 -DHOST_SVR4 -DCHANGED -c ../threads/utility.cc g++ -g -Wall -Wshadow -fwritable-strings -I../threads -I../machine -DTHREADS -DHOST_i38 6 -DHOST_SVR4 -DCHANGED -c ../threads/threadtest.cc g++ -g -Wall -Wshadow -fwritable-strings -I../threads -I../machine -DTHREADS -DHOST_i38 6 -DHOST_SVR4 -DCHANGED -c ../machine/interrupt.cc ../machine/interrupt.cc: In destructor `Interrupt::~Interrupt()': ../machine/interrupt.cc:77: warning: deleting `void*' is undefined g++ -g -Wall -Wshadow -fwritable-strings -I../threads -I../machine -DTHREADS -DHOST_i38 6 -DHOST_SVR4 -DCHANGED -c ../machine/stats.cc g++ -g -Wall -Wshadow -fwritable-strings -I../threads -I../machine -DTHREADS -DHOST_i38 6 -DHOST_SVR4 -DCHANGED -c ../machine/sysdep.cc ../machine/sysdep.cc: In function `void ReadFromSocket(int, char*, int)': ../machine/sysdep.cc:368: warning: unsigned int format, pointer arg (arg 2) g++ -g -Wall -Wshadow -fwritable-strings -I../threads -I../machine -DTHREADS -DHOST_i38 6 -DHOST_SVR4 -DCHANGED -c ../machine/timer.cc /lib/cpp -P -I../threads -I../machine -DHOST_i386 -DHOST_SVR4 ../threads/switch.s > swt ch.s as -o switch.o swtch.s swtch.s: Assembler messages: swtch.s:9: Warning: indirect call without `*' swtch.s:10: Warning: indirect call without `*' swtch.s:11: Warning: indirect call without `*' g++ main.o list.o scheduler.o synch.o synchlist.o system.o thread.o utility.o threadtes t.o interrupt.o stats.o sysdep.o timer.o switch.o -o nachos gmake[1]: Leaving directory `/.automount/b2/users/cs/faculty/farrell/ass/os/fall03/RH9. 0/Nachos/threads' ---------------- 5. test prompt% cd threads prompt% nachos which should produce the following output ---------------- 26> cd threads/ poseidon.cs.kent.edu::farrell:/users/cs/faculty/farrell/ass/os/fall03/RH9.0/Nachos/thre ads 27> nachos *** thread 0 looped 0 times *** thread 1 looped 0 times *** thread 0 looped 1 times *** thread 1 looped 1 times *** thread 0 looped 2 times *** thread 1 looped 2 times *** thread 0 looped 3 times *** thread 1 looped 3 times *** thread 0 looped 4 times *** thread 1 looped 4 times No threads ready or runnable, and no pending interrupts. Assuming the program completed. Machine halting! Ticks: total 130, idle 0, system 130, user 0 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 Cleaning up... ---------------- 5. read the code There are two subdirectories of the Nachos directory: * machine - implements the machine on which the OS is supposed to run (a variant of MIPS) * threads - implements Kernel threads. The first project would involve reading and modifying the threads code. Therefore it is helpful to gain some understanding of it. Use Nachos links from the course's webpage to help you. In particular "Reading Nachos Source Code" by Michael O'Donnell should be helpful.