About This Guide

Getting Started with QNX Neutrino: A Guide for Realtime Programmers is intended to introduce you to the QNX Neutrino RTOS and help you develop applications and resource managers for it.

Note: EDITOR'S NOTE: This book was originally written by Rob Krten. We continue to update it, while still maintaining his tone.

The following table may help you find information quickly:

To find out about: Go to:
Using processes and threads Processes and Threads
Sending, receiving, and replying to messages Message Passing
Working with times and timers Clocks, Timers, and Getting a Kick Every So Often
Interrupts Interrupts
Writing resource managers Resource Managers
Full source code for the examples Sample Programs
Terms used in QNX docs Glossary

Who this book is for

This book is suitable for anyone wishing to gain a good fundamental understanding of the key features of the QNX Neutrino RTOS and how it works. Readers with a modest computer background should still get a lot out of the book (although the discussion in each chapter gets more and more technical as the chapter progresses). Even diehard hackers should find some interesting twists, especially with the two fundamental features of QNX Neutrino, the message-passing nature of the operating system and the way device drivers are structured.

I've tried to explain things in an easy-to-read “conversational” style, anticipating some of the common questions that come up and answering them with examples and diagrams. Because a complete understanding of the C language isn't required, but is definitely an asset, there are quite a few code samples sprinkled throughout.

What's in this book?

This book introduces you to what the QNX Neutrino RTOS is and how it functions. It contains chapters covering process states, threads, scheduling policies, message passing, operating system modularity, and so on. If you've never used QNX Neutrino before, but are familiar with realtime operating systems, then you'll want to pay particular attention to the chapters on message passing and resource managers, since these are concepts fundamental to QNX Neutrino.

Processes and Threads
An introduction to processes and threads in QNX Neutrino, realtime, scheduling, and prioritization. You'll learn about scheduling states and QNX Neutrino's scheduling policies, as well as the functions you use to control scheduling, create processes and threads, and modify processes and threads that are already running. You'll see how QNX Neutrino implements SMP (Symmetrical Multiprocessing), and the advantages (and pitfalls) that this brings.

“Scheduling and the real world” discusses how threads are scheduled on a running system, and what sorts of things can cause a running thread to be rescheduled.

Message Passing
An introduction to QNX Neutrino's most fundamental feature, message passing. You'll learn what message passing is, how to use it to communicate between threads, and how to pass messages over a network. Priority inversion, the bane of realtime systems everywhere, and other advanced topics are also covered here.
Note: This is one of the most important chapters in this book!
Clocks, Timers, and Getting a Kick Every So Often
Learn all about the system clock and timers, and how to get a timer to send you a message. Lots of practical information here, and code samples galore.
This chapter will teach you how to write interrupt handlers for QNX Neutrino, and how interrupt handlers affect thread scheduling.
Resource Managers
Learn all about QNX Neutrino resource managers (also known variously as “device drivers” and “I/O managers”). You'll need to read and understand the Message Passing chapter before you write your own resource managers. The source for several complete resource managers is included.
Note: Resource managers are another important aspect of every QNX Neutrino-based system.
Contains definitions of the terms used throughout this book.
Other references
In addition to the custom kernel interface, QNX Neutrino implements a wide range of industry standards. This lets you support your favorite publishers when looking for information about standard functions from ANSI, POSIX, TCP/IP, etc.