Archives
 
 
 
  Special
 
 
 
  About Us
 
 
 

Newsletter
Free E-mail Newsletter from BYTE.com

 
    
           
Visit the home page Browse the four-year online archive Download platform-neutral CPU/FPU benchmarks Find information for advertisers, authors, vendors, subscribers Request free information on products written about or advertised in BYTE Submit a press release, or scan recent announcements Talk with BYTE's staff and readers about products and technologies

ArticlesQNX Forges Ahead


October 1994 / Core Technologies / QNX Forges Ahead

Outfitted with a new graphics microkernel, this compact, modular, and efficient real-time operating system supports an expanding range of applications

Peter D. Varhol

While the trade press obsessively focuses on Windows NT, OS/2, Chicago, and Unix, one elegant operating system that rarely makes headlines is QNX Software's QNX. Yet its list of features is impressive. QNX delivers 32-bit performance, achieves superb modularity thanks to its pure microkernel architecture, passes messages in a network-transparent way, and complies with Posix. It offers the benefit of looking and feeling a lot like Unix, without the cost (in overhead) of being Unix.

The heart of QNX is its tiny 8-Kb microkernel. Because this microkernel can fit entirely into the on-chi p caches of the Intel 486 and the Pentium, kernel calls execute very quickly. The microkernel's four main functions--interprocess communication, network communication, process scheduling, and interrupt dispatch--are exposed through a compact API. There are only 14 system calls.

QNX is a message-passing operating system. It uses blocking versions of Send, Receive, and Reply function calls. Messages do not queue; rather, they're copied from process to process. QNX Software says this approach yields performance comparable to that of traditional function calls.

Of course, the microkernel alone isn't a full-blown operating system. It lacks a file system, device management, and a command-line interpreter. These and other modules can be added to QNX to complete the package. The resulting operating system is correspondingly larger, but it's still quite small and capable compared to the 32-bit operating systems popular today.

The microkernel itself is useful in two ways. First, it can be used as-i s in an embedded system as a resource manager. Embedded systems usually do not require a file system or any of the other traditional user-level parts of an operating system. The microkernel and process manager alone can handle many embedded applications, such as electronic sensors or process control systems.

Second, the microkernel can perform all the kernel-level operations needed to support a more complete operating system. Its small size means that it requires less memory, leaving more memory for user-level programs. Although the QNX microkernel runs only on the x86 family of processors, it might be thought of as a hardware abstraction layer, shielding the systems programmer from the details of the underlying hardware. Additional modules can be developed to customize the operating system in a number of different ways.

Real-Time Distributed Systems

QNX has made its reputation in the real-time arena, typically supporting data acquisition and process control applications. For FasFax (Nash ua, NH), a leading developer of point-of-sale terminals for the fast-food industry, the ability to add custom modules to QNX was a compelling feature. FasFax uses QNX as the underlying executive for a distributed, real-time, point-of-sale information gathering and analysis system.

The FasFax development team, made up of operating-system hackers rather than the traditional MIS types that are more common in point-of-sale development, has built its own distributed message-passing architecture on top of the QNX system. This system implements the concept of actors that transport requests and responses and therefore can interface with a variety of external software.

QNX nicely supports this approach. Eric Strovink, FasFax's vice president of engineering, says no other modern operating system offers the same combination of portability, robustness, and cost effectiveness. The FasFax operating-system gurus use QNX message-passing only as the underlying transport mechanism for their own actors. Thanks to QNX's high performance and modularity, they can customize the surrounding environment to suit the needs of a modern, distributed, point-of-sale system while QNX handles the kernel-level management of processes and devices.

Message Passing for a Multiprocessor Solution

Other people highly value QNX's transparent networking, which relies on its intrinsic message passing. The network manager is not a part of the microkernel but is tied directly into it. There is a private interface between the kernel and the network manager, so that any messages passed from a local process to a remote process are queued directly to the network manager. This manager, called net, manages the sending and receiving of messages without regard to whether they are local or remote. In effect, the manager merges microkernels on separate nodes into a single, virtual microkernel.

The message-passing architecture, combined with networking services, effectively produces a seamless distributed system. From the standpoint of user processes, there is no difference between a local call and a call across the network. Likewise, all services above the microkernel are transparently accessible to all processes, whether or not they are local. For data acquisition purposes, QNX can also make use of a private connection between microkernels on a network. This lets the kernels share information about a data acquisition process without generating a lot of network traffic.

Both the seamless networking and the private data acquisition bus made QNX attractive to Georgia State University, which is using QNX to develop a conferencing system to support a remote learning initiative. The problem was how to apply as much computing power as possible, at the lowest possible cost, to multiuser inputs arriving via an ATM communications facility. According to engineer Hal Trebes, Georgia State is using a multiprocessor Intel box with a built-in SCSI bus between the CPUs, in addition to the standard PC ISA bus. Georgia State is using the SCSI bus for interprocess communication between CPUs, and the ISA bus to route input from an ATM-based telecommunications system. The interprocess communication will make use of QNX's ability to send messages between kernels along its private bus.

