Running Bochs and Geekos on the Detective Cluster

 

Bochs is an x86 simulator that allows you to run x86 operating systems without having to have the real hardware.  Even more important it is much easier to develop an operating system that using an emulator rather than the raw hardware.  Remember from class that when an OS running on raw hardware crashes, the hardware must be rebooted (and often power cycled).

 

Geekos is a simple operating system kernel that will be used as the basis of the class projects.  The geekos kernel runs under the bochs simulator.  The kernel we provided you has enough code in it to start the x86 processor into 32bit mode, install a simple keyboard driver, and support having multiple threads of execution all running in kernel (ring 0) mode.

 

Since Bochs also provides an emulator for the PC screen, you will need to get the associated fonts working to use the system.  Thus there are really two steps involved.  First you must get your environment in your class account setup. Second you must also configure the display that you will use to see the bochs emulated screen.

 

Getting bochs set to run on the DC cluster:

 

·        Download the project 0 tar file.

·        Bochs has been installed in the DC Cluster under /home/research2/bobby/bochs-1.1.2

·        GCC cross compiler, NASM, BINUTILS are all under /home/research2/bobby/test/a/bin. Edit your shell startup script (normally .cshrc) to include /home/research2/bobby/test/a/bin in your path. You will also want to comment out the lines of the form “setenv PATH” from your .login file.

·        You will need to override the default filesize limit for your account.  Remove the following line to your .login

Limit filesize 1000

·        The version of Bochs available is 1.1.2 and not the latest 1.2.1. Please note that debugging is not enabled in the installation.

·        When it starts up, bochs reads a file called .bochsrc that defines the attributes of the processor to be emulated.  The sample file we provide on the class page should be sufficient to get start.  This file should have been included in the tar file containing the geekos kernel.

·        Delete all unwanted files. Geekos requires a 2 MB hard-disk file. Since your account is only for 10 MB, please clean up your accounts and make space of at least 3MB.

·        Use gmake instead of make. Geekos requires gnu's make utility.

·        While running gmake, if you encounter the following error in the DC cluster

        perl pad setup.bin 512

        Insecure dependency in open while running setgid at/usr/local/lib/perl5/

        alpha-dec_osf/5.00404/IO/File.pm line 164.

        gmake: *** [setup.bin] Error 2

 

            run

                                % perl pad setup.bin 512

 

You should then be able to run gmake again. You may encounter a similar error again, but with kernel.bin and zerofile. Again run :

                                % perl pad kernel.bin 512

              % perl zerofile hd.img 4096

 

You should then be able to run gmake again. Now you should be ready.

 

Getting ready to run bochs UI on your GLUE/WAM accounts

 

·        Download the fonts directory on the class page into the GLUE or WAM accounts from which you are working. These directions assume you are using a Solaris machine. Once you have downloaded the fonts type:

 

             % xset fp+ < path of the fonts directory you have copied>

                                            

For example, if you saved them in your home directory as fonts, the command would  xset fp+ ~<your login name>/fonts

 

·        Allow the DC cluster nodes to create a window on your workstation.  To do this, type:

                            % xhost +

           

Note: This is to be done on the machine in glue/wam lab in which you are working. You will have to do this each time you login.

 

    Run bochs

Make sure you run bochs from your geekos directory. Otherwise bochs will not run geekos correctly. You can alias the command by adding it in the .cshrc file as

alias bochs '/home/research2/bobby/bochs-1.1.2/bochs'. The command to run it is:

           % /home/research2/bobby/bochs-1.1.2/bochs