Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

dloader

Write a boot loader to a disk

Syntax:

dloader [-v] [-d drive_number] [-F|H] [device loader] ... 

Runs on:

x86

Options:

-d drive_number
Sets the BIOS drive number for booting the second stage loader (diskpc2). This enables you to set up the loader to boot when the drive is configured as either a primary or secondary drive. Common values for drive_number are: 00 for the first floppy drive, 80 for the first hard drive, and 81 for the second hard drive.

If you don't specify this option or any of the other override options (-F, -H), a heuristic based on disk size and removability determines whether the drive is for a fixed or floppy disk. The order of precedence used to determine the drive number to be patched into the loader code is:

  1. -d
  2. -F
  3. -H
  4. heuristic
-F
Floppy loader override.
-H
Hard disk loader override.
-v
Be verbose.
device
The name of the raw or partition disk mountpoint.
loader
The name of the loader.

Description:

The dloader utility writes a boot loader to a disk.

The dloader utility starts by looking for the loader you specified. If your loader name contains a / (slash), dloader assumes it is a complete pathname and looks for the loader using the path you gave; if not, dloader looks in the processor family subdirectory of QNX_TARGET (under QNX Neutrino, this would be /x86/boot/sys). To see the loaders provided in the default path, type dloader without any options.

The naming of QNX loaders provides a framework for specifying QNX and custom loaders. This framework consists of a loader name and a method of specifying optional variants.

Currently, QNX Neutrino provides the following two standard loader names:

pc1
This is the standard first-stage (partition) loader on a PC.
pc2
This is the standard second-stage (QNX specific) loader on a PC.

Along with these two standard loaders, we also provide loader variants named pc1-flop and pc2-flop. These variants provide alternative loaders that are designed to work with floppy diskettes (or a hard disk with a capacity less than 8 Gbytes in an old PC with an old BIOS).

Similarly, users who wish to create and use their own loaders can specify them using unique variant names.

The device names for our loaders are prefixed with ipl-disk. So if you look in /x86/boot/sys/ under QNX Neutrino, you will see the following loaders:

If you write your own loaders, make sure you use this ipl-disk prefix.


Note: If the loader is in the /x86/boot/sys/ path, you don't need to specify the ipl-disk prefix on the command line because dloader adds it for you. If your loader is in a different directory, you have to specify the exact path, including the prefix.

Assuming you specified a device and loader correctly, dloader opens the device in the path you specified and, if you selected the verbose option, displays its disk and partition information.

The specified loader data is then put together and written to the disk.


Note: The floppy (-F] and hard disk (-H] override options let you force dloader to treat a fixed device (e.g. a hard disk) as if it was a removable device (e.g. a floppy), and vice-versa.

Examples:

To see a list of available disk loaders:

dloader

To write a PC partition loader to a hard disk:

dloader /dev/hd0 pc1

To write a custom partition loader to a hard disk:

dloader /dev/hd0 /home/joe/ipl-diskpc1-tst

To write a QNX-specific second-stage PC loader to a QNX partition:

dloader /dev/hd0t79 pc2

To write a QNX loader to a floppy disk :

dloader /dev/fd0 pc2-flop

Environment variables:

QNX_TARGET
The pathname of the host (under QNX Neutrino this is not set).

Exit status:

0
The loader was written to the disk.
Any other value
An error occurred.

Errors:

When an error occurs, dloader sends a description of the error to stderr.

See also:

fdisk, dinit