Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title Booting problems sharing a hard-drive with another OS.
Ref. No. QNX.000009297
Category(ies) Installation, Configuration
Issue I just installed QNX2 on my hard disk, which already has a DOS partition. I used the QNX boot loader by specifying the "+q" option to the boot utility, and now my machine will no longer boot from the hard disk.  How do I fix this?
Solution Some technical background might help you understand what's happened...

The Partition Table:

The very first sector on your hard disk (track 0, head 0, sector 1) is a special sector. When your motherboard's ROM-BIOS is booting your computer, it will read that sector into memory and execute the code contained inside it. That sector is not all code though, its last 66 bytes are defined to be four 16-byte entries (called the Partition Table), which describe the partitions on the disk, followed by the two bytes "55 AA" (hex).
x09Those two bytes (55 AA) are known as the BIOS signature, if those bytes aren't present, your motherboard ROM-BIOS will think this sector is invalid and that there are no partitions on the disk.
x09The code at the start of the first sector looks at the four entries in the Partition Table and will attempt to boot the "active" partition by reading the first sector of that partition and by executing the second loader contained in that sector, which in turn finally loads the OS. This is the same for both DOS and QNX, by the way.
x09If you installed DOS on your hard disk first, DOS's fdisk utility wrote its boot loader as well as a Partition Table describing the DOS partition to the first sector of the disk.

The QNX Boot Loader:

x09When you created a QNX partition, you added an entry to that Partition Table using QNX's fdisk utility. And if you specified the "+q" option to the QNX boot utility, the boot loader code in the first sector of the hard disk was overwritten with the QNX boot loader code, which is compatible with the loader provided by PC-DOS and almost all MS-DOSes.
x09The good thing about the QNX boot loader is that it shows you the default active partition (1 to 4), then pauses to let you select another partition to boot from. For example, let's say you have a QNX partition as the default, but you want to boot from your DOS partition instead. When your computer is booting from hard disk and the "QNX loader" message appears, you can select the DOS partition on the fly simply by typing its partition number.

Using the DOS Loader to Boot QNX:

x09You don't have to Use the QNX boot loader to boot QNX-the DOS loader should load QNX just fine. Let's say you're using the DOS loader and QNX is the active partition. In order to boot DOS from your hard disk, you must run the QNX fdisk utility and permanently change the active partition to DOS. Then, to boot QNX from hard disk, you must run the DOS fdisk Utility and change the active partition to QNX.

To change the active partition:x09you must run:
from QNX to DOSx09QNX fdisk utility
from DOS to QNXx09DOS fdisk Utility

x09It's probably easier to boot from a DOS floppy if you can't use the QNX loader on your machine.

Now to Answer Your Question...

x09The thing that probably caused your problem is that the QNX boot loader is somewhat bigger than the DOS loader - it takes more code to provide that "override" capability we talked about above. We suspect that some OSes store some special data right before the Partition Table.

How to Restore an Original Boot Loader:

x09If you installed QNX using the January 26, 1990 (or later) version of boot, you can restore the original DOS loader. This version of boot saves away the original boot loader to the file /config/hdisk.ldr. If you later execute the boot command with the new "-q" option, the original boot loader will be written to the hard disk and your problems should go away.
x09Note also that the January 26, 1990 version of boot now writes less to the boot sector than earlier versions. Simply using this new version of boot with the "+q" option might solve your hard disk problem, because the new boot writes 75 bytes less to the partition sector than the old version.
x09You may also notice that as of January 26, 1990 there's a new version of fdisk on the Update System. This version of fdisk will never write the QNX boot loader. The new fdisk also supports a "+r" option, which removes the "55 AA" (hex) bytes from your partition selectors very drastic move that would effectively destroy all partitions on your hard disk. Use the "+r" option with care!