Tuesday, January 6, 2009

iceSapphire's tribute to "Not Another Completely Heuristic Operating System" (NACHOS)

Not Another Completely Heuristic Operating System, often abbreviated as NACHOS, is instructional software for teaching and learning operating system. It is not a complete operating system but is a simulation, which runs as a single process on another (preferably POSIX) operating system.

Installation

Here goes the procedure to install NACHOS in a Linux system,

·         Copy nachos compiler (.../nachos/compiler) to /user/local

Next is to compile nachos.  So, forward to,

·         Copy another nachos folder (.../nachos/ nachos) to any folder under the root directory (/).

*        This .../nachos/ nachos has a folder named coff2noff

*        Say we placed it at /

·         Start terminal

·         Go to the directory  /nachos/coff2noff and make it using the command

#         make

*        It will make OS binaries

·         Go to /nachos/code/test and make it using the command

#         make  

*        It will make text binaries

·         Go to /nachos/code/build.linux  and make it using commands,

#         make depend

#         make

*        It will build nachos

·         Now execute nachos by issuing the command

#         ./nachos –u

*        It will show some information about the compiled nachos

*        By now nachos is successfully compiled and run

·         Run a test nachos executable

#         ./nachos -x /nachos/code/test/file.io.o

*        So, a test file is also executed.

Run a modified file under the userprog directory

·         Go to /nachos/code/userprog/ and open a create a new *.cc and a new *.h file say new.cc and new.h as coded below,

new.h

#include

class SevenToTwelve{

public:    

void check();

};

new.cc

#include “new.h”

void SevenToTwelve::check(){

cout<<“this is kuetCSE2k5”;

}

·         Now this file is to be called from the main function of nachos.

·         Go to /nachos/code/threads/main.cc and append

                                #include “new.h”

Into include file section

·         Go to line309 and append

else if (strcmp(argv[i],”-13”)==0){

      SevenToTwelve sttObject;

sttObject.check();

      }

 

·         Go to /nachos/code/build.linux/makefile and add the new.cc , new.h and new.o in the specific section, like this,

 

USERPROG_H = ../userprog/addrspace.h\

      ../userprog/syscall.h\

      ../userprog/synchconsole.h\

      ../userprog/noff.h\

      ../userprog/errno.h\

      ../userprog/proctable.h\

      ../userprog/synchbitmap.h\

      ../userprog/table.h\

      ../userprog/new.h

 

USERPROG_C = ../userprog/addrspace.cc\

      ../userprog/exception.cc\

      ../userprog/synchconsole.cc\

      ../userprog/proctable.cc\

      ../userprog/synchbitmap.cc\

      ../userprog/table.cc\

      ../userprog/new.cc

 

USERPROG_O = addrspace.o exception.o synchconsole.o\

      proctable.o synchbitmap.o table.o\

      new.o

 

·         Go to /nachos/ code/ build.linux and recompile nachos using

#         make depend

#         make

·         From the console go to /nachos/ code/ build.linux and run the command

#         ./nachos -13

*        The output is

 

this is kuetCSE2k5

Thus, a user defined code snippet has been executed in nachos.

 

 N.B.: Make clean command may be used to clean the files from folder that were created while compiling.

And i will say more...

As new machines built on IC7 chips do not support fedora core versions prior to fc6, we could not install fedora 5. Again, nachos do not install on fedora core 6 or later. Hence, this document has been produced from comparative and imperative decisions. In addition, it may differ from the actual scenario.