Skip navigation.
The QNX Community Portal

View topic - Forcing IDE slave to hd1 when master is absent

Forcing IDE slave to hd1 when master is absent

All topics.

Forcing IDE slave to hd1 when master is absent

Postby peter301 » Wed May 04, 2011 3:56 pm

I am running 6.4 on an AMPRO CM430 and working on a boot script and boot image to minimize boot time. The CM430 CF drive is presented as the slave on IDE channel 0. By default (devb-eide), when an external HD (master) is installed, the CF drive is hd1, and when there is no master, the CF drive is hd0.

In production (and test) there will only be the CF card. For development, I attach an external HD.

I am trying to write a boot script (for the CF card only) that explicitly (to reduce boot time. e.g. no searching for .diskroot) mounts the CF card as /, and I want it to work with or without the ext HD (master) attached.

Question: Can I force devb-eide to name the slave device hd1 even when no master is present? Specifically, is there a driver option for devb-eide (or any of the associated drivers) to do this?

I _can_ set a jumper on the CM430 to map the CF to the master channel (yes, this _will_ completely solve the boot script problem), but this is _not_ the factory default, and this board may be installed in our product by a contract manufacturer. Currently, there are no physical configuration steps required on the CM430, and I would like to keep it that way, if possible, to minimize manufacturing errors.

Given all the driver options available, it seems this should be possible. If it is, I have not found it yet.

New Member
Posts: 8
Joined: Thu May 28, 2009 2:53 pm

Postby Tim » Wed May 04, 2011 5:23 pm


Take a look at the blk options ( in the doc's) to devb-eide.

If it's possible that's where the option is going to be.

I use the automount for our Ampro board's CF as shown below.

devb-eide blk cache=2m,automount=hd0t79:/ &

Of course I don't sometimes attach an external HD as you do that would force my slave CF to hd1.

Maybe you can just get away with an .altboot image for development that has the external HD and CF mounts specified and then boot using the .altboot image in development.

Senior Member
Posts: 1388
Joined: Wed Mar 10, 2004 12:28 am

Postby peter301 » Thu May 05, 2011 4:53 pm

Thanks Tim,

I think this is what I am looking for:

'devb-eide eide nomaster'

Based on your suggestion to use .altboot I played around with that approach (rather, multiple images on a qnx6 fs) and stopped staring at driver options. Works fine, but I would prefer to avoid the extra delay associated with the boot image selection menu timeout.

Once my attention was shifted away from driver options, I found the simple driver option I should have found in the first place.

Rather than looking for an option to force the slave device name to be fixed regardless of the presence of a master, I should be looking for an option to force the controller to ignore the master so the slave is always found first, regardless of the presence of a master. This is the 'eide nomaster' option.

I set the BIOS boot order to Slave first, Master second. For production, and testing, the system will always boot from the CF drive, with or w/o a master attached, and the CF drive will always be hd0, so my CF drive boot script can explicitly map hd0 to /. Like this:

'devb-eide eide ioport=0x1f0,irq=14,pio=4,nomaster blk automount=hd0t179:/'

If I do attach my ext HD (dev system)to the master channel, and override the boot order (fortunately, my BIOS has a hotkey for this), I can boot to the ext HD and a generic QNX install. The CF drive will now be mapped to hd1, but I don't care when booting a development system.


For those who got here desperately searching for any help with boot scripts and all things bootable, here is what I learned:

1. 'devb-eide eide ioport=0x1f0,irq=14'
'ioport=0x1f0' forces the eide driver to scan _only_ the primary EIDE controller (at legacy address 0x1f0). 'devb-eide eide' will scan both the primary _and_ secondary controller (even if the secondary controller is disabled in BIOS). Scanning for the secondary controller takes time. This option reduces the boot time a bit (I don't have any measurements).
I though 'devb-eide eide chnl=0' would do this, but based on slog inspection I suspect either a) chnl refers to something other than 'primary/secondary (like master/slave or some PCI stuff), or b) 'chnl=' is an assignment (or override) rather than a restriction (like 'ioport='). Don't really care any more.
I also found that specifying the irq _is_ necessary if you specify an ioport. I thought that if I only specify an ioport, a default irq would be used. Not.

2. 'devb-eide eide pio=4'
Maybe this is not necessary. It's just the right value for the CF drive I use. Found it in BIOS and slog inspection.

3. 'devb-eide eide nomaster'
The point of this post. Force the eide driver to ignore any device on the master channel of the controller, so that a device on the slave channel will always be the first device found (and always be named hd0).

4. 'devb-eide blk automount=hd0t179:/'
By telling the blk driver to mount hd0t179 as /, I do not have to include the 'mount' binary in the boot image. Every little bit counts (a smaller image loads faster). Otherwise, I would have to include 'mount -t qnx6 /dev/hd0t179 /' in the boot script, and the 'mount' binary in the image.
Incidentally, the mounting is the only real obstacle in the problem I described. If I do not know the name of the CF drive (because there may or may not be another device on the master channel when this boot script executes), then I can not mount the CF drive. Rather, a script would have to iterate through all detected devices, mount them, and look for a clue indicating it is the device that contains the fs to mount as /. Mounting and un-mounting increases boot time ( a little bit).

Enjoy :-)
New Member
Posts: 8
Joined: Thu May 28, 2009 2:53 pm

Return to Cafe

Who is online

Users browsing this forum: No registered users and 1 guest