Introduction

Secondary loader, sometimes refered as a boot sector, is a small (not more than 510 bytes due to the sector size limitation) program which actually loads the operating system. It knows the underlaying file system in order to find the OS image on the partition. It also knows some details about OS image in order to correctly transfer control to the image. It usually gets control from primary loader which is located in MBR. But sometimes, if partitioning of hard drive is not necessary, secondary loader could be placed in MBR and gets control directly from BIOS.

QNX6 for x86 systems with BIOS provides two types of the secondary loaders. ipl-diskpc2-flop is the secondary loader utilizing INT 13h function 2 (read sector) to read the OS image. This reading method is most compatible and allows to read the floppy disks as well as the hard disks. There is some limitation of this method. INT 13h function 2 uses old cylinder/head/sector (CHS) addressing model and cannot access the hard disk beyond 1024 cylinder. ipl-diskpc2 reads the disk by INT 13h function 42h (extended read). This is modern reading method utilizing 64-bit addressing model for the disk block to be read. Drawback of this method is in unsupporting of floppy drives. It worth to mention, the loader does not use all 64 bits of address, but 32 bits only, effectively limiting your hard drive space to 2048GB (anyway, most modern BIOSes still have more severe limitations).

Errors during boot up and how to interpret them

There are two possible error messages from the secondary loader in QNX6.

Any of these errors could be indicated or system can behave unexpectedly during start up if boot sector itself got corrupted. Also there is possibility that there is a confusion between how the disk geometry treated by BIOS and by dinit (or dloader). Don’t be afraid to reboot computer into BIOS Setup and check translation method used for your hard drive, likely you need LBA mode turned on.

If nothing of above helps, you may want to send me all information about your hardware and BIOS version, provided that you are using some custom loader downloaded from this site. I will not help you, but it might help me to improve the loader.

Rationale

QNX may keep two boot images .boot and .altboot on the QNX partition and QNX secondary loader allows to select which OS image you want to boot. It is a very useful feature, although the implementation has a huge drawback. Even if you want to boot default .boot image, you have to wait while timeout for keyboard input expires or strike a key as soon as possible. In other words, QNX6 computer without someone standing near by will waste about 2 seconds while rebooting. The problem could be solved by patching the standard loader in order to reduce the timeout, there is an excellent patcher’s guide at Rob Krten’s home page. Second solution might be a custom loader. To keep the useful feature in and rid of the timeout, I changed the way of choosing the boot image. Now, you have to do nothing for booting .boot, and you have to press Shift key and hold it down while booting computer for .altboot. Most BIOSes will not complain about Shift key held down. If your BIOS complains about Shift, try to hold Alt or Control key. If it still complains, try to set "Ignore keyboard errors" in BIOS Setup. If it does not help, you need a different custom loader, sorry.

Some other reasons for writting the custom loaders provided here:

Warranty

Downloading any of these loaders you do take all risks and responsibilities. I am not responsible for any loss or damage you may incur because of use or not use or misuse of these loaders and information provided on this page. I am not liable whatsoever happens.

How to download a loader

Right-click on a "Download..." link provided below in this document and choose "Save Target As..." in the drop-down menu. Some anti-virus software may complain about this file saying it contains a new modificated virus. Temporarily disable anti-virus monitoring while copying the file to the QNX partition in this case. As you might know what is virus in DOS (Windows) is not necessarily virus in QNX.

How to install the custom secondary loader

Be aware these loaders do not work with QNX 6.0 (aka QNXRTP). Download these loaders to /x86/boot/sys directory. Keeping loaders in this directory you may use short names of the loaders, for example "pc2-uniq" instead of "/x86/boot/sys/ipl-diskpc2-uniq". Note that QNX versions prior 6.2 do not handle short names correctly. Use dinit or dloader to install one of them into boot sector. Note that "dinit -B loader..." does not work correctly. It writes "pc2" loader even if you specify -F option without initializing the file system in version 6.1, and it only writes loader regardless of -b option in version 6.2.1. Examples:
# dloader /dev/hd0t79 pc2-f16
# dloader -d0x81 /dev/hd1t79 ./ipl-diskpc2-quiet

Do not use -m option of dinit if for some reason you want to change the greeting message. It simply did not work in QNX versions prior 6.2, but in the later QNX releases it works for standard loaders only. To locate the greeting message and patch it, dinit looks for string "Hit Esc". Since no one loader provided here has the message starting from that string, this method does not work. The greeting message is a null terminated ASCII string, and if you feel confident in hex editing use the spatch utility:
# spatch /x86/boot/sys/ipl-diskpc2-uniq

The loaders

Now, when you have carefully read all information above, here are loaders.

Universal QNX 6 Secondary Loader ipl-diskpc2-uniq

Initial release: 25 Mar 2005.

This loader combines reading methods used in both standard loaders ipl-diskpc2 and ipl-diskpc2-flop. This is the only loader here which is suitable for a floppy disk and/or an old BIOS. It performs multisector read, although the data chunks for the CHS read may be smaller in order to avoid "multitrack" read (some BIOSes do not support that). It checks BIOS for the extended read support and if the extended function is not available it tries to read image using CHS method. Hold the Alt key down during start up for loading .altboot.

Last revision: 01 Jun 2009. Download latest ipl-diskpc2-uniq

Fast QNX 6 Secondary Loader ipl-diskpc2-fast

Initial release: 16 Feb 2005.

This loader works with a hard disk only and BIOS INT 13h extention has to be supported. Therefore, it’s will not work with a many years old BIOS or a floppy disk. It reads as many sectors as possible in one INT 13h call.

Last revision: 01 Jun 2009. Download latest ipl-diskpc2-fast

Fast QNX 6 Secondary Loader with improved interface ipl-diskpc2-f16

Initial release: 16 Feb 2005.

This loader inherits all advantages of its ancestor pc2-fast plus:

Last revision: 01 Jun 2009. Download latest ipl-diskpc2-f16

Quiet QNX 6 Secondary Loader ipl-diskpc2-quiet

Initial release: 18 Feb 2005.

This is yet another successor of pc2-fast. As everyone can guess, this loader follows up the old *nix concept to be quiet if everything is going well. No greetings, no fancy dots. If you need to boot alternative image, you still have to press and hold down the Shift key during boot up.

Thanks to quiet nature of this loader and space that became available because of shorter code, the error messages of this loader are in more human readable form ever:

Last revision: 01 Jun 2009. Download latest ipl-diskpc2-quiet

TrueQNX QNX 6 Secondary Loader ipl-diskpc2-qnx

Initial release: 07 Apr 2005.

This loader does not provide any performance improvement over standard one ipl-diskpc2. It reads sector by sector. It does not check the BIOS extention availability. It reports about errors in the same poorly way, i.e. prints D when experiences disk I/O error and S when cannot find the QNX image signature. Finally, it does not even support greeting message. Simply there is no greeting message in this loader but stylish QNX logo. It is a sorta programming art, that’s why it is called TrueQNX loader. Screenshot is available here.

Last revision: 01 Jun 2009. Download latest ipl-diskpc2-qnx

/etc Photographs QNX Corner Home

©2004-2009, Eduard Kromskoy