OSLib Logo

SourceForge Logo
Project Overview
   What's required
   Compiling and Using
Mailing List
Related Links

Executing OSLib Programs

The binary program

Once you have compiled and linked your OSLib program, you obtain a program.xtn file that you may want to execute :)
As previously said, the binary executable is a MultiBoot compliant ELF or COFF file. As you read in the ``Compiling and Using'' page, you can run the executable from a 16 bit OS using the X extender. Here, we are going to explain how to use the GRUB boot loader.

Booting with GRUB

First of all, you have to download the boot loader from the GRUB Home Page and install it in the target machine or in a floppy disk. For information about how to install GRUB, read its documentation. If you don't want to install GRUB in your computer, you can simply download a floppy image from the GRUB site and install it on a floppy using the unix command dd or the program rawrite.exe running on MSDOS.

Once you have installed GRUB, copy the OSLib program you want to run in a directory that can be accessed by GRUB. GRUB can read a lot of different partition types, so you will not have problems. Let's assume that you copy your program in /boot/test.xtn on the first partition of the first EIDE disk of the target machine.

Now, reboot the target machine (inserting the GRUB floppy in the drive if you installed GRUB in a floppy). GRUB will boot up, presenting its prompt or a menu (it depends on the installation procedure you followed); if the menu appears, press `c' and you will have the GRUB prompt.

The first thing to do is to tell grub which program it has to load:

kernel = (hd0,0)/boot/test.xtn
Of course, if you copied your program in a different place, you have to change something... For example, if you copied it on the second partition of the first drive, you have to specify ``(hd0,1)'', and so on... If everything goes well, GRUB will tell you that it understood the binary, will show some information about it and will be ready to boot.

Let's go!!!

Now, your program is running... :)