dinit Fails in QNX 6.2.1 NC install

I used QNX a few years back and decided to pick it up again now that I’m getting into the field of embedded systems.

I’ll cut to the chase; I already have two partitions on this hard drive, one for Win2k and one for Linux. After more fiddling around with resize2fs and fdisk than I wish to relate, I had freed up about 3GB on the drive for QNX. When I run the QNX installer off the CD, things turn bad when it attempts to create the QNX partition and format it. Here is the (fatal) error I get:

Executing dinit -hq8 /dev/hd0t79 DINIT: can't open drive '/dev/hd0t79' : No such file

After rebooting, an examination of the partition table is confusing to say the least. For some reason fdisk incorrectly reads the disk geometry to have somewhere in the area of 204 heads and relatively few cylinders. It also shows all the partitions overlapping. In short; a mess. However, when I delete the empty QNX partition, ioctl the changes to disk, and restart fdisk, it then correctly reads disk geometry and the starting and stopping cylinders of each partition is correct. So I’m back to where I started; I have tried the same thing a few times with the same result.

Any ideas? Your assistance is greatly appreciated!

FYI is the correct disk geometry as read by fdisk:

[code]Disk /dev/hda: 20.0 GB, 20003880960 bytes
15 heads, 63 sectors/track, 41344 cylinders
Units = cylinders of 945 * 512 = 483840 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 10335 4883256 7 HPFS/NTFS
/dev/hda2 10336 34746 11534197+ 83 Linux[/code]

Edit - I tried manually creating a partition with id 0x4f (QNZ) that fills the remaining space with GNU fdisk. Then I booted QNX in Live CD mode and tried a dinit on the partition I created, which seemed to work, but when I tried to mount it mount reported a corrupted volume. Then I ran QNX fdisk and immediately noticed that it still reads the hard drive geometry incorrectly, even though GNU fdisk reads the geometry correctly. Below is my current partition layout; can ANYBODY tell me how to get QNX to read the hard drive geometry correctly?

[code]Disk /dev/hda: 20.0 GB, 20003880960 bytes
15 heads, 63 sectors/track, 41344 cylinders
Units = cylinders of 945 * 512 = 483840 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 10335 4883256 7 HPFS/NTFS
/dev/hda2 10336 34746 11534197+ 83 Linux
/dev/hda3 34747 41344 3117555 4f QNX4.x 3rd part[/code]

Edit 2 - I am fairly sure now that my drive is using ECHS addressing mode but QNX insists on using LBA. Using LBA is absolutely not an option for me since the BIOS setup program does not allow me to change any hard drive geometry settings. Therefore, I need to get QNX to read the ECHS geometry. I’ve tried booting the live CD (using 6.3.0 now), slaying devb-eide, and restarting it with the following arguments combinations:

[code]# ./devb-eide eide master=geometry=15:41344:63,chs &

./devb-eide eide master=chs &[/code]

Plus some other shot-in-the-dark arguments that didn’t work either; once I remount the filesystems fdisk still reports the LBA geometry. The use page for devb-eide says that geometry should be specified as heads:cylinders:sectors. Is this a typo perhaps? Can anybody verify that is the correct order? With the above listed combinations my hard drive simply isn’t recognized by devb-eide. I also tried replacing the number of sectors with 39070080 rather than 63 (63 is sectors/track; 39070080 is CHS or the total number of sectors), which had the same result as the other argument lists I gave.

Anybody have any insights? Please? If I sound desparate it’s because I am…

Update - Just in case anyone here is concerned to hear the conclusion of this matter (right…), I figured out a way to use QNX in its partition despite its using a different drive geometry than the other systems. It wastes several KB of space, but it works… Basically I had to use a port of an old version of dinit for Linux to initialize a QNX4 volume on the partition. Then I booted QNX 6.3 in Live CD mode and used its dinit utility to write the loader to the partition (no, QNX 6.3’s dinit would not correctly initialize the filesystem, but it would write the loader correctly). Then I copied the Live CD’s filesystem to the QNX4 volume (sans /dev and .boot and .altboot, of course). Finally I copied the appropriate ifs images to .boot and .altboot and added the appropriate entry to my bootloader (GRUB):

title QNX Momentics 6.3.0 rootnoverify (hd0,2) chainloader +4 boot

Partition table is mostly correct, no volumes overlap or are corrupted, I’ll call it a day…

Output of /bin/df -k under Linux:

Filesystem 1K-blocks Used Available Use% Mounted on /dev/hda2 11353892 6522092 4485776 60% / /dev/hda1 4883252 2755608 2127644 57% /mnt/windows /dev/hda3 3117552 1247332 1870220 41% /mnt/qnx

-uberpenguin