What is QNX?
That seems like an easy enough question, but the answer is fairly complicated. QNX is a company, a microkernel, a real-time operating system, and a development platform. To stay consistent, here's the QNX nomenclature this article will follow, though it is not official:
- QNX Software Systems is an Ottawa, Ontario, Canada, based company. From here on out, we'll call the company QSS.
- QNX 2.x and 4.x are older versions of the operating system, from microkernel up to development tools. This review will essentially ignore them.
- QNX Neutrino is the microkernel itself.
- QNX by itself, QNX 6.x, the QNX RTOS, and the QNX Neutrino RTOS will refer to the complete real-time operating system, not counting the development platform.
- QNX Momentics is the complete development platform.
What's an RTOS?
Again, a simple question without a particularly good answer. The abbreviation "RTOS" stands for real-time operating system... but unfortunately no one can agree on what "real-time" means, or even "operating system," for that matter. The raging debate about "what is real-time?" doesn't particularly impact a review of any given OS, but I'll outline a few points about people generally mean by it.
- Predictability. The time to complete a task must be bounded.
- Priorities. There has to be a way to interrupt a lower priority task to make sure that high priority tasks aren't starved.
- Scalability. Usually, when you think of scalability in computing it starts small and goes upward toward massive buildings chock full of IT people. In the case of RTOSes, scalability means stripping down the OS to the bare minimum required. If the RTOS is controlling a jet fighter, you don't need or want MSN Messenger, Real Player, or Solitaire. Some RTOSes need only a few kilobytes of storage and RAM to work.
- Robustness. There is no known way to prevent an electronic system from crashing. However, there are methods for both minimizing the chance of crashes and for graceful recovery from crashes.
The QNX Neutrino RTOS
QSS's crown jewel is the QNX Neutrino message passing microkernel. What's a message passing microkernel? The executive summary is that it is a specific solution to the problems of creating a Real-time Operating System. Skipping the technical details on how this works, for now think of QNX as "just another OS." In fact, to users and developers, QNX looks like any other POSIX-compliant system, e.g. Linux or Solaris. The underlying architecture may be vastly different, but type ls at a prompt and you'll see the familiar /usr, /bin, /home, and /root directories.
Supported architectures are ARM, MIPS, PowerPC, SH-4, StrongARM, XScale™, and x86. Currently, there is no 64-bit support. The Neutrino is a true multi-threaded, multi-tasking system, with several different modes of multi-processing. QSS refers to these as Symmetric, Asymmetric, and Bounded Multi-Processing. (SMP, AMP, and BMP, respectively). Again ignoring the technical details of these terms, the different modes allow developers to fine-tune the behavior of their applications for real-time tasks. BMP, for example, forces tasks to run on a specific processor.
File systems are not part of the microkernel, making it easy to load and unload as needed. QNX defaults to the qnx4 file system, a proprietary fs similar to other POSIX file systems. It includes support for images for use in ROM, NAND flash, and NOR flash, with Execute-in-place capabilities. There is also a RAM-disk utility. Recently, QNX released ETFS, or the Embedded Transactional File System. Essentially, this uses atomic transactions to ensure there are no file corruptions as a result of power-outages or a crashing program. ext2, DOS / FAT12, FAT16, FAT32 , ISO9660, and Joliet are also supported. Notably missing are ext3, JFS, XFS, ZFS, and ReiserFS. Of course, NTFS is not supported. Sharing with other systems is still fairly easy; both CIFS (client) and NFS (client and server) work fine. Briefly, QNX used a Package File System that was more of a hassle than a help; support remains but it is no longer a mainstream solution.
QNX has IPv4 and IPv6, plus its own proprietary network protocol. Message passing extends to the QNX network seamlessly, so that distributed computing is transparent. As a simple example, a drive on a remote machine could be mounted locally, whether or not the remote machine has it mounted. Since most advanced users think nothing of remote-mounting a drive, a more impressive example might be transparently accessing a remote serial port.
USB support is okay, but since most companies do not offer QNX drivers for their devices you are mostly limited to generic devices such as keyboards, mice, and storage devices. USB flash storage works like any other drive. There are a handful of printers that work on USB. Don't get your hopes up for much else.
Video card support is similarly essentially limited to nVidia, ATI, or Matrox. Even then, QNX has trouble keeping up with the fast pace of the graphics market.
Hardware support in general is a weakness when it comes to "standard" devices. The emphasis is on embedded hardware, such as Board Support Packages (BSPs) to allow QNX to boot on systems that don't have a BIOS. Writing or porting device drivers is fairly straightforward, provided with documentation for a given device. QNX has several Device Driver Kits (DDKs) to ease development, as well as POSIX conventions for direct access of hardware through port I/O and dual-port memory.