Installing and Running QNX Neutrino on an Embedded SystemBy Anthony Chisholm, R&D Application Engineer, VersaLogic Corp. A quick-start guide to the QNX Neutrino operating system. This technical white paper will familiarize new users with QNX and help to avoid some of the common pitfalls encountered during installation and operation. OverviewThis document is a quick-start guide to the QNX Neutrino operating system, with special consideration given to VersaLogic products. It can help to familiarize new users with QNX and avoid some of the common pitfalls encountered during installation and operation. QNX Neutrino is the latest offering from QNX Software Systems, Ltd. (QSSL), founded in 1980 and headquartered in Ottawa, Canada. It is an operating system designed from the ground up for embedded systems. It is based on a real-time microkernel, and maintains a strong focus on reliability and modularity. While it can run on very lean devices, it can also scale to large distributed or symmetric multiprocessing (SMP) systems. A QNX target is most often x86-based, but can also be based on PowerPC, MIPS, SH-4, ARM, or XScale architectures. As its name suggests, QNX is POSIX-compliant and similar in look and feel to UNIX and Linux. However, Neutrino architecture is not directly compatible with Linux and UNIX, and is also not compatible with its predecessors, QNX4 and QNX2. It will be worthwhile to add a note here on the potentially confusing system of QNX versions and naming conventions. QNX2 was the first major OS release from QSSL, and QNX4 was the second. When QNX6 was released, the package was logically broken down into 2 parts, the OS and the Graphical User Interface (GUI). The OS portion was dubbed QNX Neutrino, and considered separate from the Photon microGUI. Neutrino is also the name given to the microkernel at the heart of the OS. Later, QSSL released QNX RTP (Real-Time Platform), which was a superset of QNX6 that included tools for developers. QNX RTP was later enhanced and renamed QNX Momentics. As of this writing, the latest version of the QNX Neutrino RTOS is 6.2.1, and the latest version of the Neutrino microkernel is 2.1.3. Unless otherwise specified, these versions are implied throughout the document. Operation of QNX Neutrino has been verified on the following boards offered by VersaLogic:
InstallationThe QNX Momentics Development Suite is freely available for non-commercial use at http://www./eval/. Commercial users may also download a 30-day evaluation. The QNX Neutrino RTOS is on this CD, and can be installed onto an empty hard drive. Set up your target by attaching power, a keyboard, PS/2 mouse, display, CD-ROM drive, and a hard drive (preferably empty). If your target supports CD booting (as does the VSBC-8, Jaguar, and Bobcat), then use this method. Otherwise, create a boot floppy with the Windows utilities on the installation CD. Installation is straightforward, and can take as little as 5 minutes. After the installer reboots your target system, enter CMOS setup to make the hard drive your first boot device. If booting off the hard drive causes an "Unable to locate fs-pkg" error, then see Gotcha #1. After the first boot script runs, you are presented with the Video Card Setting dialog. If this dialog hangs the system, see Gotcha #2. All graphics chipsets used on VersaLogic CPU boards are supported by this installation CD. However, the hardware cursor must be disabled if your board uses the C&T 69030 video controller. Click Apply, and then Done to complete the video setup and the QNX installation. Log in as root, and explore the Photon GUI. Helpful TipsFor those familiar with a POSIX-style environment, QNX will feel mostly familiar. For others, there can be quite a curve to learn the basic operations. There is a sea of commands, the vast majority of which you will never use, and many with several pages of command-line parameters. This section will highlight several commands that will help a new user to get started quickly. As in Linux and Unix, many system administration and configuration functions are only available at the command line. Open a terminal window using the button bar on the right pane. Most commands and utilities are available at /bin, /sbin, and /usr/bin. To get command-line help on a particular QNX command, type:
You can also check the most up-to-date and detailed utility descriptions online at http://www./developer/docs/. General Usage TipsLook for a file anywhere in the filesystem:
List all currently running processes, including process ID and arguments:
Forcefully terminate a process by name:
Executing script files:For an often-repeated set of commands, it is helpful to build a script file, similar to a DOS batch file. To do this, make a text file (eg. commandlist) with one shell command per line. Then execute:
This opens up a shell on top of the one you're currently using, executes the commands in this new shell, then exits. So any shell-specific variables that you set up in the script, such as present working directory, will be lost when the shell exits. To prevent the new shell from exiting upon completing the script, use interactive mode by adding the "-i" parameter. Increase verbosity:If a program is producing unexpected results, you may want a more detailed report of what it is doing. Many QNX commands allow you to increase their verbosity by adding v's as arguments. Add up to four v's to get the most verbosity. Example:
Startup SequenceIt can be helpful to have a basic idea of how QNX starts up by default.
Prevent Photon from automatically starting at boot time:Create the empty file:
Connectivity TipsDisplay Ethernet network configuration:
Set up VSBC-6 networking:Unlike the rest of the VersaLogic boards, Ethernet on the VSBC-6 is ISA-based and not automatically set up during installation. To start the driver and set up network services via DHCP:
Mount a windows share over a LAN:
An example:
The contents of your windows share will now appear as a local directory at the mount point. Test RS-232 or RS-422 serial ports:
Working with Floppy DisksFormat a floppy QNX-style, and make it bootable:
Note: The ".ifs" file can be created with the "mkifs" utility (see below). Mount a QNX-formatted floppy:
Mount a DOS-formatted floppy:
Technical NotesThe mkifs UtilityIn an embedded system, it is desirable to customize and build your own Neutrino image to minimize footprint, speed boot time, and ensure that all needed functionality is present. The mkifs utility can be used to generate bootable images based on a script, or build file. The build file specifies what kernel to use, what modules and shared objects to include, and how to start up and configure the system. To form the image, files are pulled from the currently running environment, combined, and encapsulated into a header. The images generated by mkifs may be very small and can easily fit on a floppy disk. Instructions on how to create build files are beyond the scope of this document. For sample build files, look in "/x86/boot/build" or view the mkifs documentation at: http://www./developer/docs/momentics621_docs/neutrino/utilities/m/mkifs.html The output of mkifs is a boot image. This is the first file that gets loaded at boot time. To put these images into use, they must be copied to the boot device at /.boot or /.altboot. To boot from a newly generated image off a floppy disk, you must initialize the disk and write the image to the .boot file in the root directory. See the Helpful Tips section for help in performing these operations. NetworkingQNX Neutrino supports all the network controllers used on VersaLogic boards.
Setting up networking consists of loading and configuring the hardware driver and protocol interface(s). PCI Ethernet controllers will be automatically set up and configured to find a DHCP server at install time. You can also use the io-net command to manually start the driver and protocol interface. Specify the type of interface and the IP address of the interface on the command line. For example:
In this example, "en" specifies that the interface type is Ethernet, "0" specifies the first Ethernet interface. For communication with the Internet, you may also add a static route and specify its destination, netmask, and gateway. See the tcpip documentation for syntax details. Note that you must not execute io-net more than once, so specify hardware drivers and protocols at the same time, or load them separately with the mount utility. Alternatively, if you want to use DHCP, do not specify parameters for the tcpip protocol. Instead, after the io-net command, execute:
It will look for a DHCP server and download the configuration for the specified interface. If no interface is specified, dhcp.client will configure the first unconfigured interface found. GotchasHere are some issues that you may encounter while installing or getting started with QNX Neutrino.
### Anthony Chisholm R&D Applications Engineer, VersaLogic Corp. Additional ResourcesOS Compatibility: QNX compatibility information for VersaLogic SBCs Software Downloads: QNX Board Support Packages (BSPs) for VersaLogic SBCs QNX: OS resources and KnowledgeBase articles ### Pricing and company information was deemed accurate at the time of writing of this article. VersaLogic makes no claim or warranty that the information contained in this article will not become outdated. Last Revised: 01/07/04 |
|