Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Advanced QNX Neutrino RTOS development patterns for automotive applications Covers 2 topics across qnx domain. Includes 2 skill files covering .
.claude/skills/pangzhenying2025-automotive-qnx/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 141% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 79% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 100% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 99% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 152% | 0% |
2 skill files covering qnx domain for automotive software engineering.
QNX Neutrino is a POSIX-compliant, microkernel-based RTOS widely used in safety-critical automotive systems (ADAS, digital cockpits, gateways). Its microkernel architecture runs device drivers and file systems as user-space processes, providing fault isolation that is essential for ISO 26262 compliance. QNX is pre-certified to IEC 61508 SIL 3, making it suitable for ASIL-D automotive applications.
User Space:
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│ App:ADAS │ │ App:Diag │ │ Driver: │ │ Driver: │ │ File │
│ Control │ │ Service │ │ CAN │ │ Ethernet │ │ System │
└────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘
│ │ │ │ │
═════╪════════════╪════════════╪════════════╪════════════╪════════
│ Message Passing (MsgSend/MsgReceive/MsgReply)
═════╪════════════╪════════════╪════════════╪════════════╪════════
│ │ │ │ │
┌────┴────────────┴────────────┴────────────┴────────────┴────┐
│ QNX Neutrino Microkernel │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Threads │ │ Signals │ │ Timers │ │ Interrupt│ │
│ │ Scheduling│ │ Sync │ │ Clock │ │ Dispatch │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
└─────────────────────────────────────────────────────────────┘QNX provides several IPC mechanisms, each suited for different use cases:
| Mechanism | Latency | Data Size | Blocking | Use Case | |-----------|---------|-----------|----------|----------| | Messages | ~1-5 us | Arbitrary | Synchronous | Client-server communication | | Pulses | ~0.5 us | 32-bit value | Asynchronous | Event notification, ISR to thread | | Shared Memory | ~0 (direct) | Arbitrary | None (needs sync) | Large data (sensor, video) | | Signals | ~1 us | Signal number | Asynchronous | Legacy POSIX compatibility |
QNX message passing is synchronous and forms the basis of the entire OS:
Client Server
│ │
│ MsgSend(coid, ...) │
├────────────────────────►│ MsgReceive(chid, ...)
│ (client BLOCKED) │
│ │ Process request...
│ MsgReply(rcvid, ...) │
│◄────────────────────────┤
│ (client UNBLOCKED) │The three-phase send-receive-reply protocol ensures that:
Pulses are lightweight (40-byte), non-blocking notifications ideal for:
Pulse codes from _PULSE_CODE_MINAVAIL to _PULSE_CODE_MAXAVAIL are available for application use. System pulses use codes below MINAVAIL.
Resource managers are QNX's device driver framework. Any process can register a pathname (e.g., /dev/can0) and handle POSIX I/O operations:
open() -> io_open handlerread() -> io_read handlerwrite() -> io_write handlerdevctl() -> io_devctl handler (ioctl equivalent)close() -> io_close handlerThis allows applications to interact with custom hardware using standard POSIX file operations, simplifying application-level code.
QNX supports three POSIX scheduling policies:
| Policy | Behavior | Use Case | |--------|----------|----------| | SCHED_FIFO | Run until blocked or preempted by higher priority | Safety-critical real-time | | SCHED_RR | Round-robin among same-priority threads | Fair sharing | | SCHED_OTHER | System-defined (sporadic in QNX) | Non-real-time tasks |
Priority range: 1 (lowest) to 255 (highest). Priority 0 is the idle thread. Typical automotive allocation:
QNX interrupt handling follows a two-level model:
(read status, clear interrupt, return event)
user space with full OS services available
This model keeps interrupt latency low while allowing complex processing in a safe, preemptible context.
For large data transfers (camera frames, LIDAR point clouds), shared memory avoids copying. Always use synchronization:
pthread_mutex with PTHREAD_PROCESS_SHARED attribute for cross-processatomic_add, atomic_cmpxchg) for lock-free countersThreadCtl(_NTO_TCTL_RUNMASK, ...) for CPU affinity on multi-core SoCstracelogger and pidin for debugging scheduling and timing issuesQNX Neutrino is a commercial, POSIX-compliant, microkernel RTOS used extensively in automotive systems. Unlike monolithic kernels (Linux), QNX runs all drivers, file systems, and protocol stacks as user-space processes communicating via message passing. This architecture provides:
The QNX SDP includes compilers, libraries, and tools for multiple targets:
QNX SDP 7.1/8.0
├── host/linux/x86_64/ Host tools (compilers, debuggers)
│ └── usr/bin/
│ ├── qcc QNX C/C++ compiler driver
│ ├── ntox86_64-g++ Target-specific G++
│ └── ntoaarch64le-g++
├── target/qnx7/ Target sysroot
│ ├── x86_64/ x86-64 target libraries
│ ├── aarch64le/ ARM64 target libraries
│ └── armle-v7/ ARMv7 target libraries
└── usr/qde/eclipse/ Momentics IDEbash# qcc is the compiler driver that selects the correct target toolchain # Syntax: qcc -V<compiler>_nto<target> [flags] source.c # x86-64 target qcc -Vgcc_ntox86_64 -o app_x86 main.c # ARM64 target (i.MX8, R-Car H3) qcc -Vgcc_ntoaarch64le -o app_arm64 main.c # ARMv7 target (i.MX6) qcc -Vgcc_ntoarmv7le -o app_armv7 main.c # C++ with optimization qcc -Vgcc_ntoaarch64le -std=c++14 -O2 -o app main.cpp -lstdc++
Every QNX process is a full POSIX process with:
Process A (Client) Process B (Server)
┌─────────────────┐ ┌─────────────────┐
│ Thread 1 │ │ Thread 1 │
│ │ │ │ │ │
│ ├─Connection──┼───────────┼──►Channel │
│ │ (coid) │ message │ │ (chid) │
│ │ │ │ │ │
└─────────────────┘ └─────────────────┘QNX unifies all resources under a single pathname space managed by process manager (procnto). Resource managers register pathnames:
/dev/can0 → CAN driver resource manager
/dev/ser1 → Serial driver
/dev/shmem/data → Shared memory object
/proc/ → Process information pseudo-filesystem
/net/ → Network-transparent access to remote nodesApplications use standard open(), read(), write(), close() to interact with any resource manager, whether it is a hardware driver, a file system, or a custom service.
QNX is a primary target for AUTOSAR Adaptive Platform deployments:
bash# Remote debugging via GDB # On target: start pdebug (debug agent) pdebug 8000 & # On host: connect GDB ntoaarch64le-gdb app_arm64 (gdb) target qnx <target_ip>:8000 (gdb) upload app_arm64 /tmp/app_arm64 (gdb) run # System profiling with tracelogger tracelogger -n 5 -f trace.kev # Capture 5 buffers traceprinter trace.kev # Text output # Process info pidin # Process listing pidin -f aAbBF # Detailed thread info pidin mem # Memory usage
| Domain | QNX Application | Key Feature | |--------|----------------|-------------| | Digital Cockpit | Instrument cluster, HMI | GPU composition, Screen Framework | | ADAS | Sensor fusion, planning | Deterministic scheduling, hypervisor | | Gateway | CAN-Ethernet bridge | Resource managers, high throughput | | Telematics | OTA, connectivity | Networking stack, security | | Hypervisor | Multi-OS (QNX + Linux) | QNX Hypervisor for type-1 isolation |
qcc compiler driver instead of calling target compilers directlyQNX_HOST and QNX_TARGET environment variables before buildingon -f -p<priority> to set process priority at launch| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 9,874 | 10,138 | +3% | 1 | 1 | 0% | 2,140 | 5,161 | +141% | 0 | 0 | — |
case-02 | fail→pass | 12,620 | 10,517 | -17% | 1 | 1 | 0% | 2,825 | 5,065 | +79% | 0 | 0 | — |
case-03 | pass→pass | 16,628 | 15,329 | -8% | 1 | 1 | 0% | 2,792 | 5,578 | +100% | 0 | 0 | — |
case-04 | pass→pass | 14,446 | 11,636 | -19% | 1 | 1 | 0% | 2,537 | 5,036 | +99% | 0 | 0 | — |
case-05 | pass→pass | 9,449 | 10,069 | +7% | 1 | 1 | 0% | 1,897 | 4,772 | +152% | 0 | 0 | — |
case-06 | pass→pass | 7,946 | 5,345 | -33% | 1 | 1 | 0% | 1,711 | 4,127 | +141% | 0 | 0 | — |
case-07 | pass→pass | 7,968 | 2,114 | -73% | 1 | 1 | 0% | 1,463 | 3,347 | +129% | 0 | 0 | — |
case-08 | pass→pass | 10,880 | 4,595 | -58% | 1 | 1 | 0% | 2,174 | 3,838 | +77% | 0 | 0 | — |
case-09 | pass→pass | 9,396 | 5,472 | -42% | 1 | 1 | 0% | 2,033 | 4,089 | +101% | 0 | 0 | — |
case-10 | pass→pass | 8,988 | 7,060 | -21% | 1 | 1 | 0% | 2,326 | 4,464 | +92% | 0 | 0 | — |
case-11 | pass→pass | 7,421 | 2,773 | -63% | 1 | 1 | 0% | 1,259 | 3,425 | +172% | 0 | 0 | — |
case-12 | pass→pass | 3,060 | 3,778 | +23% | 1 | 1 | 0% | 594 | 3,736 | +529% | 0 | 0 | — |
case-13 | pass→pass | 7,511 | 2,633 | -65% | 1 | 1 | 0% | 1,539 | 3,456 | +125% | 0 | 0 | — |
case-14 | pass→pass | 7,547 | 2,705 | -64% | 1 | 1 | 0% | 1,400 | 3,432 | +145% | 0 | 0 | — |
case-15 | pass→pass | 4,842 | 3,663 | -24% | 1 | 1 | 0% | 884 | 3,525 | +299% | 0 | 0 | — |
case-16 | pass→pass | 7,957 | 2,563 | -68% | 1 | 1 | 0% | 1,418 | 3,367 | +137% | 0 | 0 | — |
case-17 | pass→pass | 6,396 | 2,488 | -61% | 1 | 1 | 0% | 1,138 | 3,328 | +192% | 0 | 0 | — |
case-18 | pass→pass | 6,830 | 2,775 | -59% | 1 | 1 | 0% | 1,217 | 3,395 | +179% | 0 | 0 | — |
case-19 | pass→pass | 11,923 | 15,912 | +33% | 1 | 1 | 0% | 2,019 | 5,954 | +195% | 0 | 0 | — |
case-20 | pass→pass | 9,533 | 7,040 | -26% | 1 | 1 | 0% | 1,808 | 4,230 | +134% | 0 | 0 | — |
case-21 | pass→pass | 6,526 | 5,571 | -15% | 1 | 1 | 0% | 1,400 | 4,100 | +193% | 0 | 0 | — |
case-22 | pass→pass | 15,435 | 18,557 | +20% | 1 | 1 | 0% | 3,046 | 6,355 | +109% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.