System Architecture
About This Guide
Note to Windows users
The Philosophy of QNX
Design goals
An embeddable POSIX OS?
Product scaling
Why POSIX for embedded systems?
Multiple OS sources
Portability of development staff
Development environment: native and cross development
Why QNX for embedded systems?
Microkernel architecture
The OS as a team of processes
A true kernel
System processes
System processes vs user-written processes
Device drivers
Interprocess communication
QNX as a message-passing operating system
Network distribution of kernels
Single-computer model
Flexible networking
The Neutrino Microkernel
Introduction
The implementation of Neutrino
POSIX realtime and thread extensions
Neutrino services
Threads and processes
Thread attributes
Thread life cycle
Thread scheduling
When scheduling decisions are made
When thread is blocked
When thread is preempted
When thread yields
Scheduling priority
Scheduling algorithms
FIFO scheduling
Round-robin scheduling
Adaptive scheduling
Sporadic scheduling
Manipulating priority and scheduling algorithms
IPC issues
Thread complexity issues
Synchronization services
Mutual exclusion locks
Priority inheritance
Condition variables
Barriers
Sleepon locks
Reader/writer locks
Semaphores
Synchronization via scheduling algorithm
Synchronization via message passing
Synchronization via atomic operations
Synchronization services implementation
Neutrino IPC
Synchronous message passing
MsgReply vs MsgError
Message copying
Simple messages
Channels and connections
Pulses
Priority inheritance
The Neutrino message-passing API
Robust implementations with Send/Receive/Reply
Events
I/O notification
Signals
Neutrino special signals
Summary of signals
POSIX message queues
Why use POSIX message queues?
File-like interface
Message queue functions
Shared memory
Shared memory with message passing
Creating a shared-memory object
mmap
Pipes and FIFOs
Pipes
FIFOs
Clock and timer services
Time correction
Timers
Interrupt handling
Interrupt latency
Scheduling latency
Nested interrupts
Interrupt calls
The Instrumented Microkernel
Introduction
Instrumentation at a glance
Simple instrumentation scenario
Step 1: Run tracelogger
Step 2: Run traceprinter
How to read the output
Step 3: Write a simple control program
Step 4: Run tracelogger in daemon mode
The TraceEvent function
Trace buffers
Trace event structure
Traceparser library (traceparser)
Callbacks
Library interface functions
Example
Kernel call arguments and callbacks
SMP
Introduction
SMP versions of procnto*
Booting an x86 SMP system
Booting a PowerPC SMP system
How the SMP microkernel works
Scheduling
Hard processor affinity
Kernel locking
Inter-processor interrupts (IPIs)
Critical sections
Process Manager
Introduction
Process management
Process primitives
spawn
fork
vfork
exec*
Process loading
Memory management
Memory Management Units (MMUs)
Memory protection at run time
Software watchdog
Quality control
Full-protection model
Private virtual memory
Pathname management
Domains of authority
Prefixes and regions of authority
Resolving pathnames
Mountpoints
Unioned filesystem mountpoints
Why overlay mountpoints?
Symbolic prefixes
Creating special device names
Relative pathnames
A note about cd
File descriptor namespace
Open control blocks
Dynamic Linking
Shared objects
Statically linked
Dynamically linked
Augmenting code at runtime
How shared objects are used
ELF format
ELF without COFF
The process
Runtime linker
Loading a shared library at runtime
Symbol name resolution
Resource Managers
Introduction
What is a resource manager?
Client side
Resource manager architecture
Message types
The resource manager shared library
Automatic default message handling
open, dup, and close
Multiple thread handling
Dispatch functions
Combine messages
Second level default message handling
Summary
Filesystems
Introduction
Filesystems and pathname resolution
Filesystem classes
Filesystems as shared libraries
io-blk
Partitions
Buffer cache
Filesystem limitations
Image filesystem
RAM filesystem
QNX4 filesystem
DOS Filesystem
DOS version support
DOS text files
QNX-to-DOS filename mapping
Handling filenames
DOS volume labels
DOS-QNX permission mapping
File ownership
CD-ROM filesystem
Flash filesystem
Customization
Organization
Raw partitions
Filesystem partitions
Mountpoints
Features
POSIX
Background reclaim
Fault recovery
Transparent decompression
Flash errors
Endian awareness
Utilities
System calls
NFS filesystem
CIFS filesystem
Linux Ext2 filesystem
Virtual filesystems
Package filesystem
What's in a package?
Single definition file
Inflator
Character I/O
Introduction
Driver/io-char communication
Device control
QNX extensions
Input modes
Raw input mode
MIN
TIME
TIMEOUT
FORWARD
Edited input mode
Device subsystem performance
Console devices
Terminal emulation
Serial devices
Parallel devices
Pseudo terminal devices (ptys)
Networking Architecture
Introduction
Network manager (io-net)
Protocol interface
Driver interface
Loading a driver
Network DDK
Qnet Networking
QNX distributed
Name resolution and lookup
Connection ID
Behind a simple open
Network naming
Resolvers
Quality of Service (QoS) and multiple paths
Symbolic links
Examples
Local networks
Remote networks
TCP/IP Networking
Introduction
Structure of TCP/IP manager
Socket API
Database routines
/etc/resolv.conf
/etc/protocols
/etc/services
Multiple stacks
Dynamic host configuration
Embedded web server
CGI method
SSI method
Data server method
High Availability
What is High Availability?
An OS for HA
Inherent HA
HA-specific modules
Standard or custom hot plugging
PCI Hot Plug support
Custom hardware support
Client library
Recovery example
High Availability Manager
HAM and the Guardian
HAM hierarchy
Entities
Conditions
Actions
HAM as a filesystem
HAM API
The Photon microGUI
A graphical microkernel
The Photon event space
Regions
Events
Graphics drivers
Multiple graphics drivers
Color model
Font support
Stroke-based fonts
Unicode multilingual support
UTF-8 encoding
Animation support
Video overlay
Multimedia support
Plugin architecture
Media Player
Media Player plugins
Printing support
The Photon Window Manager
Widget library
Fundamental widgets
Label widget (PtLabel)
Push-button widget (PtButton)
Text input widgets (PtText, PtMultiText)
Toggle-button widgets (PtToggleButton)
Graphical widgets (PtArc, PtPixel, PtRect, PtLine, PtPolygon, PtEllipse, PtBezier, PtGrid)
Scrollbar widget (PtScrollbar)
Separator widget (PtSeparator)
Slider widget (PtSlider)
Image widgets (PtLabel, PtButton)
Progress-bar widget (PtProgress)
Numeric widgets (PtNumericInteger, PtNumericFloat)
Container widgets
Window widget (PtWindow)
Group widget (PtGroup)
Panel group widget (PtPanelGroup)
Viewport widget (PtScrollContainer)
Background widget (PtBkgd)
Advanced widgets
Menu-related widgets (PtMenu, PtMenuBar, PtMenuButton)
Toolbar widgets (PtToolbar, PtToolbarGroup)
List widget (PtList)
Pulldown list widget (PtComboBox)
Tree widget (PtTree)
Terminal widgets (PtTty, PtTerminal)
Divider widget (PtDivider)
Trend graph widget (PtTrend)
Color-selection widgets (PtColorSel, PtColorPanel, PtColorPatch, PtColorSelGroup, PtColorWell)
Web client widget (PtWebClient)
Convenience functions
File-selection dialog (PtFileSelection)
Font-selection dialog (PtFontSelection)
Print-selection dialog (PtPrintSelection)
Alert dialog (PtAlert)
Notice dialog (PtNotice)
Prompt dialog (PtPrompt)
Driver development kits
Summary
The QNX Library
Glossary