THIS INFORMATION IS FOR RELEASES OF QNX PRIOR TO RELEASE 2.10. (i.e. QNX 2.05) 1. Booting QNX from Hard Disk 1.1 Requirements for Booting In order to boot QNX from hard disk you must have a version of QNX which is release 5A or later, a hard disk which has been par- titioned with the FDISK utility and a finger-printed BOOT floppy. 1.2 Installing QNX Release 5A of QNX will boot from a hard disk, once it is instal- led. The installation program (called HBOOT) requires a finger- printed floppy disk to be present at installation time. HBOOT removes the finger-print from the BOOT floppy, then installs it onto the hard disk. Once QNX is installed, the floppy disk is no longer required for booting. The install program (HBOOT) will only copy the finger-print from a BOOT diskette to hard disk once. You may de-install QNX from the hard disk if you wish, which will essentially copy the finger-print from the hard disk back to the BOOT floppy. This floppy can then be used to install QNX onto another hard disk. When you have used your floppy BOOT diskette to install QNX onto your hard disk, the floppy can still be used to boot QNX. It just can't be used to install QNX onto another hard disk again. 1.3 The BIOS driver QNX will boot from the active QNX partition on the hard disk, and begin execution with its search order set to the hard disk (drive 3). The sys.init file under the directory /config on the hard disk will be executed, after which a LOGIN message will appear on the console. While accessing the hard disk, QNX will use a BIOS driver which, although adequate for booting, may be inadequate in multi-tasking environments since it does not use interrupts. It is recommended that you remount the hard disk in the sys.init file to use the hard disk drivers supplied with QNX. For example: mount disk 3 /drivers/xt pa=qnx OR mount disk 3 /drivers/at pa=qnx Please refer to the QNX manual for more detailed information on mounting QNX disk drivers. In the protected version of QNX (ATP), a read-only AT disk driver is used if the system has booted from hard disk. Only 100% IBM AT compatible disk controllers are supported by this driver. It is necessary to mount a proper AT disk driver in this case. 1.4 Partitioning your Hard disk Make sure that your disk is partitioned with the FDISK command. Make the QNX partition that contains your boot file the active or bootable partition. 1.5 The HBOOT utility Use: hboot on floppy_drive hard_drive [+boot] OR hboot off floppy_drive hard_drive [+boot] The on option causes HBOOT to install QNX onto the hard disk by removing the finger-print from the QNX BOOT floppy, then instal- ling it onto the hard disk. hboot on 1 3 +b Copy fingerprint from floppy 1 to hard disk 3 The off option removes the finger-print from the hard disk and re-installs it onto the floppy diskette. hboot off 1 3 Transfer fingerprint from hard disk 3 back to floppy The +boot option causes the HBOOT utility to write a bootstrap loader program in the first block of the hard disk. This is also where the partition tables are kept. The bootstrap loader program is loaded into memory by the PC BIOS when the machine is powered on. This program scans the partition table looking for the bootable partition, loads the first block of this partition into memory, and begins execution of another bootstrap loader program which is found in that block. The SYS utility writes a QNX boot- strap loader in the first block of the specified QNX partition which will then boot in the specified QNX O/S file. The bootstrap loader created by the +boot option of HBOOT is com- patible with that created by the DOS FDISK utility when a hard disk is partitioned for the first time. The QNX bootstrap loader tells you which partition it is going to boot, and allows you to type in the number of a bootable DOS partition. If a key is not typed within a second or so, it proceeds to boot in the partition it has found. This facility allows the user to conveniently boot up DOS instead of QNX when the occasion arises. Some compatible PC's or AT's may have a different bootstrap loader placed in block 1 of the disk, in which case the +boot option should be avoided. If you are unsure of the compatibility of the bootstrap loader on your machine, try using the HBOOT utility first without the +boot option and see if QNX boots. If it does not, then use the +boot option. Be warned however that if the bootstrap loader is NOT compatible, you may sacrifice the ability to boot DOS from your hard disk. If you find that DOS no longer boots and you wish it to, you will have to use a diagnostics utility to re-format your hard disk, then re-partition it using your DOS FDISK utility once again. Re-formatting will destroy every file on your hard disk. Sophisticated (or desparate!) users might note that it is not really necessary to reformat the whole disk. just the last 2 bytes of the first block need to be cleared in order to cause the DOS FDISK utility to write a new bootstrap loader. In QNX this can be done by re-mounting the disk with a zero offset, then using the SPATCH utility to zero the last 2 bytes of block 1. mount disk 4 d=3 o=0 Drive 4 is a new unused drive spatch disk 4 1 00001:1f0: ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 55 AA ................ Use page down to get 00001:1f0 on the display. Please read the documentation on the SPATCH utility before attemp- ting this. 1.6 The SYS utility Use: sys drive filename [-pause] The file to boot (filename) must reside on the same drive as the bootable partition specified by drive. In networked systems, the SYS utility can be used to boot a PC from the operating system file found under the directory /netboot. sys 3 3:/netboot/os.2.05pc When this machine is powered on, it will boot the operating system found in this file. Non-networked versions of QNX are not provided with a NETWORK disk, so do not have the operating system available in the form of a file. A utility called READOS will create an operating system file from the operating system image found on the QNX BOOT disk. mkdir 3:/netboot reados 1 3:/netboot/os.1.25pc QNX BOOT disk in drive 1 sys 3 3:/netboot/os.1.25pc 1.7 Changing your boot file Once you are booting from hard disk, you may find the need to boot a newer or different version of QNX. The SYS utility may be used repeatedly to change the boot file. For example, a user with an AT might wish to alternate between his AT and ATP versions of QNX: sys 3 3:/netboot/os.2.05atp OR sys 3 3:/netboot/os.2.05at Installing QNX with HBOOT is not necessary the second or subse- quent time you use the SYS utility. 1.8 Summary To summarize, the following steps are performed in order to boot QNX from hard disk. 1. Make sure that the hard disk is partitioned, with a bootable QNX partition (use FDISK). 2. Install QNX onto the hard disk with the HBOOT command using your finger-printed BOOT floppy. 3. Create an OS file if necessary (using READOS), or choose a file from your NETWORK disk. Make sure that this file is copied to the hard disk partition which has been declared as bootable. 4. Invoke the SYS utility specifying the OS file you have chosen. 5. Make sure that the bootable QNX partition contains the fol- lowing files: - /config/sys.init - /config/pass if passwords are enabled - /cmds/login - /cmds/sh - all commands invoked in sys.init 6. Turn power on.