After getting a single multiprocessor system up and running, the university plans to extend the same technology to network several multiprocessor boxes and communicate among them with message-passing techniques that were established to communicate between CPUs in the same multiprocessor box. The result will be a virtual kernel with transparent interprocess computing, and so much computing power that the gating factor will be the rate at which ATM can deliver packets to the network.

Posix Compliance and Portability

QNX fully complies with Posix 1003.1 (APIs for process management, device I/O, and file-system I/O) and 1003.2 (syntax for shell and utilities). Code written to the Posix APIs can be developed in a familiar environment and then cross-compiled to an embedded system running the QNX microkernel. Alternatively, you can develop code directly on QNX using the Watcom 32-bit C compiler and port it to other platforms. (The FasFax development team relied on both strategies.) QNX also adheres to the draft standard for Posix 1003.13, minimal real-time systems.

I've been porting a conferencing system from SCO Unix to QNX. The source code and shell scripts I'm working with were written as generically as possible, and the port has been a breeze. I've only had to modify some pointers and type casts from the original source code and to make sure that some of the system calls worked in the same way. From the standpoint of an applications developer, QNX feels very much like Unix, with the differences rarely noticeable.

Photon and X for Windowing

In June, QNX Software announced initiatives supporting windowing systems and GUIs for QNX. Photon, QNX's new graphics microkernel, is built on the same principles as the QNX microkernel itself. It's a re source manager for graphical regions and events (which QNX refers to as photons). The Photon microkernel is about 20 KB of code plus 40 KB of data. Other necessary parts for a PDA (personal digital assistant) system include some shared libraries, VGA (or other) graphics drivers, and a pen-input driver. The total amount of memory needed for code and data is about 250 KB.

Photon doesn't assume that the end product is going to be a windowing system, and it doesn't include the window manager within the microkernel. This approach lends itself to a lightweight implementation for PDAs that don't use overlapping windows. If you do add Photon window manager, it costs an additional 30 KB of code and 64 KB of data.

FasFax's Strovink is excited about Photon and plans to move from his product's existing windowing manager to Photon--not only for compactness, but also for portability. The Photon microkernel uses APIs through its binary interface library that are compatible with X Window System.

QNX also comes with an implementation of an X server, announced at the same time as Photon. This X utilizes the QNX message-passing scheme for communication between QNX kernels, and TCP/IP for communication with other X servers. It is a full X11.5 implementation, with the Motif window manager, scalable fonts, and font server. The Photon APIs are a subset of the windowing and Motif APIs used for this implementation.

What is the purpose of a full X implementation on QNX? Process control systems do require human intervention. A manufacturing process, for example, can be monitored and controlled by a touchscreen at a supervisor's station. Accordingly, QNX Software has developed touchscreen drivers for its implementation of X.

Keep It Simple

QNX continues to maintain a compact and robust environment; its message-passing architecture ensures modularity and can be readily extended. New modules can be developed in user space and debugged at source level, and then deployed as kernel-level services. Thanks to the small number of APIs in the kernel and the limited number of APIs in the other QNX-provided components, systems-level programming is relatively straightforward, and the resulting code can be very reliable.

Clearly, QNX is an operating system to be reckoned with in the future. While many experts claim that message passing slows the performance of an operating system, numbers published by QNX Software indicate that QNX performs on a given Intel-based machine as well as, or better than, Unix. While its widespread adoption is limited by a lack of off-the-shelf applications software, surely there are enough real-time projects and custom software development efforts to keep this elegant operating system thriving well into the future.


Illustration: Photon, QNX's New Graphics Microkernel Applications place regions in the 3-D event space. Events traveling toward or away from the display intersect those regions.
Peter D. Varhol is chair of the graduate computer science and mathematics department at Rivier College in Nashua, New Hampshire. He can be reached on the Internet or BIX as pvarhol@bix.com .

Up to the Core Technologies section contentsGo to previous article: Alpha Rides HighGo to next article: Charting the UnchartedSearchSend a comment on this articleSubscribe to BYTE or BYTE on CD-ROM  
Flexible C++
Matthew Wilson
My approach to software engineering is far more pragmatic than it is theoretical--and no language better exemplifies this than C++.

more...

BYTE Digest

BYTE Digest editors every month analyze and evaluate the best articles from Information Week, EE Times, Dr. Dobb's Journal, Network Computing, Sys Admin, and dozens of other CMP publications—bringing you critical news and information about wireless communication, computer security, software development, embedded systems, and more!

Find out more

BYTE.com Store

BYTE CD-ROM
NOW, on one CD-ROM, you can instantly access more than 8 years of BYTE.
 
The Best of BYTE Volume 1: Programming Languages
The Best of BYTE
Volume 1: Programming Languages
In this issue of Best of BYTE, we bring together some of the leading programming language designers and implementors...

Copyright © 2005 CMP Media LLC, Privacy Policy, Your California Privacy rights, Terms of Service
Site comments: webmaster@byte.com
SDMG Web Sites: BYTE.com, C/C++ Users Journal, Dr. Dobb's Journal, MSDN Magazine, New Architect, SD Expo, SD Magazine, Sys Admin, The Perl Journal, UnixReview.com, Windows Developer Network