Building and Running the System


Untarring the file IanOS.tar.gz will result in a directory IanOS containing all of the source files required to build the system. Within this directory run the command:


to create a hard disk image c.hdd. Note that you will need to be root to run this command; if not logged on as root (you never do that do you!) you will need to use su or sudo. This hard disk image will be populated with some files by the Makefile in tasks. To access this hard disk image we use mtools. The file /etc/mtools.conf should be edited so that it contains a line similar to:

drive c: file="/home/ian/Projects/IanOS/c.hdd" offset=32256

(adjust the path to IanOS to suit your system).

Just in case you have any difficulty creating the hard disk image, I have included a gzipped pre-built blank disk. It's a 31MB download and unzips to base.hdd; you probably want to keep this safe and copy it to c.hdd in IanOS as it's easy to corrupt the disk image when playing with new things.

Now (still in directory IanOS) run the command make all to build the system. The result will be a floppy disk image file IanOS.fdd and a few files added to c.hdd. You can check that those files are there with the command:

mdir c:/BIN

which should produce a listing that looks something like:

.            <DIR>     2012-03-31   8:29
..           <DIR>     2012-03-31   8:29
TASK1             2432 2012-03-31   8:30
TASK2              488 2012-03-31   8:30
TASK3              376 2012-03-31   8:30
TASK4             1688 2012-03-31   8:30
PWD               1416 2012-03-31   8:30
LS                1792 2012-03-31   8:30
CAT                512 2012-03-31   8:30
EDIT              2992 2012-03-31   8:30

(only the file names are important).

Running with SimNow

Run simnow. At the main window choose the menu option File/Open BSD and open the file bsds/cheetah_1p.bsd. Then use the File menu to set the primary IDE disk and floppy disk to those that we have just created. At this point you should save the BSD so that you don't have to repeat this step every time you want to run the system. I have found simnow to be a little buggy when BSDs are opened and closed, so it's best to close simnow, restart it, and load the BSD that you have just created. Click on the run toolbar icon and the system will boot and run.

Running with qemu

IanOS will also run in qemu, which is considerably faster than SimNow. It also has the advantage of being able to debug the kernel and kernel tasks at the C-code level, rather than working at the assembler level. (Each has its place.)

Assuming that you have installed qemu, you should be able to run the system normally by typing ./IanOS from the IanOS directory.

To debug under qemu, open two terminal windows and change to the IanOS directory in each. Then follow these steps:

1. In one window type ./IanOSd. This will open a qemu window, but the system isn't running yet.

2. In the second window type gdb.

3. At the gdb command line type c.

4. The program will now start running in the qemu window. Wait until the #> prompt displays and then press ctrl-C.

5. The program is now interrupted, and the gdb display will show an error with a load of numbers; ignore this. Type file IanOS.o on the gdb command line.

6. The error clears, and a listing of the program is given. You can now debug just like any other C program, setting breakpoints and watches, inspecting data, stepping through code, etc.

gdb takes a bit of getting used to, but this is much easier than using the assembly level debugger in SimNow. There are also graphical interfaces such as ddd available. Note that the above instructions rely upon the presence of a hidden file .gdbinit in the IanOS directory. This is included in the source code.