TOC PREV NEXT INDEX

LynxOS Installation Guide


Booting LynxOS

Introduction

This chapter provides instructions for booting LynxOS, platform-specific details, and troubleshooting solutions.

Before booting LynxOS from the hard disk for the first time, it may be necessary to set up the development system's BIOS or hardware for LynxOS operation; see "Working with BIOS" below for more information.

The LynxOS boot process starts with preboot (the LynxOS preboot utility), that allows the user to select the hard disk, partition, and file to boot from. preboot uses built-in defaults that are set with the makeboot command. The default settings of preboot boot LynxOS from the same hard disk and partition from where preboot was loaded.

Once preboot is running, the user can change the root and boot devices, and boot LynxOS. Typically, both the root device and the boot device are the same, and are the defaults. The preboot utility can boot from the default devices; see "LynxOS preboot Utility" for details.

If LynxOS fails to boot successfully, some problems are due to minor BIOS and/or hardware variations. For further information, see "Troubleshooting Booting".

Working with BIOS

LynuxWorks regularly installs and boots LynxOS on PCs from various vendors using several kinds of BIOS and x86-compatible processors. However, due to the large number of PC vendors and rapid changes and upgrades to PC models, it is not possible to test LynxOS on all commercially available PCs.

For up-to-date information on supported hardware, see the Hardware Support Guide at www.lynuxworks.com and on the LynxOS Documentation CD-ROM.

LynxOS also requires the BIOS to set up the serial ports, parallel ports, and IDE channels. Setting Disable PnP OS and setting these devices to
not autodetect
in the BIOS ensures that these devices can be set up in the BIOS as required by LynxOS.

