Preface to the First Edition by Rob Krten

I've been using QNX operating systems since 1982 when I was in my late teens, and started developing commercial applications under QNX a few years later. During those years, I've seen QNX's user base grow from just dozens of individuals to the large following it has today.

In the early days, people used QNX because they had a keen appreciation for the simplicity and elegance that the QNX operating system offered. It was, I believe, this simplicity and elegance that allowed those individuals to excel in their work. In those days you'd hear stories about how a team of programmers working with a competing OS were unable to complete projects after months of struggling, where a much smaller team of programmers who knew QNX finished the project in a much shorter time. And the end result was smaller and faster.

Note: For clarity, there are several QNX operating system versions. The original operating system, known simply as “QUNIX” was followed by “QUNIX 2”. Both of these ran on the early x86 processors. The next version was QNX 4 (note the name change from “QUNIX”). Finally, the latest version is known as the QNX Neutrino RTOS or (incorrectly) as QNX 6. In this book, we refer to this latest version, and call it simply QNX Neutrino.

Over the years, as I've worked with QNX, I've tried to adhere to the “simpler is better” philosophy. This is summed up most elegantly by J. Gall in his 1986 book, Systemantics:

A complex system that works is invariably found to have evolved from a simple system that worked.... A complex system designed from scratch never works and cannot be patched up to make it work. You have to start over, beginning with a working simple system.

This is the same idea behind object-oriented design, and the fundamental “design philosophy” of UNIX—lots of small tools with well-defined tasks, joined together to make a complex system.

Confirming the points made in all kinds of software design books, it's been my experience that trying to design a complex working system from scratch just doesn't work. As Gall says, you have to start with a simple system. And, as Frederick P. Brooks, Jr. says in the original version of The Mythical Man-Month, you should build a prototype, and be prepared to throw it away. Unfortunately, even some of today's management doesn't quite understand this basic philosophy. I personally think that The Mythical Man-Month should be required reading — by managers and software developers alike.

In this book I want to share my experience with the QNX Neutrino operating system, and show you lots of simple systems that work. These examples were developed over the years; some of them are even in commercial use today. The companies that I wrote them for on contract have graciously let me publish the source code (please see the “Thanks!” section, below). A few of the utilities were developed especially for this book — they were projects that I ported from QNX 4 to QNX Neutrino, or were written from scratch to illustrate interesting features of the OS.

What you'll find here are, for all intents and purposes, recipes — small, well-defined pieces of code, or utilities that do something on their own, and can be used as part of a larger system. I will explain step-by-step what the code does, why it was written the way it was (for example, what were the constraints? what was I thinking? :-)), how the code can be expanded, and so on.