
|
The QNX 4 Real-time
Operating System
by Frank Kolnick
Basis Computer Systems Inc.
960 pages in 14 chapters plus index
published September, 1998
ISBN 0-921960-01-8
|
With the POSIX version, QNX brings its singular vision into
the mainstream. But QNX is much more than just another UNIX-like
product with real-world aspirations. It is a comprehensive suite
of software which lets designers create finely-tuned solutions
to complex problems. QNX does this with a unique blend of standard
tools and carefully chosen extensions. In particular, QNX depends
on the exchange of discrete packets of information--messages--to
handle virtually all inter-process communication. This paradigm
applies to all levels of programming, from device drivers to file
systems to the LAN.
That power comes at the price of complexity and a long learning
curve. Understanding the underlying concepts and tools is critical
to using QNX effectively. This book walks you through the fundamentals
and gently leads you into the more complex areas of program design
and development in a distributed, message-based environment. It
also goes beyond programming to help you use QNX' diverse set
of commands, including system administration and disk recovery
procedures. Everyone from new QNX programmers to seasoned developers
will find this an ideal combination.
Briefly, the
book covers:
- o/s concepts: processes, messages, timers,
shared memory, etc.
- program development: editing, compiling,
debugging, backing up
- software architectur: designing distributed,
co-operating processes
- real-time considerations, such as priorities,
scheduling & device drivers
- using and programming the command shell
- basic and advanced commands (both POSIX and
those unique to QNX)
- using and programming the three QNX GUIs
The text is supported with hundreds of diagrams
and tested samples of code.
Frank Kolnick is the president of Basis Computer Systems Inc.,
a consulting company with decades of experience in operating systems
and real-time applications (not to mention technical documentation).
He wrote the original, best-selling book on QNX 2. Basis is also
the designer and implementer of the QNX Windows server software.
Complete Table of Contents
1 Introduction
About QNX
First steps
About POSIX and standards
QNX, Unix, DOS and Windows
About this book
What to do next . . .
Typeface conventions
A reading list
2 Overview of QNX
The programming model
Main
features
Users
Processes
Relationships
States
Scheduling
Threads
Files, etc.
File
names
Access
rights
Types
of files
Operations
on files
DOS
files
Devices
The network
Virtual
machine
Physical/logical
numbering
Transparency
and coupling
LAN
media
Design
factors
Virtual
circuits
Inter-process communication
(IPC)
Shared
memory
Shared
files
Record-locking
Inter-process
messages
Proxies
Signals
Semaphores
Which
to use?
Names
Scope
To summarize . . .
3 Writing Programs
Getting around
Getting startedÑ-hello.c
Editing text
Buffers,
windows and registers
Help
Interaction
Navigating/scrolling
Copying
and pasting
Searching
Customizing
the editor
Summary
Etc.
Preamble: header files
and usage messages
use
message
Compiling
The
cc command
Command-line arguments
Environment variables
Programming
The
user environment
Testing and debugging
Tools
4 Managing Programs
Object libraries
The
librarian (wlib)
Shared
libraries
make
Dependency
lines
Macros
Default
rules
Command-line
Parallel
makes
Etc.
Archives and back-ups
Other
removable media
Simple
copying
Compressing
files
Archives
Back-up
procedures
Version control
Basic
operations
Information
The
finer points
Identifying
revisions
Releases
Branches
Etc.
5 Basic System Calls
Programming environment
Common
variables
Common
headers
System
limits
Environment
variables
Basic
program structure
Process creation and management
spawn
exec
fork
Environment
Status
and synchronization
Detecting
process death
Remote
processes
Process
environment
Time
Time
of day
Intervals
Pausing
Using
timers
Time-outs
Out-of-sequence
program flow
The
system clock
Very
short intervals
The Year 2000
The system
function
User password processing
Error codes
6 IPC System Calls
Global names
Registering
a name
Messages
Operations
on messages
Restricted
receives
Conditional
receives
Sending
by name
Messages
across the LAN
Proxies
Canned
messages
Non-blocking
sends
Remote
proxies
Device
managers
Shared memory
Contiguous
(DMA) memory
Semaphores
Lock
files
Signals
Side-effects
Blocking
a signal
Signal-handling
Sending
signals
Waiting
for signals
Internal
conditions
Time-outs
Busy loops
7 File I/O Calls
File creation and I/O
Opening
a file
Deleting
a file
Renaming
a file
Reading
and writing
Buffering
Directories
Random (direct) file access
Records
and structures
Unbuffered I/O
Which
to use?
Access
permissions
Mixed-style
I/O
Locking a file
Summary
Terminal Device I/O
POSIX
I/O
Low-level
control: ioctl ( )
Pseudo-terminals
Pipes and FIFOs
Pipes
FIFOs
Temporary files
A files properties
and status
Getting
file information
File
accessibility
Changing
file information
fcntl
( )
Duplicating
descriptors
Changing
the mode
Changing
ownership
Non-blocking I/O
The
select function
Misc.
File-system
functions
Files
and children
In a
network . . .
8 Designing Programs and Systems
Relationships: good, bad
and ugly
Resources and states:
system building blocks
Resources
States
Levels of software
Subsystems
Clusters
Clients
and servers
Global
names
Libraries
Configuration
Design notation
Stepping
back
Moving
data
Changes
in state
Summary
Concurrent resources
Pros
and cons
Design
Distributed
processing
Global
Time
Load-balancing
Whose
resource?
Synchronization
Sharing
resources
Semaphores
and critical regions
Summary
An example
Specification
Resources
Operations
Messages
A quick
review
More
to worry about . . .
Reality checks
Factors
to consider
Optimization
Real-time Programming
Time
Design
principles
Guidelines
Formal
methodologies
Events
Timing
Memory
Synchronization
Scheduling
Performance
Reliability and fault-tolerance
Redundancy
Watch-dogs
and time-outs
Deadlock
Summary
Device and resource interfaces
I/O
(Resource) managers
Summary
9 Testing & Debugging
The general idea
Divide
and conquer . . .
Source-code debuggingÑwd
Starting
up
User
Interaction
Command
line
Executing
the program
Looking
at data
Where
am I?
Keyboard
shortcuts
Post-mortem
debugging
Summary
Looking at files
hd
spatch
Comparing
files
Strings
Looking at other nodes
(ditto)
Customized debugging code
Leaving
clues
QNX
event tracing
Checking
integrity
So,
then what?
Sample
code
Optimizing: the final
step
Profiling
Diagnosing system problems
10 A QNX Survival Guide: The Basics
Commands
Command
format
Command
paths
Confirmation
prompts
User Interaction
Consoles
GUIs
Shells
Special
characters
Patterns
Redirecting
input & output
Pipes
Shell
scripts
Final
touches
Environment variables
11 A QNX Survival Guide: Common Commands
Text-handling commands
Text
editors
Looking
at text
Rearranging
text
Searching
for text
Putting
things in order
Comparing
files
Counting
words and lines
Text
files from DOS, etc.
Automated
editing (sed and awk)
File and directory commands
Changing
directories
A list
of files
Copying
files
Moving
and renaming files
Deleting
files
Searching
for files
File
times
Path
prefixes
Permissions
and ownership
Managing
directories
DOS
filesystems
QNX
2 filesystems
Processes and the state
of the system
System
information
Terminating
a process
Managing
processes
Printing
Connecting
a printer
Printing
directly to a printer
Formatting
the output
Spooling
Graphics
12 System Administration
Basic system administration
User
accounts
Setting
the time
Shutting
down
System
logging
Back-ups
Disk
errors
Communicating with users
write
(to one user)
wall
(write to all users)
mail
Running programs on schedule
Scheduling
jobs
Access
control
Multiple
crons
Checking the network
Shell programming
Built-in
commands
Configuration
User
profiles
The
/etc directory
Managing your disks
Disk
information
Diagnostics
Disk/file
errors
Recovering
files
Cant
boot?
Back-ups
13 More About Messages
Messages as data structures
Variable-length messages
Queuing messages
Message
agents
QNX
(POSIX) queues
Built-in
queuing
Summary
Large multi-part messages
Buffering
a message
Scattered
messages
Summary
QNX system messages
Process
death
14 Graphical User Interfaces
Overview
Windowing
systems
QNX
Windows
X Windows
Photon
Features
General guidelines
The
manual
The
prototype
The
contingency
Program
structure
Common GUI widgets
Operations
Window
Layout
Pointers
& carets
clicks
& drags
Individual
descriptions
QNX Windows
Architecture
Basic
Interaction
Customization
Tools
& Toys
Programming
The X Window System
Architecture
Basic
Interaction
Customization
Tools
& Toys
Programming
Photon
Architecture
Basic
Interaction
Customization
Tools
& Toys
Programming
Catalogue entry
|