Brand new QNX

When you get your brand new QNX license you download some image in anticipation of its internals. In short words you’ll discover QNX Momentics IDE with some libs and binaries. Let’s look inside.

The two main directories inside QNX root are host and target.

Roughly host directory consists of toolchains for different platforms (x86, arm, mips, powerpc). Note, armv8 toolchain is available only from QNX 7.0 version.

target directory consists of QNX binaries and libs (several sets for each platform) needed for QNX image or application deploy.

boot_sys

The core QNX binary is procnto — the unit containing kernel and process manager. QNX is a microkernel real-time OS. The best technical source are The Philosophy of QNX Neutrino and The QNX Neutrino Microkernel from official QNX documentation. Although I’ll give a brief description.

A microkernel OS is structured as a tiny kernel that provides the minimal services used by a team of optional cooperating processes, which in turn provide the higher-level OS functionality. The microkernel itself lacks filesystems and many other services normally expected of an OS — those services are provided by optional processes.

QNX microkernel functionality is limited with:

  • thread services via POSIX thread-creation primitives
  • signal services via POSIX signal primitives
  • message-passing services — the microkernel handles the routing of all messages between all threads throughout the entire system.
  • synchronization services via POSIX thread-synchronization primitives.
  • scheduling services — the microkernel schedules threads for execution using the various POSIX realtime scheduling policies.
  • timer services — the microkernel provides the rich set of POSIX timer services.
  • process management services — the process manager portion is responsible for managing processes, memory, and the pathname space.
  • interrupt services — interrupt handlers for real-time hardware preemption processing.
microkernel_services
from QNX official

All other applications, even hardware drivers are executed in user space and are out of the QNX delivery scope.

microkernel
from QNX official

In ${QNX_ROOT}/target/qnx6/${platform}/boot/sys directory you may also find procnto-instr binary — this is a so-called instrumented version of microkernel. Instrumented version allows kernel events tracing. Enabled logging is the only difference from simple procnto. So with according API it’s possible to trace process and threads creation/destroy, track IPC calls or implement custom events. I’ll introduce this mechanism later. From my QNX experience I can tell that all production QNX solutions were based on instrumented microkernel and allowed this very useful tracing. 

Another procnto version is the one with -smp postfix: procnto-smp or procnto-smp-instr enabling symmetric multiprocessing.

Of course procnto isn’t enough for QNX deploying and work on real hardware. In next article I’ll cover custom QNX image build and launch on a target platform.

 

Оставить комментарий