November 2008 mini Demo Release Notes 

7/12/2009 email chaos@ctpp.co.uk if you need more help

Only 2.5Mb in size (zipped 1499k), and containing 90% of the source code used to build this working microkernel. ChaOS operating system images load all the source code containers during booting, and can be browsed from inside the ChaOS debugger. Press PAUSE/BREAK key anytime, the press  v to open the source browser, select a file name then <ENTER> to see the source code for that file.

The demo boots to a Dos-style command-line interpreter (Unix shell) which expects the user to enter a command line then press the ENTER key. I have limited the demo to 7 ChaOS commands: help, date, time, realint, disp, boot and exit.

disp is a memory viewer -  to see the contents of memory at linear address 0x60000, at the demo prompt, type

=>disp 60000 <ENTER>

You will see something like, repeated 16 times:

0x00060000: bb bb bb ba bb bb bb bd bf c1 c2 c4 c4 c5 c7................ 

This is part of the ChaOS banner file from the boot sequence.

The realint command is the most powerful. In the earliest PC, BIOS provided services through software interrupts. Incredibly, over 20 years later all those software interrupts are still available in your computer's BIOS chip. A call to realint can, for example, read or write a hard or floppy disk sector. Modern operating systems such as Windows XP intercept calls to these services so bare-bones hardware access is not possible.

As PCs have advanced over the years, BIOS interrupts have adapted to new media but the interface remains the same. A memory stick plugged in at boot-time now appears as an extra hard disk, and can even be the boot device. So can a USB floppy or USB CDROM drive.

BIOS interrupt 0x13 is for disk services. (see Wikipedia BIOS Int 13), and here is an example which can be tried in this demo:

At the demo prompt, type:

=>realint   <ENTER>

The following display appears - but DO NOT PRESS ENTER until you are ready to execute the software interrupt (press ESC to quit realint)

Int 13:ax=0000 bx=0000 cx=0000 dx=0000 si=0000 di=0000 ds=0000 es=0000 fl=0000

ax,bx,cx,dx,si and di and so on are processor registers, ds and es are segment registers, and the numeric fields can be changed to hexadecimal values as desired; I will refer to hexadecimal numbers with the prefix 0x.  Try the following, taking care to set es to 0x6000:

Int 13:ax=0201 bx=0000 cx=0001 dx=0080 si=0000 di=0000 ds=0000 es=6000 fl=0000

realint is now set to read one sector from the start of drive 0x80 and place it in memory at real-mode address 0x6000:0x0000, which is the same as linear address 0x60000.

press <ENTER> to execute the interrupt - an extra line will appear:

Return:ax=0000 bx=0000 cx=0001 dx=0080 si=0000 di=0000 ds=0000 es=6000 fl=0202

ax=0001 means the function was successful, (i.e. 1 sector was read). press <ESC> to quit realint, then

=>disp 60000 <ENTER>

You will see the contents of the partition table on the Demo CD itself.

By setting dx=0x0081,0x0082,0x0083 and repeating the call you can see the partition tables of other boot media in your system. I plugged a USB memory stick into my computer and found:

ChaOS boot CD: 0x0080 Hard disk0(IDE0Master):0x0081 Hard disk1(IDE0Slave):0x0082 USB memory stick:0x0083