On PCI systems, if an ISA ethernet adapter is used, allocate IRQ 5 (or the adapter's chosen IRQ) to Legacy ISA mode from within the BIOS. When IRQ 5 is used for an ISA ethernet device, the on-board audio port (if present) should be disabled to prevent IRQ overlap. In general, ISA interrupts cannot be shared.

If an SMC EtherEZ/Ultra/Elite series Ethernet adapter is used, the memory range CC000-CFFFF (or the adapter's RAM region) should be allocated as ISA RAM space. Shadowing for this RAM segment should be disabled.

If a PC has multiple ethernet adapters, only one of the ethernet cards can be chosen during installation. All other interfaces should be disconnected from the network. Once LynxOS is installed, multiple network adapters can be configured.

Note: LynxOS supports some PC Card (PCMCIA) devices and drivers in certain configurations. Please contact LynuxWorks for more information.

The BIOS in many x86 development systems includes an option called LFB SIZE and a start address. In some development systems, this memory range is write-protected and used by system components such as himem.sys. This feature should be disabled when running LynxOS. If not, LynxOS may not recognize memory above this reserved write-protected region.

See the LynxOS User's Guide for default x86 DMA channels and IRQ allocations.

LynxOS preboot Utility

preboot is the LynxOS loader that provides a user interface prior to LynxOS
boot-up. This utility supports the loading of any LynxOS kernel located on any partition. With preboot, users can also load kernels on non-bootable partitions.

preboot defines two different devices for booting LynxOS: the root device and the boot device. The root device is where the LynxOS root file system is located. The boot device is the LynxOS image used to boot the system. In many cases, the boot device is the same as the root device; these two devices are discussed in detail in "Setting the Root Device" and "Setting the Boot Device".

Major and Minor Device Numbers

Both preboot and LynxOS identify each device driver in the development system with a unique pair of numbers: major and minor device numbers. The major device number defines the device controller/adapter (such as IDE or SCSI) that a given device is attached to. The minor device number defines the logical unit (or, in some cases, a software-defined subunit such as a disk partition) of a given device. For example, on x86 development systems all IDE drives on the primary bus have a major number of 0 to indicate that the drive is accessed through the IDE controller.

x86 Device Numbers

Major numbers for device nodes are determined by the order in which the drivers are included in the CONFIG.TBL file. Rearranging the driver entries in this file changes the major numbers allocated to devices controlled by those drivers. The following table lists the major number allocations based on the default CONFIG.TBL file. Any modification to CONFIG.TBL by the user may cause the major number allocations change. The default major device numbers are shown in the table below.

Default Major Numbers for Disk Devices (x86)  
Major Number
Description
Driver
0
Primary and Secondary IDE/EIDE
ide
1
Floppy
fd
2
Adaptec 1542 SCSI
sim1542
3
Adaptec 2940
sim2940
4
Adaptec 2940 U2W SCSI1
Adaptec 2940 UW Pro SCSI
Adaptec Ultra160 SCSI
simascsi2
5
SimBios 8xx
scsi810
1
The Adaptec 2940 U2W and 2940 UW Pro SCSI Adapters are controlled by the ascsi driver. All other Adaptec 2940 SCSI cards are supported by the a2940 driver.

2
This driver is available on the x86 DRM BSP only.

The default minor device numbers for x86 systems are shown in the table below.

Default Minor Numbers for Disk Devices (x86)  
Type
Device ID
Minor Numbers
SCSI
IDE
Disk
Partition A
Partition B
Partition C
Partition D
Addt'l Partition


0
0
16
32
48
64
+16
1
1
17
33
49
65
+16

2
2
18
34
50
66
+16

3
3
19
35
51
67
+16

4
4
20
36
52
68
+16


5
5
21
37
53
69
+16
6
6
22
38
54
70
+16
+1
(15 max)
+1
+1
+1
+1
+1
+16

To determine the device ID for an IDE disk, refer to the following table.

Device IDs for IDE Disks
IDE Disk Device
Device ID
Primary Master
0
Primary Slave
1
Secondary Master
2
Secondary Slave
3

PowerPC Device Numbers

The default major device numbers are shown below.

Default Major Numbers for Disks (PowerPC)  
Major Number
Description
0
RAM disk
1
SCSI devices including hard disk, CDROM, and tape
2
IDE Primary and Secondary

The default minor device numbers are the same as on x86 development systems; see the table "Default Minor Numbers for Disk Devices (x86)".

Setting the Root Device

The root device is the location of a LynxOS root file system. With the major and minor number of the device, the root device can be set using preboot.

On x86 and PowerPC Systems

To display the current default root device, enter the following at the
preboot
prompt:

Command? R ?

To set the root device to something other than the default, enter the following at the preboot prompt:

Command? R major minor

To set the root device for partition b of an Adaptec 2940 SCSI disk at ID 2, enter the following at the preboot prompt:

Command? R 3 34

Setting the Boot Device

The boot device is the location of the LynxOS kernel that is to be booted. In most cases, preboot automatically detects and selects the correct boot device. The preboot boot command is used to determine the boot device. The boot command has the following syntax:

Command? b <controller>.<device_id> <boot_dev_args> \ <root_dev_args> <boot_file>

In the example above, <controller> can be: ide, sd1542, sd2940, sdncr, or another driver. Additionally, other SCSI buses may be available. <device_id> is the desired drive's ID. <boot_file> is the name of the file on the selected drive to boot (normally /lynx.os). <boot_dev_args> and <root_dev_args> for ISA devices is a 16-bit I/O address of a specific ISA card. For PCI devices the argument is two 8-bit numbers, PCIBus and PCIDev, representing a specific PCI device. If one PCI or ISA card is present, the arguments are redundant.

For example, to set the boot device to partition b of a SCSI (2940 Adaptec) device at ID 3, enter the following at the preboot prompt:

Command? b sd2940.3b

To set the boot device to partition c of an IDE secondary slave device, enter the following at the preboot prompt:

Command? b ide.3c h3c

Specifying a Serial Port for Preboot on x86 Systems

The preboot output can be changed to a specific serial port or all serial ports in addition to the video console. To configure preboot with a specific port, use the following instructions. Note that these instructions are for x86 systems only.

  1. Edit the Makefile file in /src/bin/preboot.customer

  2. Remove the comment (#) for the serial port(s) to define. For example, change

#P1=DCOM1
to
P1=DCOM2
  1. Remove the uarts.o file.

  2. Rebuild preboot and use this binary with the makeboot command. The preboot output will now sent to the chosen COM port(s) in addition to the video console.

To disable the normal keyboard input, keyboard.c must be edited to change the kybd_ready() routine to return 0. This prevents Preboot from performing keyboard checks. Change the line:

int kybd_ready(void) {
return((__inb(KBCOM) & 1));

to the following:

int kybd_ready(void) {
return(0);

Troubleshooting Booting

The following table provides troubleshooting tips for problems that users may encounter when booting LynxOS.

Troubleshooting All Platforms

Problems and Solutions: All Platforms  
Problem
Solution
When I boot a kernel, the message "main file device not present" is printed.
This error message indicates that preboot cannot access the root file system. The message can appear if incorrect major or minor device numbers for the root file system are specified.
I made a new kernel and now it won't boot. How can I boot LynxOS?
This answer assumes that the development system had a bootable kernel at one time and that currently preboot boots successfully. When making a new kernel, (make install in /sys/lynx.os), the old kernel is moved to /lynx.os.old and the new kernel becomes /lynx.os. Try to boot the old kernel (/lynx.os.old) from the preboot command prompt. If this works, determine what changes were made to the new kernel that may have caused it not to boot.

If the above procedure has not been effective, observe what is happening with the kernel:

ˇ Did it display the LynxOS message when it tried to boot? If the message did not appear, it is probably a driver issue. Drivers are installed before the message is displayed for the kernel. If a new driver has been added, it may be what is crashing the kernel.
ˇ Did the message come up and then nothing appeared on the screen? If so, see "My kernel prints the banner message..." on the following page.
ˇ Did the "main file system not present" message appear on the screen? If so, see above.
preboot hangs when I try to boot a kernel.
Ensure that the boot devices are set to preboot default values. If you have made your own bootable disk device, preboot will not contain the driver needed to boot the kernel. The preboot source code and must be obtained and the driver added to preboot.
How do I boot from a different partition from the one specified in preboot?
Is there a limit on kernel size for booting?
The boot size limit, if using preboot, is 8 MB on the PowerPC and unlimited on the x86. However, when booting directly, the x86 image is limited to 512 KB.
My kernel prints the banner message, does some disk activity, then hangs. What's wrong?
The kernel prints a banner message when it first comes up, then /init is executed. Before init creates the login shell, it runs the script /bin/rc. All output is displayed on /dev/atc0. If the internal device number for /dev/atc0 and the major number of /dev/atc0 do not match, no output is displayed on the screen.

To fix this problem, reboot the development system and specify the old kernel /lynx.os.old at the preboot command prompt. Rebuild the device nodes as follows:
# cd /dev
# rm *
# mknod -a /etc/nodetab
# reboot -a
If there is no backup kernel, use the LynxOS installation media to access the kernel and make the device nodes.
ˇ Boot the installation CD-ROM/disk. Ignore the message about the installit utility.
ˇ Mount the device that contains the problem kernel onto the
directory /mnt.
ˇ Change to the device node directory in /mnt.
# cd /mnt/dev
ˇ Make the nodes.
# /mnt/bin/mknod -a /mnt/etc/nodetab

Troubleshooting x86 Platforms

The following troubleshooting table is specific to x86 platforms.

Problems & Solutions: x86-Specific  
Problem
Solution
I have successfully booted LynxOS, but can't access all of the available memory. Why?
In some instances, BIOS has allocated memory regions that LynxOS cannot access. From the BIOS setup, delete these memory allocations.
How do I boot LynxOS from a removable disk drive?
A removable device must be recognized by the development system BIOS in order to boot. The Adaptec BIOS, for example, has an option to "Support Removable Disks as Fixed Disk." This option should be set to All devices so all removable drives are treated as fixed disks and can be used as boot devices.
I moved my disk from an Adaptec 1542 SCSI controller to an Adaptec 2742/2940 SCSI controller. Now, preboot won't load the kernel. Why?
The major device used by preboot is incorrect for the current controller. Refer to "Setting the Root Device" for details on getting the new kernel to boot. Once LynxOS boots, type the following:
makeboot /preboot
This command updates the major number in preboot.
The SCSI controller on the PCI system works with DOS but not LynxOS.
There are usually two buses on PCI-based systems: the ISA bus and the PCI bus. PCI devices on the system communicate with the PCI bus about interrupts, DMA channels, and the like, so that the PCI bus knows how to assign resources. The ISA devices do not communicate this information to the PCI bus and resource conflicts may result. To fix this problem, use the PCI BIOS setup utility to enable the ISA cards on the development system. See BIOS documentation.
Why must preboot be used to boot a LynxOS kernel that is greater than 512 KB?
The LynuxWorks secondary boot loader begins in real-mode and is currently limited to the first 640 KB of memory. The boot loading code must be less than 512 KB to safely load in this memory region.



LynuxWorks, Inc.
855 Branham Lane East
San Jose, CA 95138
http://www.lynuxworks.com
1.800.255.5969
TOC PREV NEXT INDEX