0% found this document useful (0 votes)
363 views2,141 pages

Utilities Reference

Uploaded by

cemaojun mao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
363 views2,141 pages

Utilities Reference

Uploaded by

cemaojun mao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

® ®

QNX Neutrino Realtime Operating System


Utilities Reference

For QNX ® Neutrino® 6.5.0

© 2010, QNX Software Systems GmbH & Co. KG.


© 1996–2010, QNX Software Systems GmbH & Co. KG. All rights reserved.
Published under license by:
QNX Software Systems Co.
175 Terence Matthews Crescent
Kanata, Ontario
K2M 1W8
Canada
Voice: +1 613 591-0931
Fax: +1 613 591-3579
Email: [email protected]
Web: http://www.qnx.com/
Electronic edition published 2010
QNX, Neutrino, Photon, Photon microGUI, Momentics, Aviage, and related marks, names, and logos are trademarks, registered in certain jurisdictions, of QNX Software
Systems GmbH & Co. KG. and are used under license by QNX Software Systems Co. All other trademarks belong to their respective owners.
Contents

About This Reference xxi


Typographical conventions xxiii
Note to Windows users xxiv
Technical support xxiv
Utility Conventions 1
Syntax conventions 3
Interpreting utility syntax 3
Invoking utilities 4
File conventions 5
Signal conventions 5
Exit status conventions 5
Error conventions 6
Utilities 7
/etc/acl.conf 10
addr2line 12
addvariant 13
appbuilder 16
applypatch 18
aps 20
ar 24
arp 25
/etc/autoconnect 27
basename 29
bc 31
bdftophf2 39
bindres 40
bison 41
bkgdmgr 42
bootpd 44
/etc/bootptab 46
brconfig 51
bunzip2 54

June 22, 2010 Contents iii


© 2010, QNX Software Systems GmbH & Co. KG.

bz2cat 55
bzip2 56
c++filt 58
calib 59
cam-cdrom.so 61
cam-disk.so 62
cam-optical.so 64
cat 66
CC, cc 68
chat 69
chattr 75
chgrp 77
chkdosfs 79
chkfsys 82
chkqnx6fs 87
chmod 90
chown 94
cksum 96
clear 98
cmp 99
/etc/context.conf 101
coreinfo 103
cp 104
cpio 112
cron 115
crontab 117
ctags 121
cut 123
cvs 125
date 137
dcheck 142
dd 145
deflate 148
deva-ctrl-4dwave.so 150
deva-ctrl-audiopci.so 152
deva-ctrl-cs4281.so 154
deva-ctrl-ess1938.so 156
deva-ctrl-geode.so 158
deva-ctrl-i8x0.so 160
deva-ctrl-intel_hda.so 162
deva-ctrl-nmg6.so 164

iv Contents June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG.

deva-ctrl-sb.so 166
deva-ctrl-via686.so 168
deva-ctrl-vortex.so 170
deva-ctrl-ymfds1.so 172
deva-mixer-ac97.so 174
deva-mixer-ak4531.so 175
deva-mixer-hda.so 176
deva-util-restore.so 177
devb-adpu320 178
devb-aha8 182
devb-ahci 186
devb-btmm 190
devb-eide 194
devb-fdc 200
devb-loopback 203
devb-mvSata 208
devb-ram 212
devb-umass 215
devc-con, devc-con-hid 217
devc-par 237
devc-pty 239
devc-ser8250 240
devc-serpci 245
devc-serusb 247
devc-serzscc 250
devf-generic 254
devf-ram 261
devg-ati_rage128.so 267
devg-carmine.so 270
devg-chips.so 274
devg-coral.so 277
devg-extreme2.so 282
devg-flat.so 285
devg-geode.so 286
devg-gma9xx.so 289
devg-i810.so 292
devg-i830.so 295
devg-intelhd.so 298
devg-matroxg.so 301
devg-poulsbo.so 304
devg-radeon.so 307

June 22, 2010 Contents v


© 2010, QNX Software Systems GmbH & Co. KG.

devg-rage.so 310
devg-s3_savage.so 313
devg-sis630.so 316
devg-smi5xx.so 319
devg-smi7xx.so 322
devg-soft3d.so 325
devg-soft3d-fixed.so 326
devg-svga.so 327
devg-tnt.so 329
devg-tvia.so 332
devg-vesabios.so 335
devg-vmware.so 337
devh-egalax.so 339
devh-microtouch.so 341
devh-ps2ser.so 343
devh-touchintl.so 347
devh-usb.so 349
devi-dyna 351
devi-elo 353
devi-hid 356
devi-hirun 359
devi-microtouch 364
devi-semtech 367
devi-zytronic 369
devn-asix.so 372
devn-crys8900.so 375
devn-dm9102.so 378
devn-el509.so 380
devn-el900.so 382
devn-epic.so 385
devn-fd.so 388
devn-i82544.so 390
devn-micrel8841.so 393
devn-ne2000.so 395
devn-pcnet.so 398
devn-pegasus.so 402
devn-rtl.so 405
devn-rtl8150.so 408
devn-sis9.so 411
devn-smc9000.so 414
devn-speedo.so 417

vi Contents June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG.

devn-tigon3.so 420
devn-tulip.so 423
devn-via-rhine.so 426
devnp-ath.so 429
devnp-axe.so 431
devnp-bce.so 433
devnp-bcm1250.so 435
devnp-bcm43xx.so 438
devnp-bge.so 440
devnp-e1000.so 442
devnp-i80579.so 445
devnp-i82544.so 447
devnp-mpcsec.so 451
devnp-mpc85xx.so 453
devnp-msk.so 456
devnp-ral.so, devnp-ural.so 458
devnp-rtl8169.so 461
devnp-rum.so 464
devnp-shim.so 467
devnp-speedo.so 468
devp-pccard 471
devu-ehci.so 474
devu-kbd 476
devu-mouse 477
devu-ohci.so 478
devu-prn 480
devu-uhci.so 482
df 484
dhcp.client 486
dhcpd 492
/etc/dhcpd.conf 500
/var/state/dhcp/dhcpd.leases 521
dhcprelay 524
diff 528
diff3 533
dig 542
dinit 543
dirname 548
diskboot 550
dispconf 553
dloader 555

June 22, 2010 Contents vii


© 2010, QNX Software Systems GmbH & Co. KG.

dnssec-dsfromkey 558
dnssec-keyfromlabel 559
dnssec-keygen 560
dnssec-signzone 561
ds 562
du 566
dumpefs 568
dumper 569
dumpifs 572
echo 575
ed 577
egrep 578
elvis 579
enum-devices 602
enum-usb 615
env 625
errno 627
esh 628
etfsctl 635
expand 640
/etc/exports 642
expr 644
false 647
fcat 648
fdformat 649
fdisk 652
fesh 659
fgrep 662
file 663
find 667
finstall 683
flashctl 684
flex 689
fmt 691
fold 692
fontinfo 694
fpemu.so 697
freeze 698
fs-cd.so 701
fs-cifs 703
fs-dos.so 707

viii Contents June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG.

fs-etfs-ram 712
fs-ext2.so 716
fs-mac.so 718
fs-nfs2 720
fs-nfs3 722
fs-nt.so 725
fs-qnx4.so 727
fs-qnx6.so 730
fs-udf.so 733
fsysinfo 738
/etc/fstab 742
ftp 744
/etc/ftpchroot 745
ftpd 746
/etc/ftpd.conf 749
/etc/ftpusers 754
fullpath 756
g++ 757
/etc/gateways 759
gawk 764
gcc 782
gcov 788
gdb 790
getconf 794
getty 799
gf-calib 800
gns 802
gprof 809
grep 810
gunzip 815
gzip 816
ham 820
hamctrl 821
hd 822
head 826
helpviewer 828
hidview 837
hogs 839
host 841
hostapd 842
hostname 844

June 22, 2010 Contents ix


© 2010, QNX Software Systems GmbH & Co. KG.

/etc/hosts 845
/etc/hosts.equiv 846
id 849
if_up 851
ifconfig 853
ifwatchd 864
indent 866
inetd 868
/etc/inetd.conf 870
inflator 875
infocmp 878
input-cfg 880
inputtrap 882
io-audio 885
io-blk.so 888
io-display 899
io-graphics 903
io-hid 906
io-pkt-v4, io-pkt-v4-hc, io-pkt-v6-hc 908
io-usb 914
join 916
kill 918
ksh 920
ld 971
ldd 972
ldrel 974
less 976
link 986
ln 987
ln-w 990
logger 991
login 993
logout 997
lpd 998
lpr 1000
lprc 1003
lprq 1006
lprrm 1008
ls 1010
lsm-autoip.so 1015
lsm-pf-v4.so, lsm-pf-v6.so 1018

x Contents June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG.

lsm-qnet.so 1019
lwresd 1026
m4 1027
/usr/share/misc/magic 1028
make 1031
mcd 1036
mcs 1060
melt 1061
mesg 1062
/etc/mib.txt 1063
mixer 1064
mkasmoff 1067
mkcldr 1068
mkbuild 1070
mkdir 1072
mkdosfs 1074
mkefs 1077
mketfs 1085
mkfifo 1093
mkfontdir 1095
mkifs 1097
mkimage 1126
mkkbd 1127
mkqnx6fs 1129
mkrec 1132
mksbp 1134
/etc/moduli 1135
more 1136
mount 1139
mq 1143
mqueue 1145
mrouted 1146
mstrip 1154
mv 1155
named 1159
named-checkconf 1160
named-checkzone, named-compilezone 1161
/etc/named.conf 1162
ndp 1163
netmanager 1165
netstat 1167

June 22, 2010 Contents xi


© 2010, QNX Software Systems GmbH & Co. KG.

/etc/networks 1172
newgrp 1173
nfsd 1175
/etc/nfsstart 1178
nice 1179
nicinfo 1182
nm 1185
nohup 1186
nslookup 1188
/etc/nsswitch.conf 1194
nsupdate 1196
ntpd 1197
ntpdate 1202
ntpdc 1205
ntpq 1212
ntptrace 1222
objcopy 1224
objdump 1225
od 1226
omshell 1229
on 1234
op 1238
openssl 1239
/etc/party.conf 1244
passwd 1246
paste 1250
patch 1252
pax 1256
pccard-launch 1262
pci 1264
pci-bios, pci-bios-v2 1265
pcnfsd 1267
/etc/pcnfsd.conf 1268
pdebug 1269
ped 1271
pf 1280
/etc/pf.conf 1296
pfctl 1333
pfm 1340
ph 1344
phablang 1347

xii Contents June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG.

phabmsg 1349
phcalc 1352
phdialer 1353
phditto 1356
phfind 1360
phfont 1363
phgrafx 1371
phin 1374
phlip 1379
phlocale 1391
phlogin, phlogin2 1394
phmenu 1398
Photon 1401
phrelay 1403
phrelaycfg 1411
phs-to-bjc 1413
phs-to-bmp 1416
phs-to-escp2 1419
phs-to-ijs 1423
phs-to-pcl 1426
phs-to-ps 1432
phshutdown 1434
phuser 1437
phview 1440
pidin 1442
pin 1454
ping 1455
ping6 1460
pipe 1465
pppd 1467
pppoectl 1470
pppoed 1475
pps 1476
pr 1477
preview 1480
/etc/printcap 1482
printf 1486
prjobs 1491
procnto* 1493
/etc/protocols 1500
ps 1501

June 22, 2010 Contents xiii


© 2010, QNX Software Systems GmbH & Co. KG.

pterm 1505
ptermcs 1516
pv 1518
pwd 1520
pwm 1521
pwmopts 1526
python 1530
qbinaudit 1533
QCC, qcc 1535
qconfig 1543
qconn 1546
qcp 1548
qde 1551
qed 1553
qtalk 1555
QWinCfg 1564
racoon 1566
/etc/racoon.conf 1568
random 1578
ranlib 1580
rcp 1581
readelf 1583
renice 1584
/etc/resolv.conf 1586
˜/.rhosts 1589
rlogin 1592
rlogind 1594
rm 1596
rmdir 1598
rndc 1600
rndc-confgen 1601
rndc.conf 1602
route 1603
route6d 1607
routed 1610
/etc/rpc 1615
rpcbind 1616
rpcgen 1618
rpcinfo 1621
rsh 1623
rshd 1625

xiv Contents June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG.

rtadvd 1628
/etc/rtadvd.conf 1631
rtc 1634
rtquery 1637
rtsold 1639
ruptime 1641
rwho 1642
rwhod 1643
savercfg 1645
scp 1648
script 1649
sed 1650
seedres 1657
sendnto 1658
/etc/services 1660
setconf 1661
setkey 1663
setupbsp 1669
sftp 1671
sftp-server 1672
sh 1673
shelf 1674
showlicense 1676
showmem 1677
showmount 1678
show_vesa 1679
shutdown 1681
size 1683
slay 1684
sleep 1689
slinger 1690
slogger 1706
sloginfo 1710
smic 1712
snapshot 1717
snmpbulkwalk 1720
snmpd 1723
/etc/snmpd.conf 1725
snmpget 1726
snmpgetnext 1729
snmpnetstat 1731

June 22, 2010 Contents xv


© 2010, QNX Software Systems GmbH & Co. KG.

snmpset 1734
snmpstatus 1737
snmptest 1739
snmptranslate 1745
snmptrap 1747
snmptrapd 1750
snmpwalk 1752
/etc/socks.conf 1755
sockstat 1758
sort 1760
spatch 1763
split 1766
spooler 1768
ssh 1770
ssh-add 1771
ssh-agent 1772
˜/.ssh/ssh_config, /etc/ssh/ssh_config 1773
ssh-keygen 1774
ssh-keyscan 1776
ssh-keysign 1777
sshd 1778
/etc/ssh/sshd_config 1779
startup-* options 1780
startup-apic 1785
startup-bios, startup-bios-32 1788
strings 1791
strip 1792
stty 1793
su 1801
sync 1803
sysctl 1804
sysinfo 1810
/etc/syslog.conf 1812
syslogd 1815
tail 1817
tar 1819
tcpdump 1823
tee 1854
telnet 1856
telnetd 1866
textto 1870

xvi Contents June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG.

tftp 1871
tftpd 1874
tic 1876
time 1878
tinit 1880
top 1882
touch 1883
tr 1886
tracelogger 1889
traceprinter 1893
traceroute 1898
traceroute6 1903
true 1905
tsort 1906
tty 1907
uesh 1908
umask 1913
umount 1916
uname 1917
unexpand 1919
unifdef 1921
uniq 1922
unlink 1924
unzip 1925
uptime 1929
usb 1930
use 1932
usemsg 1935
uud 1939
uudecode 1940
uue 1941
uuencode 1942
vi 1943
view 1944
/etc/view.conf 1945
waitfor 1946
wc 1947
which 1948
who 1950
wpa_cli 1951
wpa_passphrase 1955

June 22, 2010 Contents xvii


© 2010, QNX Software Systems GmbH & Co. KG.

wpa_supplicant 1956
xargs 1961
zap 1964
zcat 1966
zip 1967

A Commonly Used Environment Variables 1973


A 1975
B 1975
C 1976
D 1976
E 1977
F 1977
G 1977
H 1977
I 1978
J 1979
L 1979
M 1980
N 1981
O 1981
P 1981
Q 1984
R 1984
S 1985
T 1987
U 1987

B Selecting the Target System 1989


Target selection 1991
Architecture selection 1992
Linker emulation selection 1993

C What’s New in this Reference? 1995


What’s new in the QNX Software Development Platform 6.5.0? 1997
New entries 1997
Deprecated content 1999
Changed content 1999
Errata 2009
What’s new in the QNX Software Development Platform 6.4.1? 2010
New entries 2010

xviii Contents June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG.

Deprecated content 2012


Changed content 2012
Errata 2018
What’s new in the QNX Software Development Platform 6.4.0? 2019
New entries 2019
Deprecated content 2023
Changed content 2028
Errata 2032
What’s new in QNX Momentics 6.3.2? 2033
New entries 2033
Changed content 2034
Errata 2035
What’s new in the QNX Neutrino Core OS 6.3.2? 2035
New entries 2035
Changed content 2035
Errata 2036
What’s new in QNX Momentics 6.3.0 Service Pack 2? 2036
New entries 2036
Changed content 2037
Errata 2037
What’s new in QNX Momentics 6.3.0 Service Pack 1? 2037
New entries 2038
Changed content 2038
What’s new in QNX Momentics 6.3.0? 2039
New entries 2039
Deleted entries 2042
Changed content 2042
Errata 2043
What’s new in QNX Momentics 6.2.1? 2043
New entries 2044
Deleted entries 2044
Changed content 2045
Errata 2045

Glossary 2047

Index 2067

June 22, 2010 Contents xix


About This Reference

June 22, 2010 About This Reference xxi


© 2010, QNX Software Systems GmbH & Co. KG. Typographical conventions

The Utilities Reference describes the utilities, manager processes, and configuration
files included with the QNX Neutrino operating system. This reference is intended for
everyone from end-users to system administrators.

For information about: See:


An overview of the syntax for utilities Utility Conventions
Environment variables Commonly Used Environment Variables
Targets for GNU utilities Selecting the Target System
A summary of changes to this reference What’s New in this Reference?
Terms used in QNX documentation Glossary

Your system might not include all of the things that this reference describes,
depending on what software you’ve installed. For example, some utilities are included
in the QNX Momentics Tool Suite, and others are included in a specific Board Support
Package (BSP).

For information about licensing, see:

• the QNX Development Suite License Guide at


http://licensing.qnx.com/license-guide/

• the Third Party License Terms List at


http://licensing.qnx.com/third-party-terms/

• the matrix of all the versions of all our legal documents at


http://licensing.qnx.com/document-archive/

Typographical conventions
Throughout this manual, we use certain typographical conventions to distinguish
technical terms. In general, the conventions we use conform to those found in IEEE
POSIX publications. The following table summarizes our conventions:

Reference Example
Code examples if( stream == NULL )
Command options -lR
Commands make
Environment variables PATH

continued. . .

June 22, 2010 About This Reference xxiii


Technical support © 2010, QNX Software Systems GmbH & Co. KG.

Reference Example
File and pathnames /dev/null
Function names exit()
Keyboard chords Ctrl-Alt-Delete
Keyboard input something you type
Keyboard keys Enter
Program output login:
Programming constants NULL
Programming data types unsigned short
Programming literals 0xFF, "message string"
Variable names stdin
User-interface components Cancel

We use an arrow (→) in directions for accessing menu items, like this:

You’ll find the Other... menu item under Perspective→Show View.

We use notes, cautions, and warnings to highlight important messages:

Notes point out something important or useful.

CAUTION: Cautions tell you about commands or procedures that may have
! unwanted or undesirable side effects.

WARNING: Warnings tell you about commands or procedures that could be


dangerous to your files, your hardware, or even yourself.

Note to Windows users


In our documentation, we use a forward slash (/) as a delimiter in all pathnames,
including those pointing to Windows files.
We also generally follow POSIX/UNIX filesystem conventions.

Technical support
To obtain technical support for any QNX product, visit the Support area on our
website (www.qnx.com). You’ll find a wide range of support options, including
community forums.

xxiv About This Reference June 22, 2010


Utility Conventions

June 22, 2010 Utility Conventions 1


© 2010, QNX Software Systems GmbH & Co. KG. Syntax conventions

Syntax conventions
Most QNX utilities follow standard conventions for argument syntax and behavior.
These conventions are based on the utility conventions outlined in POSIX
1003.2-1992.
The syntax synopsis for each utility appears at the top of the page of its manual entry.
The utility name appears first, followed by other allowed command-line arguments,
which include options, option arguments (e.g. “number” in -n number), and operands
(e.g. the names of files to act on).
The syntax synopsis is the only reliable source for information about mutual
exclusivity of options and about whether a command-line element is optional or
required. This information isn’t usually contained in the detailed option listings that
appear after the syntax section.
A typical utility syntax line looks like this:
utilityname [-abcd] [-o arg | -p arg] infile... outfile
The example above shows a utility called utilityname that accepts the options -a,
-b, -c, and -d — these options may be used alone or in any combination.
The utility also accepts the options -o and -p, both of which require an option
argument, and which may not be used together (but may be used with the other options
-abcd). The utility requires two or more operands: one or more infile and exactly one
outfile.

Interpreting utility syntax


Here are the main principles at work:

• When utilities have many options, the options may appear grouped together in the
syntax like this:
utilname [-abcd]

which means that the options -a, -b, -c, and -d are supported.
• Options, option arguments, and operands enclosed in brackets ([ and ]) are
optional and can be omitted. Note that the [ and ] symbols should never be
included in the actual command.
• Arguments separated by | are mutually exclusive. Sometimes mutually exclusive
arguments that relate to modes of operation are indicated with multiple syntax lines
representing the different forms of the command.
• A trailing ellipsis mark (...) after options or operands indicates that the preceding
item may be repeated. If the preceding item is optional, the ellipsis indicates that
the item may occur zero or more times, e.g.:
utility [filename...]

If the item is mandatory, the ellipsis indicates it may occur one or more times, e.g.:

June 22, 2010 Utility Conventions 3


Syntax conventions © 2010, QNX Software Systems GmbH & Co. KG.

utility filename...

Invoking utilities
There are a number of general guidelines to follow when running utilities:

• An option may be followed by another option after a single dash (-) on the
command line as long as each preceding option doesn’t have an option argument.
For example, the option string -abc is equivalent to -a -b -c. However, if -a
accepts an option argument, then -abc would be equivalent to -a bc instead.

• Options and their option arguments should be specified with spacing as shown in
their documentation. If the documentation says:
-n number

the number should be a separate command-line argument from the -n. But if the
documentation refers to:
-nnumber

then number should appear in the same argument as -n without any intervening
blanks. Utilities in QNX and in POSIX-conforming systems permit both forms in
all utilities unless otherwise stated, but you’ll achieve the greatest portability by
using the preferred form. This is particularly important when developing scripts
that may be used on multiple (QNX and non-QNX) platforms.

• Options are usually listed in alphabetical order, but there’s no restriction on the
order that they may appear in the command line when used, unless otherwise
indicated in the documentation for the utility. Note that in some utilities, mutually
exclusive options override each other in a “last one wins” manner.

• All options and associated option arguments must precede any operands on the
command line. For example, if you want to run the cp utility with the -R option,
you may enter:
cp -R dir1 dir2

but not:
cp dir1 dir2 -R

• Decimal integers are accepted when numeric values are required in operands and
option arguments, unless otherwise specified. Some utilities may support 0octal
and 0xhex numbers as well without being documented as doing so. For this reason,
don’t precede decimal numbers with leading zeros.

• Integer numerical operands and option arguments must be in the range 0 to


2147483647 unless otherwise specified. If negative numbers are accepted, the
acceptable range is -2147483647 to 2147483647.

4 Utility Conventions June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. File conventions

• The argument -- (“dash dash”) may be placed on the command line as a delimiter
indicating the end of options and the start of operands. This is particularly useful
when the operands themselves might start with a dash. For example, to remove a
file named “-t”, you would use:
rm -- -t

Utilities that don’t accept any options also accept and discard a -- before their
operands, unless otherwise indicated.

• Most utilities that accept filenames as operands (and sometimes as option


arguments) accept the filename “-” to mean standard input, or, when unambiguous
from its context, standard output.

File conventions
File pathnames specified on the command line are restricted to 255 characters. Some
input files are specifically identified as “text files.” Text files are expected to contain
ASCII text in newline-terminated lines that don’t exceed 2048 characters, unless
otherwise indicated.

Signal conventions
Signal actions are inherited from the process that invokes the utility. Most utilities
don’t do any special processing upon receipt of a signal, but behave instead according
to the system defaults. When a utility performs some action on receipt of a signal
other than the default, it’s documented as doing so.
Note that temporary files aren’t left in place after a utility is terminated due to a signal,
unless otherwise specified.
Servers and resident processes typically run only as root and ignore most signals
(such as SIGPWR).

Exit status conventions


Utilities normally return zero for successful completion and values greater than zero
when unsuccessful. Some utilities return different nonzero numbers according to the
reason they failed. Beware of testing for a specific nonzero number to indicate failure.
(In most cases utilities that may return different nonzero numbers are explicitly
documented as doing so. However, you should not rely on this.)
For some utilities, the exit status may reflect only the success or failure of the last
action taken (of many). In these cases, this behavior is explicitly documented in the
“Exit status” section.
In the ksh, you can use $? to get the exit status of the last command. For more
information, see “Parameters” in the documentation for ksh.

June 22, 2010 Utility Conventions 5


Error conventions © 2010, QNX Software Systems GmbH & Co. KG.

Error conventions
Utilities may fail for many reasons ranging from incorrect usage to underlying system
failure. The documentation for the utilities doesn’t attempt to outline the exact
behavior for all possible modes of failure.
In all cases, unless otherwise specified, every error results in a diagnostic message
printed to standard error.
When an error occurs, the utility stops the processing of the current operand and
proceeds to process the next operand in the sequence. If a utility fails to process one
operand but succeeds on others, the exit status still reflects failure. For utilities that
recurse through a filesystem (e.g. find), if an action cannot be performed on one file
within a hierarchy, the utility stops processing that file and goes on to the subsequent
files in the hierarchy.
When an unrecoverable error occurs (e.g. insufficient memory), the utility prints a
diagnostic message to standard error and exits immediately.

6 Utility Conventions June 22, 2010


Utilities

June 22, 2010 Utilities 7


© 2010, QNX Software Systems GmbH & Co. KG.

The utilities and configuration files are described here in alphabetical order.

June 22, 2010 Utilities 9


/etc/acl.conf © 2010, QNX Software Systems GmbH & Co. KG.
Specify permitted operations on a defined SNMP context

Name:
/etc/acl.conf

Description:
The acl.conf file is used to specify what context is available to an agent and
manager. This definition includes what operations are permitted on this collection of
data objects.
Here’s the search order that’s used to find this file:

1 /nodecfg/node_name/etc/acl.conf, where node_name is the value of the


CS_NODENAME configuration string (see getconf and setconf)

2 /etc/acl.conf

The file is in the format:


targetParty sourceParty context privileges
where:

targetParty Party that a request is sent to (agent).


sourceParty Party sending the request (manager).
context Collection of objects that the sourceParty can view.
privileges Actions that the source party is allowed to perform.

The privileges that you can specify are:

B GetBulk
G Get
I Inform
N GetNext
R Response
S Set
U SNMPv2-Trap

For example:
agent_party manager_party agent_context G
The agent acting as agent_party allows the manager acting as manager_party to do
GET operations on the collection of data objects included in the agent_context.

10 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. /etc/acl.conf

See also:
snmpget, snmptest, snmptrapd, snmpwalk
Based on ISO IS 8824 (ASN.1), RFC 1065, RFC 1066, RFC 1067, RFC 1446

June 22, 2010 Utilities 11


addr2line © 2010, QNX Software Systems GmbH & Co. KG.
Convert addresses into line number/file name pairs (GNU)

Syntax:
addr2line_variant [options] [addr ...]

Runs on:
QNX Neutrino, Linux, Microsoft Windows

Options:
The addr2line_variant depends on the target platform, as follows:

Target platform: addr2line_variant:


ARM ntoarm-addr2line
MIPS ntomips-addr2line
PowerPC ntoppc-addr2line
SH4 ntosh-addr2line
x86 ntox86-addr2line

Description:
The addr2line utility translates program addresses into file names and line numbers.
Given an address and an executable, it uses the debugging information in the
executable to figure out which file name and line number are associated with a given
address.
For detailed documentation, see the GNU website at http://www.gnu.org/.

Contributing author:
GNU

12 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. addvariant
Add a new OS, CPU, or VARIANT directory structure to a source tree

Syntax:
addvariant [-c] [-i init_lvls] [-P] [[os_name]
cpu_name] variant_name

Runs on:
QNX Neutrino, Linux, Microsoft Windows

Options:
-c Add the created directory structure to the CVS repository on the
next cvs commit.

-i init_lvls Create the initial common.mk and Makefile files in the current
working directory. The Makefile contains a line defining the
level(s) contained in the directory structure. Specify init_lvls as OS,
OS/CPU, or OS/CPU/VARIANT (use a slash (/) or a dash (-) to
separate multiple levels).

-P Create initial directories for a PhAB application.

os_name The name of the operating system to add (e.g. qnx4, nto, linux).

cpu_name The name of the CPU to add (e.g. mips, ppc, x86).

variant_name The name of the variant to add (e.g. o, a.be)

Description:
The addvariant utility is a shell script that creates a directory structure for your
source tree. It also ensures that each level of this structure contains necessary files
used by the make utility.
Using addvariant to create your variant directory structure enables you to take
advantage of the makefile rules of the QNX build environment. For more information
on these rules, see the Conventions for Recursive Makefiles and Directories appendix
of the Neutrino Programmer’s Guide.
The project level includes a file called common.mk. This file contains any “special”
flags and settings needed for compilation and linking.
Each level in the directory structure needs a properly constructed Makefile with
appropriate macros and include files. At most levels, Makefile includes
recurse.mk, the file used by higher-level makefiles to recurse into lower-levels. The
Makefile at the lowest level of the directory tree (the variant level) includes the
common.mk file from the project level instead of recurse.mk.
If requested, addvariant also adds the directories and files it has created to CVS,
ready for your next cvs commit.

June 22, 2010 Utilities 13


addvariant © 2010, QNX Software Systems GmbH & Co. KG.

Dealing with GNU projects


The utility begins by checking to see the projects conform to a GNU-type structure. If
the current working directory (CWD) contains files named configure and
Makefile.in, addvariant assumes that the project is configured in the GNU style.
In that case, it automatically squashes the directory levels (as described below) into a
single OS-CPU-VARIANT level and creates GNUmakefile files in the newly created
directories along with a recursing Makefile to take advantage of them.
After you’ve run addvariant, create an executable shell script called build-hooks
file in the root of the project. This script defines some shell functions that make
invokes to build your project properly; for more information, see “GNU configure”
in the Conventions for Recursive Makefiles and Directories appendix of the Neutrino
Programmer’s Guide.

Creating the initial files


The addvariant utility either creates and installs standard Makefile and
common.mk files in the CWD, or, if these files already exist, edits them to add the
same standard script lines used for recursing.

Creating the subdirectories and files


Starting from the CWD, the addvariant utility searches down into the directory tree
looking in each Makefile for a line starting with LIST. This line indicates the
particular directory level the Makefile is placed in, like this:

• LIST=OS (if three levels are specified)

• LIST=CPU (if two levels are specified)

• LIST=VARIANT (if one level is specified)

The utility then decides whether to create a subdirectory by looking at the:

• LIST macro

• *_name options

• current subdirectories

If needed, addvariant then creates an appropriately named subdirectory containing


a suitable Makefile.
This process continues down into the directory structure until all the required
directories have been created and populated with the necessary recursing Makefile.

Squashing levels
The addvariant utility has the ability to “squash” directory levels together. If you
enter the command:

addvariant -i OS/CPU/VARIANT nto x86 o

14 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. addvariant

addvariant creates a recursing Makefile in the CWD structure that has a line like
this:

LIST=OS CPU VARIANT

and then creates a single subdirectory called nto-x86-o.


Any subsequent invocation of addvariant in the tree notices this squashing of the
directory levels and automatically generates the appropriate directory structure.

Examples:
Create a two-level directory called nto-x86/o:

addvariant -i OS/CPU nto x86 o

Create the opposite two-level scheme, nto/x86-o:

addvariant -i OS nto x86/o

For detailed examples, see “Examples of creating Makefiles” in the Conventions for
Recursive Makefiles and Directories appendix of the Neutrino Programmer’s Guide.

See also:
make
Conventions for Recursive Makefiles and Directories appendix of the QNX Neutrino
Programmer’s Guide
Andrew Oram and Steve Talbott, Managing Projects with make, O’Reilly and
Associates, 1991

June 22, 2010 Utilities 15


appbuilder © 2010, QNX Software Systems GmbH & Co. KG.
Photon Application Builder (PhAB)

Syntax:
appbuilder [options]

Runs on:
QNX Neutrino, Microsoft Windows

Options:
-h height[%] The height of the window, in pixels, or as a percentage of the
screen height if % is specified.
-l filepath (“el”) Look in filepath for the library callbacks file. Make the
callbacks found in this file available to all applications loaded
later.
The format for the library callbacks file is as follows:
l=library_name
L=path
f=function1
f=function2
l=another_library_name
f=function3
f=function4
f=function5
Lines beginning with l= specify the library in which to find the
following functions; if no library specification is given, the
function specifications are ignored. The L=path specification
line is optional, it tells the linker where to look for the library
callbacks; if you don’t specify this path, the linker will use its
default path.
In addition to functions in the library callbacks file, the linker
looks in the application directory (the directory containing
abapp.dfn) for libcalls.def. Callbacks found in
libcalls.def will be available only while the application is
loaded.
-n Don’t lock the application’s files. If someone already has an
application open, PhAB won’t open it unless you started PhAB
with the -n option.
If you’re using NFS or SMB, you should start PhAB with the -n
option because you can’t lock files with either.
-Si|m|n The initial state of the main window (iconified, maximized, or
normal).
-s server_name The name of the Photon server:

16 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. appbuilder

If server_name is: This server is used:


node_path node_path/dev/photon
fullpath fullpath
relative_path /dev/relative_path

-w width[%] The width of the window, in pixels, or as a percentage of the


screen width if % is specified.

-x position[%][r] The x coordinate of the upper-left corner of the window, in


pixels, or as a percentage of screen width if % is specified. If r is
specified, the coordinate is relative to the current console.

-y position[%][r] The y coordinate of the upper-left corner of the window, in


pixels, or as a percentage of screen height if % is specified. If r
is specified, the coordinate is relative to the current console.

Description:
The appbuilder utility starts the Photon Application Builder (PhAB). For
information about using PhAB to develop Photon applications, see the Photon
Programmer’s Guide.

June 22, 2010 Utilities 17


applypatch © 2010, QNX Software Systems GmbH & Co. KG.
Install or uninstall a patch (QNX Neutrino)

Since this utility modifies the installation tree, you must run it as a privileged user. It
also requires the environment be properly set. On Linux, if you use sudo (as would be
the case on Ubuntu), you must also specify the -E option to preserve the environment.
In this case, however, the PATH environment variable is set to a safe one for security
reasons, so you need to specify the full path to the utility:

sudo -E $QNX_HOST/usr/bin/applypatch patchfile

Syntax:
Install a patch:
applypatch [-b] [-c] [-d path] [-F] [-H] [-v] patch_file

List the installed patches:


applypatch -l

Uninstall a patch:
applypatch -U num

Runs on:
QNX Neutrino, Linux, Microsoft Windows

Options:
-b Don’t make a backup.

CAUTION: If you specify the -b option, you won’t be able to uninstall this patch or

! any patches applied after it. We don’t recommend this option for general use.

-c Extract the patch contents only. No metadata will be recorded, nor will
any backup file be generated. This is useful when pulling out individual
files for testing, but we don’t recommend this option for general use.
-d path Specify the destination path. This path will be the root directory used for
extracting the patch contents as well as for storing the patch metadata.
The default is the currently active QNX SDP installation.
-F Turn off prompting by forcing a “yes” answer to all queries. Normally
newer files aren’t overwritten by older files from the patch. This option
disables that check. This means locally updated files may be silently
replaced by an older version from the patch.
-H (QNX Neutrino 6.5.0 and later) Install all host-side files in the patch. By
default, applypatch installs only those for the current host OS.

The version of applypatch in 6.4.1 installs host-side files for all host OSs.

18 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. applypatch

-l List the patches, ordered from newest to oldest (based on installation


time).

-v Be verbose. Display some information on progress and activities.

-U num Uninstall the patch with the specified ID number, num.

CAUTION: Due to the nature of the patching process, any patch that was installed

! after patch ID num will be uninstalled as well. In effect, you’ll roll back to the state the
system was in just before patch ID num and all subsequent patches were applied.

Description:
The applypatch utility installs and uninstalls QNX patches, and also lists the
installed patches. It’s installed in $QNX_HOST/usr/bin and supports our current
patch tar files.

On Windows, run applypatch in cmd.exe.

This utility first backs up any files which will be overwritten and then extracts the
patch files.
If you’ve applied a sequence of patches, you can uninstall them only in reverse order.
If you select a patch (Patch ID X) for uninstallation, then any patches installed since
Patch ID X are also marked for uninstallation. A warning and list of affected patches is
printed and confirmation requested for this situation.

See also:
tar

June 22, 2010 Utilities 19


aps © 2010, QNX Software Systems GmbH & Co. KG.
Manage adaptive scheduler partitions

Syntax:
aps show [-d delay] [-f shorthand] [-l] [-v...]
[partition_name ...]

aps create -b budget [-B critical_budget] partition_name

aps modify [-b budget] [-B critical_budget] partition_name

aps modify [-y bankruptcy_policy ...] [-S scheduling_policy...]


[-s security_policy ...] [-w windowsize_ms]

Runs on:
Neutrino

Options:
-B milliseconds Specify the critical CPU budget, in milliseconds. The default is 0.

-b budget Specify the CPU budget as a percentage.

-d delay The delay period, in tenths of a second, when using the -l option.
The default is 50.

-f shorthand Display the information specified by shorthand:


• all — all the below
• overall_stats — information about the last bankruptcy
• scheduler — parameters for the thread scheduler, including
the current security setting, bankruptcy policy, and the size of
the averaging window
• partitions — information about the partitions, including
their names, IDs, parent IDs, budgets, critical budgets, and the
process and thread IDs of the last thread to go bankrupt
• usage — the amount of budget and critical budget that each
partition is currently using
The default is usage.

-l (“el”) Loop mode; display the information at the interval specified


by the -d option.
-S scheduling_policy . . .
Specify the policies for the adaptive partitioning scheduler. Each
scheduling_policy must be one of:
• normal
• freetime_by_ratio

20 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. aps

• bmp_safety
The default is normal. For more information about the policies,
see “Scheduling policies” in the entry for SchedCtl() in the
Neutrino Library Reference.
-s security_policy . . .
Specify the security policies to add to the system. Each
security_policy must be one of:
• root0_overall
• root_makes_partitions
• sys_makes_partitions
• parent_modifies
• nonzero_budgets
• root_makes_critical
• sys_makes_critical
• root_joins
• sys_joins
• parent_joins
• join_self_only
• partitions_locked
• recommended
• flexible
• basic
• none
The default is none. For more information about the policies, see
the description of SCHED_APS_ADD_SECURITY in the entry for
SchedCtl() in the Neutrino Library Reference.

Once you’ve added a security policy, you can’t remove it, except by rebooting the
system.

-v... Be verbose; display more information with the show command:


• -v — display the budget usage over the last averaging
window, window 2 (typically 10 times the length of the
averaging window), and window 3 (typically 100 times the
length of the averaging window)
• -vv — display the budget usage and critical budget usage over
the last averaging window, window 2, and window 3

June 22, 2010 Utilities 21


aps © 2010, QNX Software Systems GmbH & Co. KG.

-w windowsize_ms
Set the size of the averaging window, in milliseconds, for the
system. You can set the window size to any value from 8 ms to
400 ms.

If you change the tick size of the system at runtime, do so before defining the adaptive
partitioning scheduler’s window size. That’s because Neutrino converts the window
size from milliseconds to clock ticks for internal use.
For more information, see “Choosing the window size” in the
System Considerations chapter of the Adaptive Partitioning
User’s Guide.
-y bankruptcy_policy . . .
Set the bankruptcy policy for the system to the specified items.
Each bankruptcy_policy must be one of:
• cancel_budget — set the offending partition’s critical
budget to zero, which forces the partition to be scheduled by
its percentage CPU budget only. This also means that a second
bankruptcy can’t occur.
• log — not currently implemented.
• reboot — cause the system to crash with a brief message
identifying the offending partition. This is the most severe
response, suggested for use while testing a product, to make
sure bankruptcies are never ignored. You probably shouldn’t
use this option in your finished product.
• basic — deliver bankruptcy-notification events and make the
partition out-of-budget for the rest of the scheduling window
(nominally 100 ms).
• recommended — the combination of cancel_budget and
log.
• none — do nothing.
The default is basic. For more information about the policies,
see “Handling bankruptcy” in the entry for SchedCtl() in the
Neutrino Library Reference.

Description:
Use the aps command to create, modify, and query adaptive partitions from the
command line, as well as to set the averaging window, and the security and bankruptcy
policies for the entire system.

22 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. aps

You can’t include slashes (/) in a partition name.

To launch an application into a partition, use the -Xaps option to the on command.

Examples:
Create a partition called Drivers with a budget of 20% and a critical budget of 5
milliseconds:

aps create -b 20 -B 5 Drivers

Change the Drivers partition’s budget to 25% and its critical budget to 7
milliseconds:

aps modify -b 25 -B 7 Drivers

Specify a bankruptcy policy of recommended and a security policy of


root_makes_partitions for the entire system:

aps modify -y recommended -s root_makes_partitions

Display the amount of the budget and critical budget that the partitions are using,
every 2 seconds:

aps show -l -d 20 -f usage

Since usage is the default shorthand for the -f option, the above command is the
same as:

aps show -l -d 20

See also:
on, pidin
SchedCtl() in the Neutrino Library Reference
Adaptive Partitioning User’s Guide

June 22, 2010 Utilities 23


ar © 2010, QNX Software Systems GmbH & Co. KG.
Create and maintain library archives (POSIX)

Syntax:
ar_variant -key_letter[mod [relpos]] archive [member...]
ar_variant -M [ <mri-script ]

Runs on:
QNX Neutrino, Linux, Microsoft Windows

Options:
The ar_variant depends on the target platform, as follows:

Target platform: ar_variant:


ARM ntoarm-ar
MIPS ntomips-ar
PowerPC ntoppc-ar
SH4 ntosh-ar
x86 ntox86-ar

Description:
The ar program creates and modifies archives, and extracts members from them. An
archive is a single file holding a collection of other files in a structure that makes it
possible to retrieve the original individual files (called members of the archive).
The original files’ contents, mode (permissions), timestamp, owner, and group are
preserved in the archive; you can restore them on extraction. The ar utility can
maintain archives whose members have names of any length.
For detailed documentation, see the GNU website at http://www.gnu.org/.

Contributing author:
GNU

See also:
nm

24 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. arp
Address Resolution Protocol (ARP) display and control

Syntax:
arp [-n] hostname
arp [-nv] -a
arp [-v] -d -a
arp [-v] -d hostname [pro [iface_name]]
arp -s hostname ether_addr [temp] [pub [pro [iface_name]]]
arp -f filename

Runs on:
Neutrino

Options:
-a Display all of the current ARP entries.

-d hostname Delete an entry for the specified host. Only the superuser can use
this option.

-f filename Load the ARP cache with entries found in the specified file. Entries
in the file should be of the form:

hostname ether_addr [pub] [temp]


with argument meanings as given for the -s option.

-n Don’t try to resolve hostnames.

-s hostname ether_addr [temp] [pub [pro [iface_name]]]


Create an ARP entry for the host hostname with the Ethernet
address ether_addr. The Ethernet address is given as six hex bytes
separated by colons.
If pub is given, the entry is “published.” That is, this system acts as
an ARP server, responding to requests for hostname, even though
the IP address that’s mapped to hostname isn’t the address of this
system.
The entry is permanent unless the word temp is given in the
command.
Specify the pro string to create or delete a proxy-only ARP entry.
The iface_name argument is the name of the interface (e.g. fxp0).

-v Be verbose.

hostname A host name or the IP address.

June 22, 2010 Utilities 25


arp © 2010, QNX Software Systems GmbH & Co. KG.

Description:
The arp utility displays and modifies the Internet-to-Ethernet address translation
tables used by the Address Resolution Protocol (ARP).
With no options, the utility displays the current ARP entry for hostname. The host
may be specified by name or by number, using Internet dot notation.

License:
This utility is based on copyright software of The Regents of the University of
California; for licensing information, see the Third Party License Terms List at
http://licensing.qnx.com/third-party-terms/.

See also:
ifconfig, io-pkt*

26 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. /etc/autoconnect
Automatic TCP/IP connection-configuration script

Name:
/etc/autoconnect

Description:
The /etc/autoconnect script is run when an application needs to establish a
TCP/IP connection to a remote host. This file can be in any form (e.g. a shell script or
an executable), and contains all of the necessary commands required to create the
connection.
To activate the script, define the environment variable AUTOCONNECT and set its
value to 1.
If there’s no route to a remote host (see route, ifconfig, netmanager, phlip or
the options to io-pkt*), or there are no nameservers defined (see
/etc/nsswitch.conf) and a hostname can’t be resolved, the autoconnect script is
run. The exit status of the script determines whether or not a retry is attempted:

Zero The socket library attempts the action again.


Nonzero It doesn’t retry because the script failed.

One time you might use this feature is when you have a dialup ISP account for internet
access. The ppp link is established only when an application needs to reach a host over
the link. When the link is terminated depends on inactivity timeouts specified by the
client or server, errors, or other events. The autoconnect script only launches
commands to establish a connection; it doesn’t terminate the connection.
Suppose that a host is configured with only the localhost interface, and no
nameservers. You need to create a script:
pppd connect "/bin/chat -v -f /etc/chat" defaultroute \
+resconf 115200 updetach /dev/ser2

exit

The chat utility is used to dial the service provider. The important option here is the
updetach option. This option daemonizes pppd after the PPP interface has been
configured. This way, the script doesn’t exit until the interface is configured. If an
application attempts to resolve a hostname, the application blocks while a connection
to an ISP is established, which provides a nameserver and a default route. When the
script exits with a status of zero, the socket library retries and the application
continues, assuming that the function succeeded. If an exit status of non-zero is
returned, the socket library returns the original error to the application.
If you’re using the Photon dialer to establish your connection, the script would look
like this:
phdialer -a

exit

June 22, 2010 Utilities 27


/etc/autoconnect © 2010, QNX Software Systems GmbH & Co. KG.

The -a option causes phdialer to autoconnect and daemonize itself when the
interface is configured.

See also:
ifconfig, io-pkt*, netmanager, /etc/nsswitch.conf, phdialer, phlip,
pppd, route

28 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. basename
Return the nondirectory portion of pathname (POSIX)

Syntax:
basename string [suffix]

Runs on:
Neutrino

Options:
string A string of text.

suffix A string of text.

Description:
The basename utility is useful primarily for extracting the filename portion of a
pathname, but since it performs only string operations, you can use it with any string.
The basename utility prints to standard output a substring of its string argument, plus
a newline character. The basename utility forms this substring by doing the
following, in order:

1 Discarding any trailing slash (/) characters.

2 Discarding all characters up to and including the last slash character.

3 Deleting the string argument’s suffix, provided you’ve specified a suffix operand
that’s identical to the string operand’s suffix.
If suffix is equal to the remaining string, the suffix isn’t removed (e.g. if suffix is
prog.c and the remaining string is prog.c, the suffix .c isn’t removed).

The result is a null string only if string is a null string (""). In this case, basename
outputs a single newline character.
If string consists entirely of slash characters, basename prints a single slash, followed
by a newline character.
You’ll use the basename utility most often within shell scripts, where it’s normally
invoked inside back-ticks (‘...‘), or contained in $(...).

Examples:

Command: Output:
basename . .
basename /usr/src/prog.c prog.c

continued. . .

June 22, 2010 Utilities 29


basename © 2010, QNX Software Systems GmbH & Co. KG.

Command: Output:
basename /usr/src/prog.c .c prog
basename /usr/src/prog.c .a prog.c
basename /usr/src/ src
basename ...//[fred] [fred]

Exit status:
0 Successful completion.

>0 An error occurred.

See also:
dirname, fullpath

30 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. bc
“Bench calculator” arbitrary-precision arithmetic language (POSIX)

Syntax:
bc [-l] [file...]

Runs on:
Neutrino

Options:
-l (“el”) Include a library of defined math functions and set the scale to 20. (See
“Library functions,” below.)

file The pathname of a text file containing commands and function definitions to
be interpreted by bc. If any files are specified, bc processes those files, then
reads from the standard input.

Description:
The bc utility is an interactive, programmable calculator that supports a complete set
of control structures, including functions.
The bc utility supports 26 functions, 26 simple variables, and 26 array variables. Each
array may have up to 2048 elements. In addition, the utility performs arithmetic
operations using a radix 100 number system with user-definable precision. When you
specify the precision, the numbers are exact to that precision, unlike binary
floating-point representation where rounding errors may compromise accuracy. The
utility also operates in different bases, so you can easily convert numbers from one
base to another.
Many common programming language constructs are supported, including:

• if, while, and for statements

• user-defined functions with parameters

• local variables.

The bc utility provides no support for character or string manipulation. The syntax of
bc is derived from C, but doesn’t constitute a programming language.
Let’s look at a very simple bc program:

"hello, world\n"

When this program is run, the statement "hello, world" is echoed with a newline
character. In general, the result of any expression that isn’t assigned to a variable or
used in a control structure is echoed. For example, the following statement:

5ˆ2

June 22, 2010 Utilities 31


bc © 2010, QNX Software Systems GmbH & Co. KG.

causes bc to respond with 25.


Note that the caret (ˆ) is an integer exponentiation operator: aˆb is a raised to the bth
power, where b is truncated to an integer in the range -2ˆ31 to +2ˆ31. All of the “usual”
arithmetic operators (+, -,*,/,%) are available, but % is the remainder, not the modulus.

Bases
Two special builtin variables let you choose the base in which numbers are input and
output:

ibase Input base.

obase Output base.

When numbers are recognized, the input base determines the significance of each
digit. For example, the value 66 in base 10 is:

6 × 10ˆ0 = 6
+ 6 × 10ˆ1 = 60
--
66
whereas in base 8, it’s:

6 × 8ˆ0 = 6
+ 6 × 8ˆ1 = 48
--
54
Note that hex numbers are recognized in the different bases and that their values also
change with the base. For example, the number FF is valid in base 10 and has the
decimal value 165:

F(=15) × 10ˆ0 = 15
+ F(=15) × 10ˆ1 = 150
---
165
Setting the output base results in one of two numerical formats:

• For bases in the range 2 to 16, the format consists of the alphabet 0-9,A-F.

• For bases in the range 17 to 10000, the format consists of a series of decimal digits
with groups separated by spaces. In this format, each group represents a digit of
significance, thus the number 61 in obase=20 is printed as:
3 1
which should be interpreted as:
1 × 20ˆ0 = 1
+ 3 × 20ˆ1 = 60
--
61

32 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. bc

Variables
The bc utility supports 26 simple variables, named a through z (case is significant),
and 26 arrays, also named a through z. The context determines whether the simple
variable or the array is selected. All variables are auto-initialized to 0 and are always
available (i.e. there’s no declaration statement).
Functions may create local variables (with the auto statement) that hide the global
variables of the same name while the function is executing. Arrays are limited to 2048
elements. Variables may be referenced (right-valued) or assigned to (left-valued).

Assignment operators
The assignment operator has many variations, as in the C language. For example:

a += x

means the same as:

a = a + x

All of the binary operators have a corresponding assignment operator.


An assignment expression (e.g. a=10) has a right value that’s the new value of a.
Thus:

a = b = 10

assigns 10 to b, then assigns b to a.


The increment and decrement operators may be applied only to variables. The
statement:

b = a++

is semantically the same as:

b = a; a = a + 1;

and the statement:

b = ++a

is semantically the same as:

a = a + 1; b = a;

The following table summarizes operator precedence and associativity:

Operator Associativity Class


++, – Nonassociative (increment, decrement)

continued. . .

June 22, 2010 Utilities 33


bc © 2010, QNX Software Systems GmbH & Co. KG.

Operator Associativity Class


- Right to left (unary minus)
ˆ Right to left (exponentiation)
*, /, % Left to right (multiplicative)
+, - Left to right (additive)
==, <=, >=, !=, <, > Left to right (comparative)
= +=, -=, *=, /=, %=, ˆ=, Right to left (assignment)

The if statement
The if statement takes the following form:

if (expr) statement
The statement is executed only if expr evaluates to a nonzero quantity. Regardless of
the value of expr, the next statement is executed.

if (i > 2047) {
"i exceeds array limit"
i = 2047; /* limit index */
}
a[i] /* always print value */

Iteration statements
The bc utility supports two iteration statements: while and for. In both of these
structures, break means “exit the loop immediately,” and continue means “pretend
you have finished executing statement.”
The while statement has the general form:

while (expr) statement


and is executed following this algorithm:

1 If expr is false, go to 4.

2 Execute statement.

3 Go to 1.

4 Proceed.

In the while statement, continue and break are analogous to “Go to 1” and “Go to
4,” respectively.
The for statement has the general form:

for (expr1;expr2;expr3) statement

34 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. bc

and is executed following this algorithm:

1 expr1
2 If expr2 is false, go to 6.
3 Execute statement.
4 Execute expr3.
5 Go to 2.
6 Proceed.

In the for statement, continue and break are analogous to “Go to 4” and “Go to 6,”
respectively.

User-defined functions
In bc, you can define named functions that support parameters, local variables, and
recursion. A function name is a single lowercase character (a to z). A function has the
general form:
define name(parameter-list) { function-body }
You can’t remove or replace functions; it’s an error to attempt to do so. Functions can
call other functions, including themselves.
Functions can accept an arbitrary number of parameters, which may be either simple
or array variables.

Parameters are passed by value, that is, the function is given a private copy of all
parameters that remains in effect until the function returns. Notice that arrays are also
passed by value; this differs from the C calling convention.

The first statement in a function can be an auto statement, which creates “local”
variables for the function. The auto statement has this general form:
auto [variable|array]...
The local variables are used in place of the global variables of the same name until the
function returns; the local variables are also initialized to zero (see the example
below).
Functions can contain a return statement. The return statement causes the function
to exit, discarding any local variables and parameters. The statement may be in either
of two forms:
return
Or
return [retval]
where retval is a constant or a variable name. If no specific return statement is
given, or if retval is omitted, a value of 0 is returned.

June 22, 2010 Utilities 35


bc © 2010, QNX Software Systems GmbH & Co. KG.

The following example shows various constructs being used in functions:


/* function s(b[], n)
* return the sum of the first n elements of b[]
*/
define s(b[],n) {
auto t,i; /* note that the ’;’s are for style,
and aren’t required. */

if (n > 2048) {
"Array length out of bounds...\n"
return 0;
}
for (i=0; i < n; i++) {
t += b[i];
}
return t;
}

The function s() is introduced by the define statement, which also reveals the
parameter types. It’s important that all functions be called with the appropriate types
and number of parameters. Failure to do so results in unpredictable errors.

All parameters in bc are passed by value, including arrays. This is unlike C, where
arrays are always passed by reference.

The auto statement introduces the locally scoped variables t and i. You should use
automatic variables to prevent unwanted side effects of using global variables.

Builtin variables and functions


Several builtin control variables affect how bc operates. The following variables may
be set or queried:

Name Function Range Default


scale Minimum precision maintained in 0..100 0
calculations
ibase Radix for input 2..10000 numbers 10
obase Radix for output 2..10000 numbers 10

The bc utility provides the following builtin functions:

Function Returns
sqrt(expression) Square root of the value

continued. . .

36 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. bc

Function Returns
length(expression) Number of significant decimal digits in the expression
scale(expression) Number of decimal digits to the right of the decimal marker

Library functions
The bc library is enabled if you invoke bc with the -l option, or if you include the
interpretation file /usr/lib/bclib.b in the command line. The library sets the
scale to 20, which you can override by assigning a new value. The library defines the
following functions:

Syntax Function
a(expression) Arctangent (in radians)
c(expression) Cosine (in radians)
e(expression) Exponential function
k(expr1,expr2) Bessel function of integer order
l(expression) Natural logarithm
s(expression) Sine (in radians)

Files:
/usr/lib/bclib.b
Contains the bc library, a set of function definitions that are loaded
automatically when the -l option is specified. This file must be present for the
-l option to work.

Exit status:
0 Successful completion.

>0 An error occurred.

Caveats:
The bc utility’s syntax contains a few ambiguities:

• The notion of a statement in bc is either a structured statement or an expression


followed by a newline or a semicolon (;). An expression may be nil, thus a single
newline forms a statement. This can lead to unexpected behavior, as in the
following example, where the while statement never terminates:
a=0
while (a < 100)

June 22, 2010 Utilities 37


bc © 2010, QNX Software Systems GmbH & Co. KG.

a++
a
Although the intent is obvious, the newline at the end of the while statement
comprises the body of the loop, thus a is never incremented. The C equivalent of
this example is:
a=0;
while (a < 100);
The following are “correct” versions:
a=0
while (a < 100) a++
Or
while (++a < 100)
Or
while (a < 100) {
a++
}

• The quit statement causes bc to exit when it encounters the statement, not when it
attempts to execute it. Thus, the following causes bc to exit immediately:
if (0) {
quit
}
and is equivalent to:
quit

See also:
Brian W. Kernighan and Dennis M. Ritchie, The C Programming Language,
Prentice-Hall, 1978

38 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. bdftophf2
Convert BDF fonts to Photon fonts

Syntax:
bdftophf2 [-A offset] [-E end_character]
[-N num_chars] [-O output_file]
[-o output_path] [-S start_character]
bdf_file

Runs on:
Neutrino

Options:
-A offset Offset character encodings.

-E end_character Set ending character code.

-N num_chars The maximum number of characters to convert.

-O output_file Write the converted file to output_file. Overrides the -o option.

-o output_path Write the converted file to output_path.

-S start_character Set starting character code.

bdf_file Name of the BDF file to convert.

Description:
The bdftophf2 utility converts Binary Data Format (BDF) font files into Photon font
files. BDF is a universal standard for ASCII bitmap font representation.

Examples:
Convert all the BDF Courier font files in the /font/bdf directory to Photon font files
in the /home/fred/font directory:

bdftophf2 -o /home/fred/font /font/bdf/cour*.bdf

The Extension installation is necessary only if you want this font to be searched for
characters not found (such as Asian/Latin fonts) in other font files.

Caveats:
This utility works only with Unicode BDF files.
The glyphs within the .bdf file must be sorted in ascending order. For example,
0x0000, 0x0020,0x2e5f, 0xfffe is an example of a set of glyphs listed in ascending
order.

June 22, 2010 Utilities 39


bindres © 2010, QNX Software Systems GmbH & Co. KG.
Bind or extract resources from a file

Syntax:
bindres [-x|-l][-q|-v] resfile|loadfile [widgetfile...]

Runs on:
QNX Neutrino, Linux, Microsoft Windows

Options:
-l List the widgetfiles in the resfile. If no widget files are specified, all the
files are listed.

-q Quiet mode, produce no output.

-v Verbose mode.

-x Extract the widgetfiles in the resfile. If no widget files are specified, all
the widget files are extracted.

resfile A widget resource file created by bindres.

loadfile The name of an executable program or shared object to bind the


resource information to.

widgetfile The name of a widget file (for example, base.wgtw).

Description:
This utility binds the widgets in one or more widgetfiles into a single resource file
resfile. It’s usually run automatically as part of the PhAB build process. If you specify
a loadfile (an executable or shared object in ELF format), bindres creates a
temporary resource file, then binds it into the application.
It is possible to run an application with a separate widget resource file. If widget
resources are not bound into an application executable, at runtime the system looks for
widgets in a file with the same name as the application, but with a .res extension.
This utility can also list or extract the widgets in widget resource (.res) files
generated by bindres.

See also:
ldrel
Generating, Compiling, and Running Code in the Photon Programmer’s Guide

40 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. bison
General-purpose parser generator (GNU)

Syntax:
bison [options] input_file

Runs on:
QNX Neutrino, Linux, Microsoft Windows

Options:
For a complete listing, see the documentation at
http://www.gnu.org/software/bison/manual/.

Description:
The bison utility is a general-purpose parser generator that converts an annotated
context-free grammar into a parser for that grammar. For detailed documentation, see
http://www.gnu.org/software/bison/manual/.

This utility is subject to the GNU Public License (GPL). We’ve included it for use on
development systems.

Contributing author:
GNU

June 22, 2010 Utilities 41


bkgdmgr © 2010, QNX Software Systems GmbH & Co. KG.
Photon Background Manager

Syntax:
bkgdmgr

Runs on:
Neutrino

Options:
None.

Description:
The Photon Background Manager (bkgdmgr) provides advanced capabilities for
Photon’s desktop background display.
In addition to being able to draw a solid color background, bkgdmgr can blend
primary and secondary colors in a tiled 8×8 pixel pattern, or display a bitmap image
in any format that Photon supports. Bitmaps can be displayed in any of the following
modes:

Tiled to fill Repeats the image side-to-side and top-to-bottom to fill the
screen. Tile positioning can be biased to the top, bottom, left,
right (or a combination such as top-left), or centered.

Stretched to fill Stretches the image to fill the screen. You can specify that
bkgdmgr either maintain the original aspect (width:height) ratio
of the image, or ignore it if necessary to fill the screen.

Unmodified Don’t tile or stretch the image, but display only a single copy.
Positioning can be biased to the top, bottom, left, right (or a
combination such as top-left), or centered.

If you need only a solid background color, you don’t need to run bkgdmgr. The
Photon Window Manager, pwm, can draw a solid color desktop background.

The Background Manager reads options from a config file that it shares with pwm,
located in $HOME/.ph/wm/wm.cfg. If $HOME isn’t set, bkgdmgr looks for the
file in /.ph/wm/wm.cfg. Normally you don’t edit this file manually. Use the
Background tab on the pwmopts utility to set the options for bkgdmgr, which are
saved to the configuration file.
You can force bkgdmgr to reread the configuration file and reapply the settings by
rerunning it, or by sending it the signal SIGUSR1, for example, slay -sUSR1
bkgdmgr.

42 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. bkgdmgr

Files:
$HOME/.ph/wm/wm.cfg
Holds a user’s PWM workspace and configuration.

See also:
pwm, pwmopts

June 22, 2010 Utilities 43


bootpd © 2010, QNX Software Systems GmbH & Co. KG.
Internet boot protocol server

You must be root to start this server.

Syntax:
bootpd [-dpsT] [-t timeout] [configfile]

Runs on:
Neutrino

Options:
-d Increase the level of debugging output (-dd to be more verbose).

-s Run in standalone configuration. Use this option if bootpd is not


being started by inetd (e.g. when started in a sysinit file).

-T Do not remove unknown vendor-specific information. The default is to


remove the vendor-specific section of the response packet if unknown,
or remove unknown options if the vendor is known.

-t timeout When not running standalone, this option specifies the time in minutes
that bootpd will wait for the next boot request before exiting to
conserve system resources. When the next boot request arrives, inetd
will restart bootpd. If you don’t want bootpd to exit, give timeout a
value of 0. The default timeout is 15 minutes.

configfile Specify a configuration file (the default file is /etc/bootptab).

Description:
The bootpd server implements an Internet Boot Protocol server as defined in RFC
951 and RFC 1048.
It’s normally invoked by the inetd daemon via the following line in the
/etc/inetd.conf file:

bootps dgram udp wait root /usr/sbin/bootpd bootpd

This method conserves system resources: bootpd is started only when a boot request
arrives, and if it doesn’t receive another boot request within fifteen minutes (default) of
the last one received, it exits. You can use the -t option to specify a different timeout
value in minutes (e.g. -t 20). A timeout value of zero means forever.
Rather than wait for a boot request, bootpd can be started independently of inetd.
This is probably the desired mode of operation for large network installations with
many hosts.

44 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. bootpd

When using the -s option, bootpd and inetd may compete for the same port. Make
sure to comment out the bootps entry in the /etc/inetd.conf file. In this case, the
-t option has no effect, because bootpd never exits.

Upon startup, bootpd first reads its configuration file, /etc/bootptab, and then
begins listening for BOOTREQUEST packets.
The server rereads its configuration file when it receives a hangup signal (SIGHUP) or
when it receives a bootp request packet and detects that the file has been updated.
Hosts may be added, deleted, or modified when the configuration file is reread.

Files:
/etc/bootptab Boot protocol server configuration file.

/etc/services Service name database.

The bootpd daemon requires the libsocket.so shared library.

Errors:
Reported to system log.

License:
This utility is based on software of Carnegie Mellon University; for licensing
information, see the Third Party License Terms List at
http://licensing.qnx.com/third-party-terms/.

Caveats:
Individual host entries must not exceed 1024 characters.

See also:
/etc/bootptab, inetd, tftpd
TCP/IP Networking in the Neutrino User’s Guide
Based on RFC 951, RFC 1048, RFC 1084, Assigned Numbers

June 22, 2010 Utilities 45


/etc/bootptab © 2010, QNX Software Systems GmbH & Co. KG.
Boot protocol server configuration file

Name:
/etc/bootptab

Description:
The /etc/bootptab file is used by the bootpd daemon.
The configuration file has a format similar to that of termcap, in which two-character
case-sensitive tag symbols are used to represent host parameters. These parameter
declarations are separated by colons (:). The general format is:

hostname:tg=value... :tg=value... :tg=value...


where hostname is the actual name of a bootp client and tg is a two-character tag
symbol. Most tags must be followed by an equals sign (=) and a value as above. Some
may also appear in a Boolean form with no value (e.g. :tg:). The currently
recognized tags are:

bf Bootfile.

bs Bootfile size. This can be:


• a decimal, octal, or hexadecimal integer (specifying the size of the bootfile
in 512-octet blocks)
Or
• the keyword auto, which causes the server to automatically calculate the
bootfile size at each request.
If bs is specified as a boolean, auto is assumed.

cs Cookie server address list (a whitespace-separated list of IP addresses).

ds Domain name server address list (a whitespace-separated list of IP addresses).

gw Gateway address list (a whitespace-separated list of IP addresses).

ha Host hardware address. This must be specified in hexadecimal (optional


periods and/or a leading 0x may be included for readability). The ha tag must
follow the ht tag (either explicitly or implicitly; see tc below).

hd Bootfile home directory.

hn Send hostname. This is strictly a boolean tag; it doesn’t take the usual equals
sign and value. Its presence indicates that the hostname should be sent to
RFC 1048 clients. The bootpd daemon attempts to send the entire hostname
as it’s specified in the configuration file. If the name doesn’t fit into the reply
packet, it’s shortened to just the host field (up to the first period, if present) and
then tried. The server never sends an arbitrarily truncated hostname (if nothing
reasonable fits, nothing is sent).

46 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. /etc/bootptab

ht Host hardware type (see Assigned Numbers RFC). This tag specifies the
hardware type code as either an unsigned decimal, octal, or hexadecimal
integer or as one of the following symbolic names:
• ethernet or ether for 10M Ethernet
• ieee802, tr, or token-ring for IEEE 802 networks.

im Impress server address list (a whitespace-separated list of IP addresses).

ip Host IP address (a single IP address).

lg Log server address list (a whitespace-separated list of IP addresses).

lp LPR server address list (a whitespace-separated list of IP addresses).

ns IEN-116 name server address list (a whitespace-separated list of IP addresses).

rl Resource location protocol server address list (a whitespace-separated list of


IP addresses).

sa TFTP server address the client should use (useful with multi-homed servers).
This tag takes a whitespace-separated list of IP addresses.

sm Host subnet mask (a single IP address).

tc Table continuation (points to similar “template” host entry).

td TFTP root directory used by secured TFTP server.

to Time offset. This can be:


• a signed decimal integer specifying the client’s timezone offset (in seconds
from UTC)
Or
• the keyword auto, which uses the server’s timezone offset.
If to is specified as a boolean, auto is assumed.

ts Time server address list (a whitespace-separated list of IP addresses).

vm Vendor magic cookie selector. This can be one of the following keywords:
• auto (indicating that vendor information is determined by the client’s
request)
• rfc1048 (which always forces an RFC 1048-style reply)
• cmu (which always forces a CMU-style reply).

There’s also a generic tag, Tn, where n is an RFC 1048 vendor field tag number. This
lets you take advantage of future extensions to RFC 1048 without being forced to
modify bootpd first. Generic data may be represented as either a stream of
hexadecimal numbers or as a quoted string of ASCII characters. The length of the

June 22, 2010 Utilities 47


/etc/bootptab © 2010, QNX Software Systems GmbH & Co. KG.

generic data is automatically determined and inserted into the proper field(s) of the
RFC 1048-style bootp reply.
All IP addresses are specified in standard Internet “dot” notation and may use decimal,
octal, or hexadecimal numbers (octal numbers begin with 0, hexadecimal numbers
begin with 0x or 0X).
The hostname, home directory, and bootfile are ASCII strings that may be optionally
surrounded by double quotes ("). The client’s request and the values of the hd and bf
symbols determine how the server fills in the bootfile field of the bootp reply packet.
If the client specifies an absolute pathname and that file exists on the server machine,
then that pathname is returned in the reply packet. If the file can’t be found, the
request is discarded and no reply is sent. If the client specifies a relative pathname, a
full pathname is formed by prepending the value of the hd tag and testing for existence
of the file. If the hd tag isn’t supplied in the configuration file or if the resulting boot
file can’t be found, then the request is discarded.
Clients that specify null boot files always elicit a reply from the server. The exact reply
again depends on the hd and bf tags. If the bf tag gives an absolute pathname and the
file exists, then that pathname is returned in the reply packet. If the hd and bf tags
together specify an accessible file, then that filename is returned in the reply. If a
complete filename can’t be determined or if the file doesn’t exist, then the reply
contains a zeroed-out bootfile field.

In all these cases, the file must have its public read access bit set, since this is required
by tftpd.

Many host entries often share common values for certain tags (such as name servers,
etc.). Rather than repeatedly specify these tags, you can use the tc (table
continuation) mechanism to list a full specification for one host entry that can be
shared by others. The template entry is often a dummy host that doesn’t actually exist
and never sends bootp requests. This feature is similar to the tc feature of termcap
for similar terminals.
Note that bootpd allows the tc tag symbol to appear anywhere in the host entry,
unlike termcap, which requires it to be the last tag. Information explicitly specified
for a host always overrides information implied by a tc tag symbol, regardless of its
location within the entry. The value of the tc tag may be the hostname or IP address
of any host entry previously listed in the configuration file.
Sometimes it’s necessary to delete a specific tag after it’s been inferred via tc. You
can do this by using the construction tag @, which removes the effect of the tag as in
termcap.
For example, to completely undo an IEN-116 name server specification, put the
following at an appropriate place in the configuration entry:

:ns@:

After removal with @, a tag is eligible to be set again through the tc mechanism.

48 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. /etc/bootptab

Blank lines and lines beginning with a pound sign (#) are ignored in the configuration
file. Host entries are separated from one another by newlines; a single host entry may
be extended over multiple lines if the lines end with a backslash (\). Lines can be
longer than 80 characters.
Tags may appear in any order, with the following exceptions:

• the hostname must be the very first field in an entry

• the hardware type must precede the hardware address.

Here’s a sample /etc/bootptab file:

# Sample bootptab file

default1:\
:hd=/usr/boot:bf=null:\
:ds=128.2.35.50 128.2.13.21:\
:ns=0x80020b4d 0x80020ffd:\
:ts=0x80020b4d 0x80020ffd:\
:sm=255.255.0.0:gw=0x8002fe24:\
:hn:vm=auto:to=-18000:\
:T37=0x12345927AD3BCF:T99="Special ASCII string":

carnegie:ht=6:ha=7FF8100000AF:ip=128.2.11.1:tc=default1:
baldwin:ht=1:ha=0800200159C3:ip=128.2.11.10:tc=default1:
wylie:ht=1:ha=00DD00CADF00:ip=128.2.11.100:tc=default1:
arnold:ht=1:ha=0800200102AD:ip=128.2.11.102:tc=default1:
bairdford:ht=1:ha=08002B02A2F9:ip=128.2.11.103:tc=default1:
bakerstown:ht=1:ha=08002B0287C8:ip=128.2.11.104:tc=default1:

# Special domain name server for next host


butlerjct:ht=1:ha=08002001560D:ip=128.2.11.108:ds=128.2.13.42:tc=default1:

gastonville:ht=6:ha=7FFF81000A47:ip=128.2.11.115:tc=default1:
hahntown:ht=6:ha=7FFF81000434:ip=128.2.11.117:tc=default1:
hickman:ht=6:ha=7FFF810001BA:ip=128.2.11.118:tc=default1:
lowber:ht=1:ha=00DD00CAF000:ip=128.2.11.121:tc=default1:
mtoliver:ht=1:ha=00DD00FE1600:ip=128.2.11.122:tc=default1:

The bootpd daemon looks in /etc/services to find the port numbers it should use.
Two entries are extracted:

• bootps — the bootp server listening port

• bootpc — the destination port used to reply to clients.

If the port numbers can’t be determined this way, they’re assumed to be 67 for the
server and 68 for the client.

Caveats:
As a QNX Neutrino extension, the argument to the bf tag can start with an “or bar”
character (|). If it does, then the following is taken to be a command to spawn in order
to get a boot image:

bf=|cd /boot; mkifs build/node1:

June 22, 2010 Utilities 49


/etc/bootptab © 2010, QNX Software Systems GmbH & Co. KG.

If you use this extension, tftpd must not be started as root. One choice is to create
the user tftp and start tftpd as that user. You could also create and use the user
ftp, but that opens up your machine to anonymous ftp. For information on how to
change the user as which tftpd starts, see /etc/inetd.conf.

See also:
bootpd

50 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. brconfig
Configure network bridge parameters

Syntax:
brconfig -a

or:

brconfig bridge [command [args ...]]

Runs on:
Neutrino

Options:
-a Display the status of all bridge devices present on the system. This flag is
mutually exclusive with all other subcommands.

All other operations require that a bridge be specified. If a bridge is specified with no
subcommands, the status of that bridge is displayed. The following subcommands are
available:

up Start forwarding packets on the bridge.

down Stop forwarding packets on the bridge.

add interface Add the interface named by interface as a member of the


bridge. The interface is put into promiscuous mode so that it
can receive every packet sent on the network.

delete interface Remove the interface named by interface from the bridge.
Promiscuous mode is disabled on the interface when it’s
removed from the bridge.

maxaddr size Set the size of the bridge address cache to size. The default is
100 entries.

timeout seconds Set the timeout of address cache entries to the given number of
seconds. If seconds is zero, then address cache entries don’t
expire. The default is 1200 seconds.

deladdr address Delete address from the address cache.

flush Delete all dynamically-learned addresses from the address


cache.

flushall Delete all addresses, including static addresses, from the


address cache.

June 22, 2010 Utilities 51


brconfig © 2010, QNX Software Systems GmbH & Co. KG.

discover interface Mark an interface as a “discovering” interface. When the bridge


has no address cache entry (either dynamic or static) for the
destination address of a packet, the bridge forwards the packet
to all member interfaces marked as “discovering.” This is the
default for all interfaces added to a bridge.

-discover interface
Clear the “discovering” attribute on a member interface. For
packets without the “discovering” attribute, the only packets
forwarded on the interface are broadcast or multicast packets
and packets for which the destination address is known to be on
the interface’s segment.

learn interface Mark an interface as a “learning” interface. When a packet


arrives on such an interface, the source address of the packet is
entered into the address cache as being a destination address on
the interface’s segment. This is the default for all interfaces
added to a bridge.

-learn interface Clear the “learning” attribute on a member interface.

stp interface Enable the IEEE 802.1D Spanning Tree Protocol (STP) on the
interface. Spanning Tree is used to detect and remove loops in a
network topology.

-stp interface Disable the Spanning Tree Protocol on the interface. This is the
default for all interfaces added to a bridge.

maxage seconds Set the time that a Spanning Tree Protocol configuration is
valid. The default is 20 seconds, the minimum 1 second, and
the maximum 255 seconds.

fwddelay seconds Set the time that must pass before an interface begins
forwarding packets when Spanning Tree is enabled. The default
is 15 seconds, the minimum 1 second, and the maximum 255
seconds.

hellotime seconds Set the time between broadcasting of Spanning Tree protocol
configuration messages. The default is 2 seconds, the minimum
1 second, and the maximum 255 seconds.

priority value Set the bridge priority for Spanning Tree. The default is 32768.
Allowed numerical values range from 0 (highest priority) to
65535 (lowest priority).

ifpriority interface value


Set the Spanning Tree priority of the interface to value. The
default is 128, the minimum 0, and the maximum 255.

52 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. brconfig

ifpathcost interface value


Set the Spanning Tree path cost of the interface to value. The
default is 55, the minimum 0, and the maximum 65535.

Description:
The brconfig utility is used to configure network bridge parameters and retrieve
network bridge parameters and status from io-pkt.
A network bridge creates a logical link between two or more IEEE 802 networks that
use the same (or “similar enough”) framing format. For example, it’s possible to
bridge Ethernet and 802.11 networks together, but it isn’t possible to bridge Ethernet
and Token Ring networks together.
To create a bridge interface, use the ifconfig command’s create subcommand.
Perform all other bridge configuration using the brconfig utility.

Examples:
The following code, when placed in the file /etc/ifconfig.bridge0, creates a
bridge called bridge0, adds the interfaces ray0 and fxp0 to the bridge, and then
enables packet forwarding. You could use such a configuration to implement a simple
802.11-to-Ethernet bridge (assuming the 802.11 interface is in ad hoc mode).

create
!brconfig $int add ray0 add fxp0 up

Consider a system with two 4-port Ethernet boards. The following code, when placed
in the file /etc/ifconfig.bridge0 causes a bridge consisting of all eight ports to
be created with Spanning Tree enabled:

create
!brconfig $int \
add tlp0 stp tlp0 \
add tlp1 stp tlp1 \
add tlp2 stp tlp2 \
add tlp3 stp tlp3 \
add tlp4 stp tlp4 \
add tlp5 stp tlp5 \
add tlp6 stp tlp6 \
add tlp7 stp tlp7 \
up

See also:
ifconfig, pf

June 22, 2010 Utilities 53


bunzip2 © 2010, QNX Software Systems GmbH & Co. KG.
Decompress files

Syntax:
bunzip2 [options] [files...]

Runs on:
Neutrino

Options:
For a complete listing, see bzip2

Description:
This utility decompresses files that have been compressed with bzip2.

See also:
bzip2 freeze, gzip, pax, tar
Backing Up and Recovering Data in the Neutrino User’s Guide

54 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. bz2cat
Decompress files to standard output

Syntax:
bz2cat [options] [files...]

Runs on:
Neutrino

Options:
For a complete listing, see bzip2

Description:
This utility decompresses files that have been compressed with bzip2, and sends the
output to standard output.

See also:
bzip2 freeze, gzip, pax, tar

June 22, 2010 Utilities 55


bzip2 © 2010, QNX Software Systems GmbH & Co. KG.
Compress and decompress files

Syntax:
Compress and decompress files:

bzip2 [options] [files...]

Decompress files:

bunzip2 [options] [files...]

Decompress files to standard output:

bz2cat [options] [files...]

Runs on:
Neutrino

Options:
-1 . . . -9 Set the blocksize to 100k . . . 900k.

-c Send output to standard output.

-d Force decompression.

-f Force the utility to overwrite existing output files.

-h Display a help message.

-k Keep (i.e. don’t delete) input files.

--repetitive-best
Compress repetitive blocks better.

--repetitive-fast
Compress repetitive blocks faster.

-s (Small) use less memory (at most 2500K).

-t Test the integrity of the compressed file.

-v Verbose output; a second v makes the utility more verbose.

-z Force compression.

56 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. bzip2

Description:
This utility compresses and decompresses files:

• If invoked as bzip2, the default action is to compress.

• As bunzip2, the default action is to decompress.

• As bz2cat, the default action is to decompress to stdout.

If no file names are given, bzip2 compresses or decompresses from standard input to
standard output.

See also:
freeze, gzip, pax, tar
Backing Up and Recovering Data in the Neutrino User’s Guide

June 22, 2010 Utilities 57


c++filt © 2010, QNX Software Systems GmbH & Co. KG.
Demangle C++ and Java symbols

Syntax:
c++filt [options] [symbol...]

Runs on:
QNX Neutrino, Linux, Microsoft Windows

Options:
See the GNU website at http://www.gnu.org/.

Description:
The C++ and Java languages provides function overloading, which means that you can
write many functions with the same name (providing each takes parameters of
different types). All C++ and Java function names are encoded into a low-level
assembly label (this process is known as mangling). The c++filt program does the
inverse mapping: it decodes (demangles) low-level names into user-level names so
that the linker can keep these overloaded functions from clashing.
For detailed documentation, see the GNU website at http://www.gnu.org/.

Contributing author:
GNU

58 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. calib
Calibrate a touchscreen

Syntax:
calib [options]

Runs on:
Neutrino

Options:
-a alg Specify the calibration algorithm. Valid algorithms are 3 and 4. Default
value is 3.

-b val Specify the touch point acceptance variance (range 0 - 2000). Enabling
this will force bound checking on touch points.

-c Don’t run if a configuration file already exists at


/etc/system/config/calib.$(hostname).

-d w,h The width and height of the screen to be calibrated. If you don’t specify
this option, calib attempts to get this information from the hardware.

-f file The name and location of a calibration file to create instead of the
default at /etc/system/config/calib.$hostname.

-l limit Limit the number of samples for each touch point. Default value is 15.

-o offset Offset for crosshair position, which you can use to tweak calibration.
Applicable only with 4-point calibration.

-O The Origin. Touch screen origin (0,0) is at the lower right side. Default
is upper left corner.

-p x, y The offset position of the calibration region.

-P Supress prompts (no text is displayed on screen). Prompts are on by


default.

-s server The server node or the device name.

-S Use small touch targets. Default is large.

-t timer The done button timer value. Default value is 10.

-v Verbose output.

-x x The initial x position.

-y y The initial y position.

June 22, 2010 Utilities 59


calib © 2010, QNX Software Systems GmbH & Co. KG.

Description:
The calib utility is used to calibrate a touchscreen. Once the touchscreen is
successfully configured (i.e. you’ve created an input.node file), it must be calibrated.
The calib utility saves a configuration file at
/etc/system/config/calib.$hostname. For information about this file format,
see the “Calibration file format” section of the “Writing an Input Device Driver”
chapter of the Input DDK documentation.
To invoke the calibration screen:

1 Start Photon.

2 Run calib.

3 Touch the bullseye target on the screen.

4 Touch the Press to Complete Calibration button to finish calibration.

Examples:
Calibrate a quarter of a standard 640x480 VGA screen (the driver will cover only part
of the screen):

calib -d 320,240

60 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. cam-cdrom.so
Provide a common access method for CD-ROMs

Syntax:
driver ... cdrom cdrom_options ... &

Runs on:
Neutrino

Options:
driver One of the devb-* drivers.

The cdrom options control the driver’s interface to cam-cdrom.so for CD-ROM
devices. If specified, they must follow the cdrom keyword:

name=prefix Specify the device prefix (default: cd);

retries=num:path_id:target:lun
Set the maximum number of command retries on the specified
path, target, and lun. The default is 10.

timeout=time:path_id:target:lun
Set the command timeout on the specified path, target, and lun.
The default for a CD-ROM is 10 seconds; for a CD changer, it’s
20 seconds.

verbose[=level] Be verbose. If you don’t specify a level, cam-cdrom.so


increments the current level by one.

Description:
The cam-cdrom.so shared object provides common access methods (CAMs) for
CD-ROM devices.

See also:
cam-disk.so, cam-optical.so, devb-*, fs-*, io-blk.so
Connecting Hardware in the Neutrino User’s Guide

June 22, 2010 Utilities 61


cam-disk.so © 2010, QNX Software Systems GmbH & Co. KG.
Provide a common access method for hard disks

Syntax:
driver ... disk disk_options ... &

Runs on:
Neutrino

Options:
driver One of the devb-* drivers.

The disk options control the driver’s interface to cam-disk.so. If specified, they
must follow the disk keyword:

name=prefix[@device_number]
Specify the device prefix and optionally where to start
numbering the devices from:
• disk name=usb names the devices /dev/usb0,
/dev/usb1, and so on
• disk name=usb@2 starts at /dev/usb2, /dev/usb3, and
so on (in the absence of any existing naming conflicts)

CAUTION: Specify device numbers only on a closed system where you know all the

! devices and indexes.


The default is hd.

nobios Don’t use the geometry from BIOS int 13. By default, if you
don’t specify the translation option, the BIOS geometry is
used.

noptab Don’t use the geometry from the partition table. The geometry
from the partition table is used if you specify the nobios
option, or the BIOS geometry is invalid.

retries=num:path_id:target:lun
Set the maximum number of command retries on the specified
path, target, and lun. The default is 10.

timeout=time:path_id:target:lun
Set the command timeout on the specified path, target, and lun.

translation=heads[:sectors[:path_ID[:target[:lun]]]]
Specify the geometry explicitly; this overrides the geometry
from the BIOS and the partition table. The arguments are:

62 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. cam-disk.so

• heads and sectors — report this many heads (and optionally,


sectors) to io-blk.so for hard disks (default is 64 heads
and 32 sectors). The QNX filesystem doesn’t need this
information for normal operation. It’s needed only to let
fdisk write the correct boot cylinder for booting.
• path_ID — the number of the controller to use, where the
first controller is 0 (the default).
• target — for IDE, this is the master (0) or slave (1); for SCSI,
it’s the SCSI ID the device is jumpered for. The default is 0.
• lun — the Logical Unit Number for SCSI; not needed for
IDE. The default is 0.

verbose[=level] Be verbose. If you don’t specify a level, cam-disk.so


increments the current level by one.

Description:
The cam-disk.so provides common access methods (CAMs) for hard disk devices.

See also:
cam-cdrom.so, cam-optical.so, devb-*, fdisk, fs-*, io-blk.so

June 22, 2010 Utilities 63


cam-optical.so © 2010, QNX Software Systems GmbH & Co. KG.
Provide a common access method for optical disks

Syntax:
driver ... optical disk_options ... &

Runs on:
Neutrino

Options:
driver One of the devb-* drivers.

The optical options control the driver’s interface to cam-optical.so. If specified,


they must follow the optical keyword:

name=prefix Specify the device prefix (default: mo);

nobios Don’t use the geometry from BIOS int 13. By default, if you don’t
specify the translation option, the BIOS geometry is used.

noptab Don’t use the geometry from the partition table. The geometry from
the partition table is used if you specify the nobios option, or the
BIOS geometry is invalid.
retries=num@path_id:target:lun
Set the maximum number of command retries on the specified path,
target, and Logical Unit Number (LUN). The default is 10.
rmb=[true|false]@path_id:target:lun
Set/clear the device as removable on path N, target N, and LUN N.
timeout=g1:g2:g3:rw@path_id:target:lun
Set the rw and group command timeouts on path N, target N, and
LUN N. The defaults are the values from the Timeout and Protect
mode page if supported, otherwise 60:90:10:10 (in seconds).
translation=heads[:sectors[@path_ID[:target[:lun]]]]
Specify the geometry explicitly; this overrides the geometry from the
BIOS and the partition table. The arguments are:
• heads and sectors — report this many heads (and optionally,
sectors) to io-blk.so for hard disks (default is 64 heads and 32
sectors). The QNX filesystem doesn’t need this information for
normal operation. It’s needed only to let fdisk write the correct
boot cylinder for booting.
• path_ID — the number of the controller to use, where the first
controller is 0 (the default).
• target — for IDE, this is the master (0) or slave (1); for SCSI, it’s
the SCSI ID the device is jumpered for. The default is 0.

64 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. cam-optical.so

• lun — the Logical Unit Number for SCSI; not needed for IDE.
The default is 0.
verbose=verbosity@path_id:target:lun
Set the verbosity level on path N, target N, and LUN N.

Description:
The cam-optical.so provides common access methods (CAMs) for optical disk
devices.

See also:
cam-disk.so, cam-cdrom.so, devb-*, fdisk, fs-*, io-blk.so

June 22, 2010 Utilities 65


cat © 2010, QNX Software Systems GmbH & Co. KG.
Concatenate and print files (POSIX)

Syntax:
cat [-c] [-n|-r] [-u] [file...]

Runs on:
QNX Neutrino, Linux, Microsoft Windows

Options:
-c Compress sequences of multiple newline characters into single newlines.
-n Print line numbers, but don’t restart the number for each new file.

-r Print line numbers, restarting the number for each new file.
-u Write unbuffered output. Data from the input file(s) is written to the standard
output without delay as each file is read.
file The pathname of an input file. If no files are specified, the standard input is
used. If a file is the dash character (-), cat reads from the standard input at
that point in the sequence.

Description:
The cat utility reads files in the order you specify and writes their contents to
standard output.

Examples:
Write the contents of myfile to standard output:
cat myfile
Concatenate doc1 and doc2 and write the result to doc.all:
cat doc1 doc2 > doc.all

Exit status:
0 All input files were output successfully.
>0 An error occurred.

Caveats:
Because of the shell language mechanism used to perform output redirection, a
command such as:
cat doc doc.end > doc
causes the original data in doc to be lost. The file doc is opened for write by the shell,
and therefore truncated to zero length, before cat is executed.

66 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. cat

See also:
cp, head, tail

June 22, 2010 Utilities 67


CC, cc © 2010, QNX Software Systems GmbH & Co. KG.
C++, C compilers

Syntax:
cc [options] [operands]

CC [options] [operands]

Runs on:
QNX Neutrino, Linux, Microsoft Windows

Options:
For a complete list, see qcc.

Description:
The cc utility is used to compile code; CC is for compiling C++ code. Under QNX
Neutrino, they’re both links to qcc.

Under QNX 4, CC and cc are links to an older compiler that you can’t use to compile
code for QNX Neutrino.

Contributing author:
GNU

See also:
qcc

68 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. chat
Automated conversational script with a modem (QNX Neutrino)

Syntax:
chat [options] script

Runs on:
Neutrino

Options:
-e Turn on echoing. Echoing may be turned on or off at specific
points in the chat script by using the ECHO keyword. When
echoing is enabled, all output from the modem is echoed to
stderr.

-f chatfile Read the chat script from chatfile. If you use this option, don’t
also specify a script argument. You must have read access to
chatfile. Multiple lines are permitted in the file. Use spaces or
horizontal tab characters to separate the strings.

-r report file Set the file for output of the report strings. If you use the
keyword REPORT, the resulting strings are written to this file. If
this option isn’t used and you still use REPORT keywords, the
stderr stream is used for the report strings.

-s Send all log messages from the -v options and all error
messages to stderr.

-S Don’t use the system log for log messages from the -v options
or error messages.

-T phone_number Pass an arbitrary string, usually a phone number, that’s


substituted for the \T substitution meta character in a send
string.

-t timeout Set the timeout for the expected string to be received. If the
string isn’t received within the time limit, the reply string isn’t
sent. An alternate reply may be sent; the script fails if there’s
no alternate reply string. A failed script causes chat to
terminate with a nonzero error code.

-U phone_number_2 Pass a second string, usually a phone number, that’s substituted


for the \U substitution meta character in a send string. This is
useful when dialing an ISDN terminal adapter that requires two
numbers.

-V Verbose mode, but send all output to stderr; chat logs all text
received from the modem and the output strings that it sends.
This device is usually the local console at the station running
chat or pppd.

June 22, 2010 Utilities 69


chat © 2010, QNX Software Systems GmbH & Co. KG.

-v Verbose mode; chat logs all text received from the modem
and the output strings that it sends. In order to capture the log
messages, you need to have syslogd running.
script If the script isn’t specified in a file with the -f option, the
script is included as parameters to the chat program.

Description:
The chat program defines a conversational exchange between the computer and the
modem. Its primary purpose is to establish the connection between the Point-to-Point
Protocol Daemon (pppd) and the remote’s pppd process.
You should consider the modem functions (modem_open(), modem_read(),
modem_script(), and modem_write(), described in the Library Reference) or the
Photon Dialer as an alternative to chat.

Chat script
The chat script defines the communications.
A script consists of one or more “expect–send” pairs of strings, separated by spaces,
with an optional “subexpect–subsend” string pair, separated by a dash as in the
following example:
ogin:-BREAK-ogin: ppp ssword: hello2u2
This line indicates that the chat program should expect the string ogin:. If it fails to
receive a login prompt within the time interval allotted, it’s to send a break sequence to
the remote and then expect the string ogin:. If the first ogin: is received, the break
sequence isn’t generated.
Once it receives the login prompt, chat sends the string ppp and then expects the
prompt ssword:. When it receives the prompt for the password, it sends the password
hello2u2.

CAUTION: This could be a security issue as only plain-text passwords may be


! passed.

A carriage return is normally sent following the reply string. It isn’t expected in the
“expect” string unless it’s specifically requested by using the \r character sequence.
The expect sequence should contain only what is needed to identify the string. Since
it’s normally stored on a disk file, it shouldn’t contain variable information. It’s
generally not acceptable to look for time strings, network identification strings, or
other variable pieces of data as an expect string.
To help correct for characters that may be corrupted during the initial sequence, look
for the string ogin: rather than login:. The leading l character might be received in
error and you may never find the string even though it was sent by the system. For this
reason, scripts look for ogin: rather than login: and ssword: rather than
password:.

70 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. chat

A very simple script might look like this:

ogin: ppp ssword: hello2u2


In other words, expect ...ogin:, send ppp, expect ...ssword:, send hello2u2.
In actual practice, simple scripts are rare. At the very least, you should include
sub-expect sequences in case the original string isn’t received. For example, consider
the following script:

ogin:--ogin: ppp ssword: hello2u2


This is a better script than the simple one used earlier. It looks for the same login:
prompt, however, if one isn’t received, a single return sequence is sent and then it
looks for login: again. Should line noise obscure the first login prompt, sending the
empty line usually generates a login prompt again.

Abort strings
Many modems report the status of the call as a string. These strings may be
CONNECTED, NO CARRIER or BUSY. It’s often desirable to terminate the script should
the modem fail to connect to the remote. The difficulty is that a script doesn’t know
exactly which modem string it may receive. On one attempt, it may receive BUSY,
while the next time it may receive NO CARRIER.
These “abort” strings may be specified in the script using the ABORT sequence. It’s
written in the script as in the following example:

ABORT BUSY ABORT ’NO CARRIER’ ’’ ATZ OK ATDT5551212


CONNECT
This sequence expects nothing and then sends the string ATZ. The expected response
to this is the string OK. When it receives OK, chat sends the string ATDT5551212 to
dial the telephone. The expected string is CONNECT. If the string CONNECT is received,
the remainder of the script is executed. However, should the modem find a busy
telephone, it sends the string BUSY. This causes the string to match the abort character
sequence. The script then fails because it found a match to the abort string. If it
received the string NO CARRIER, it aborts for the same reason. Either string may be
received. Either string terminates the chat script.

Report strings
A “report” string is similar to the ABORT string. The difference is that the strings, and
all characters to the next control character such as a carriage return, are written to the
report file.
The report strings may be used to isolate the transmission rate of the modem’s connect
string and return the value to the chat user. The analysis of the report string logic
occurs in conjunction with the other string processing such as looking for the expect
string. The use of the same string for a report and abort sequence is probably not very
useful, however, it is possible.
The report strings don’t change the completion code of the program.

June 22, 2010 Utilities 71


chat © 2010, QNX Software Systems GmbH & Co. KG.

These report strings may be specified in the script using the REPORT sequence. It’s
written in the script as in the following example:

REPORT CONNECT ABORT BUSY ’’ ATDT5551212 CONNECT ’’


ogin: account

This sequence expects nothing and then sends the string ATDT5551212 to dial the
telephone. The expected string is CONNECT. If the string CONNECT is received, the
remainder of the script is executed. In addition the program writes to the expect-file
the string CONNECT plus any characters that follow it, such as the connection rate.

Timeout
The initial timeout value is 45 seconds; you can change it by using the -t option.
To change the timeout value for the next expect string, specify the TIMEOUT string.
For exmple:

ATZ OK ATDT5551212 CONNECT TIMEOUT 10 ogin:--ogin:


TIMEOUT 5 ssword: hello2u2

This changes the timeout to 10 seconds when it expects the login: prompt. The
timeout is then changed to 5 seconds when it looks for the password: prompt.
The timeout, once changed, remains in effect until it’s changed again.

Sending EOT
The special reply string of EOT indicates that the chat program should send an EOT
character to the remote. This is normally the end-of-file character sequence. A return
character isn’t sent following the EOT. The EOT sequence may be embedded into the
send string using the sequence ˆD.

Generating break
The special reply string of BREAK causes a break condition to be sent. The break is a
special signal on the transmitter. The normal processing on the receiver is to change
the transmission rate. It may be used to cycle through the available transmission rates
on the remote until you’re able to receive a valid login: prompt. The break sequence
may be embedded into the send string using the \K sequence.

Escape sequences
The expect and reply strings may contain escape sequences. All of the sequences are
legal in the reply string. Many are legal in the expect. The Expect? column in the table
below indicates whether or not the sequence is valid in an expect string.

72 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. chat

Sequence Expect? Description


’’ Yes Expects or sends a null string. If you send a null string, it
still sends the return character. This sequence may either
be a pair of apostrophe or quote characters.
\b Yes Represents a backspace character.
\c No Suppresses the newline at the end of the reply string. This
is the only method to send a string without a trailing
return character. It must be at the end of the send string.
For example, the sequence hello\c sends the characters
h, e, l, l, o.
\d No Delay for one second. The program uses sleep(1),
which delays for a maximum of one second.
\K No Insert a BREAK.
\n Yes Send a newline or linefeed character.
\N No Send a null character. The same sequence may be
represented by \0.
\p No Pause for a fraction of a second. The delay is 1/10th of a
second.
\q No Suppress writing the string to the SYSLOG file. The
string ?????? is written to the log in its place.
\r Yes Send or expect a carriage return.
\s Yes Represents a space character in the string. This may be
used when it isn’t desirable to quote the strings that
contains spaces. The sequence ’HI TIM’ and HI\sTIM
are the same.
\t Yes Send or expect a tab character.
\\ Yes Send or expect a backslash character.
\ddd Yes Collapse the octal digits ddd into a single ASCII character
and send that character. (Some characters aren’t valid in
expect sequences.)
ˆC Yes Substitute the sequence with the control character
represented by C. For example, the character DC1 (17) is
shown as ˆQ. (Some characters aren’t valid in expect
sequences.)

Exit status:
0 The normal termination of the program. This indicates that the script was
executed without error to the normal conclusion.

June 22, 2010 Utilities 73


chat © 2010, QNX Software Systems GmbH & Co. KG.

1 One or more of the parameters are invalid or an expect string was too large for
the internal buffers. This indicates that the program wasn’t properly executed.

2 An error occurred during the execution of the program. A read or write


operation might have failed for some reason or chat might have received a
signal such as SIGINT.

3 A timeout event occurred when there was an expect string without having a
“-subsend” string. This may mean that you didn’t program the script correctly
for the condition or that some unexpected event has occurred and the expected
string couldn’t be found.

4 The first string marked as an ABORT condition occurred.

5 The second string marked as an ABORT condition occurred.

6 The third string marked as an ABORT condition occurred.

7 The fourth string marked as an ABORT condition occurred.

... The other termination codes are also strings marked as an ABORT condition.

Using the termination code, it’s possible to determine which event terminated the
script. It’s possible to decide if the string BUSY was received from the modem as
opposed to NO DIALTONE. While the first event may be retried, the second probably
has little chance of succeeding during a retry.

See also:
syslogd
modem_open(), modem_read(), modem_script(), modem_write() in the Library
Reference

74 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. chattr
Manipulate the attributes of a file (QNX Neutrino)

Syntax:
chattr [+/- attribute]... [filename]...

Runs on:
Neutrino

Options:
attribute The attribute you want to remove (-) or set (+).

filename The name of a file whose attributes you want to display or manipulate.

Description:
The chattr utility is a front end to the devctl(DCMD_FSYS_FILE_FLAGS)
command (from <sys/dcmd_blk.h>), which gets and sets file attributes (that are
outside the scope of the POSIX standard). For example, the DOS/FAT filesystem has
the concept of “hidden” or “system” files. Such attributes are typically stored as flags
in the on-disk inode of each file.
These attributes are divided into the following classes:

Generic An attribute that corresponds to a concept that may be shared across


multiple filesystem formats (even if implemented in a different manner
for each one).
Filesystem-specific
An attribute that has meaning only within a specific filesystem.

It’s the responsibility of each io-blk.so filesystem module to map generic attributes
to and from their private representation.
For example, a hidden file is a generic concept of a filename that may be hidden from
normal user browsing (not displayed by ls) but remains available (to open() by an
application) if its name is already known. The representation of this concept varies
between filesystems:

• For DOS/FAT, it directly corresponds to the “hidden” bit.

• For ISO-9660, it’s the “existence” bit.

• The QNX 4 filesystem has no such thing.

This mapping functionality allows for application abstraction away from a particular
on-disk structure (a program can work unchanged against any file on any filesystem).
Many filesystem-specific attributes have no corresponding generic concept, and must

June 22, 2010 Utilities 75


chattr © 2010, QNX Software Systems GmbH & Co. KG.

be manipulated with knowledge of the underlying filesystem structure; the various


<sys/fs_*.h> header files contain relevant bit definitions.
When you invoke chattr with no attributes and a filename (or a list of filenames), it
displays the currently set attributes of each file. When you invoke chattr with an
attribute (or list of attributes), it applies those modifications to each file.

Examples:
List the attributes for a file:

# chattr chattr.c
chattr.c: +backup +contiguous +used +modified

Add to and remove from the attributes for a file:

# chattr -archive +system /fs/dos/autoexec.bat


/fs/dos/autoexec.bat: -archive +system

Turn off snapshots for a Power-Safe (fs-qnx6.so) filesystem:

# chattr -snapshot /fs/qnx6


/fs/qnx6: -snapshot

See also:
devb-*, fs-*, fsysinfo, io-blk.so

76 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. chgrp
Change file group ownership (POSIX)

Syntax:
chgrp [-R] [-v] group file...

Runs on:
Neutrino

Options:
-R Recursively change group ownership of files. For each file that names a
directory, chgrp changes the group of the directory and of all files in the
file hierarchy below it.

-v Be verbose; display to stdout all the operations being performed.

group A group name from the group database, or a numeric group ID.

file The pathname of a file whose group ID is to be modified.

Description:
The chgrp utility lets you change the group ownership of one or more files. For each
file you name, chgrp sets the file’s group ID to that specified by the group argument.
If you invoke chgrp with the -R option, and chgrp attempts but fails to change the
group ID of a particular file in a specified file hierarchy, it continues to process the
remaining files in the hierarchy.

You must be root or the owner of the file in order to change its group ownership. The
underlying filesystem might impose further restrictions. For example, the QNX 4
filesystem sets the _PC_CHOWN_RESTRICTED configuration variable; for more
information, see pathconf() in the Neutrino Library Reference.

Examples:
Change the group of myfile to 27:

chgrp 27 myfile
Change the group of myfile to technical:

chgrp technical myfile

Files:
/etc/group This file defines the known group IDs for the system. It associates
group names with a numerical ID and a list of users who are
members of the group.
Entries in this file appear in the following format:

June 22, 2010 Utilities 77


chgrp © 2010, QNX Software Systems GmbH & Co. KG.

groupname:unused:groupid:user[,user]...

Exit status:
0 The utility executed successfully and all requested changes were made.

>0 An error occurred.

See also:
chmod, chown, find ... -chgrp
Working with Files in the Neutrino User’s Guide

78 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. chkdosfs
Check a DOS (FAT-12/16/32) filesystem for consistency (QNX Neutrino)

Syntax:
chkdosfs [-npuy] device | mountpoint | file

Runs on:
Neutrino

Options:
-n Answer “no” to all repair questions and prompts.

-p Check and fix the filesystem non-interactively (i.e. “preen” mode).

-u Perform unconditional check of the filesystem (regardless of the


on-disk/dirty status).

-y Answer “yes” to all repair questions and prompts.

device The device name hosting the DOS filesystem (e.g. /dev/hd0t6).

mountpoint The mountpoint of the DOS filesystem (e.g. /fs/hd0-dos).

file A regular file containing a DOS filesystem image.

Description:
The chkdosfs utility performs a consistency check on the specified DOS filesystem.
This check consists of multiple passes over the filesystem.
If an error occurs, the action taken depends on the command-line options used. If -p
was specified (typically to auto-check the filesystem at startup), no message is
displayed and the default repair action is silently made. If either -n or -y was
specified, a descriptive message is displayed and a “no” or “yes” response to the
suggested action is automatically generated. Otherwise the user interactively decides
on the repair action to make (the suggested default is indicated).
In order to perform repairs, chkdosfs requires write access to the device hosting the
DOS filesystem. Normally, only root has permission for write access; if chkdosfs
does not have such access, it will still check the filesystem but will operate as if the -n
option had been specified.
By default, the chkdosfs utility checks an on-disk flag that’s maintained by the
filesystem that indicates to chkdosfs whether or not anything needs to be checked.
This flag is usually updated when mounting or unmounting the filesystem. The -u
option can be used to force the chkdosfs to run regardless of the state of this flag.

June 22, 2010 Utilities 79


chkdosfs © 2010, QNX Software Systems GmbH & Co. KG.

Summary of filesystem commands


The following table shows the shared objects and related commands for the
filesystems:

Partition type Filesystem Shared object Initialize with: Check with:


1, 4, or 6 DOS fs-dos.so mkdosfs chkdosfs
7 Windows NTa fs-nt.so N/A N/A
11, 12, or 14 FAT32 fs-dos.so mkdosfs chkdosfs
77, 78, or 79 QNX 4 fs-qnx4.so dinit chkfsys
131 Linux (Ext2) fs-ext2.so N/A N/A
175 Apple Macintosh HFS or HFS Plusa fs-mac.so N/A N/A
177, 178, or 179 Power-Safe fs-qnx6.so mkqnx6fs chkqnx6fsb

a Read-only.
b Not usually necessary.
For more information, see the Filesystems chapter of the System Architecture guide.

Examples:
Check the filesystem on the DOS partition of a hard disk:

# chkdosfs /dev/hd0t11

Phase 1 - Read and compare FATs


Phase 2 - Check cluster chains
Phase 3 - Check directories
Phase 4 - Check for lost files

1476784 kb used, 1010088 kb free, 24932 files, 2921 directories


Filesystem is clean.

Exit status:
0 The filesystem was checked and either no errors were detected or all such errors
were repaired.

1 The filesystem was not checked. This may be because the user interrupted the
operation, a non-recoverable internal error such as insufficient memory
occurred, or chkdosfs found an unrepairable error.

80 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. chkdosfs

Contributing author:
Wolfgang Solfrank, Martin Husemann

See also:
chkfsys, chkqnx6fs, devb-eide, fs-dos.so, mkdosfs, mount, umount

June 22, 2010 Utilities 81


chkfsys © 2010, QNX Software Systems GmbH & Co. KG.
Check an entire QNX 4 filesystem for consistency (QNX)

You must be root to run this utility.

Syntax:
When running on QNX 4:
chkfsys [-fpPqrsuvV] [-z zapfile] drive
When running on QNX Neutrino:
chkfsys [-fpPqrsuvVx] [-z zapfile] mountpoint
Or:
chkfsys [-fpPqrsuvVx] [-z zapfile] -m drive

Runs on:
Neutrino

Options:
-f Don’t fix anything.
-m (QNX Neutrino only) No mountpoint; the path specified is a raw
device/partition.
-p Prompt before starting.
-P Suppress prompting (i.e. fix without asking any questions).
-q Be quiet.
-r Rebuild the bitmap without prompts or messages.
-s Suppress the display of statistics.
-u Check the filesystem, regardless of the status recorded on the disk.
-v Be verbose. (Shows files in addition to directories as they’re being
checked. Slows chkfsys considerably.)
-V Very verbose display.
-x (QNX Neutrino only) Exit with detailed error codes; see below.
-z zapfile Record pathnames of files that need to be zapped in the specified file.
The zapfile must reside on a different filesystem from the one being
checked.
drive The disk to check (e.g. /dev/fd0, /dev/hd0t77).
mountpoint (QNX Neutrino only) The filesystem mountpoint of the drive (e.g. /).

82 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. chkfsys

Description:
The chkfsys utility performs a consistency check of a QNX 4 filesystem on the
requested drive. The chkfsys utility doesn’t operate on disk partitions containing
non-QNX filesystems (e.g. DOS partitions, QNX 2 partitions). In addition, chkfsys
must have access to the block special file that the filesystem is contained in. For this
reason, chkfsys can’t be used on NFS-mounted QNX filesystems.

The chkfsys utility claims that a Power-Safe (fs-qnx6.so) filesystem is corrupt;


use chkqnx6fs instead.

For QNX filesystems, chkfsys recursively walks the filesystem, checking every file
on the disk. During the walk, checks are made on the directory entry of each file and
the extents that make up the file. A bitmap is constructed in memory that’s consistent
with the block allocation of all files and directories on the disk. This bitmap is then
compared to the existing one on the disk. If they differ, the user is given the option of
replacing the existing bitmap on disk with the one constructed in memory.
By default, chkfsys checks an on-disk flag that’s maintained by the filesystem that
indicates to chkfsys whether or not anything needs to be checked. If the flag is set,
chkfsys reports that everything is fine and exits immediately. When you do an
orderly shutdown of the system, this flag is always set (unless an error had occurred in
the process). If you shut down the system by powering down, the flag may or may not
be set, depending on the state of the filesystem at the time. You can use the -u option
to force chkfsys to run even if the flag is set.

CAUTION: You should use chkfsys only when the filesystem is stable. There
! should be NO files open for writing when chkfsys is running. If you make any
repairs, remount the filesystem by slaying and restarting the disk driver.

If you aren’t doing any fixes (with the -f option), you may check a filesystem with
open files, but beware: you may get inconsistent reports in this case.
The chkfsys utility is normally used to recover blocks that were lost through the use
of the zap utility. When zap has been used, chkfsys reports that there are blocks
used in the bitmap that are in fact not used by any file. These blocks may be recovered
by writing the reconstructed bitmap back to disk. The chkfsys utility attempts to
read each of these blocks, but doesn’t mark bad blocks as available. Any blocks found
this way are added to the /.bad_blks file at the root of the filesystem being checked.
The chkfsys utility tells you if any files are using blocks that are now known to be
bad.
If chkfsys reports that a block is used by more than one file, this could indicate one
of two problems:

• If bad blocks exist, then this means that the file uses a block that’s bad and marked
as used in the bitmap.

June 22, 2010 Utilities 83


chkfsys © 2010, QNX Software Systems GmbH & Co. KG.

• If there are no known bad blocks, then a multiple allocation of a single block has
occurred.

In either case, the file should be saved on another disk (if possible), and the original
file should be destroyed with the zap utility. The chkfsys utility should then be run
again to update the bitmap, after which the saved file may be restored onto this disk.
In general, whenever the bitmap is replaced, chkfsys should be run a second time to
ensure that the filesystem is indeed consistent. To do so you must specify the -u
option.
The -f (no fix) option prevents chkfsys from attempting to make any fixes to the
filesystem. The disk isn’t opened for write, but only for read. This option lets a user
examine the filesystem without requiring other users to stop using the disk or
filesystem. Beware, however, that the -f option may report errors that don’t really
exist (if other users are opening, closing, or growing files during the time that
chkfsys is running). Even so, this can be a valuable option for sites that are up and
running 24 hours a day, when the system operator carefully evaluates the results. If
you see errors that you believe result from current activity, run chkfsys again with
the -f option to verify the errors. If you have located errors that require fixing, you
should idle the filesystem and run chkfsys without the -f option.
The -p (pause) option is used primarily with floppy disks. You can start chkfsys
from a floppy diskette, wait for chkfsys to pause, remove the current disk (which
contains the chkfsys command), and then insert another disk you wish to check.
The -q (quiet) option suppresses the display of each filename as that file is checked.
This speeds up the checking significantly, without loss of information, because
chkfsys shows you the name of any files that have errors.
The -r (rebuild) option suppresses the warning message that normally appears at the
end of a chkfsys run when the existing bitmap differs from the newly constructed
bitmap in memory. When -r is specified, chkfsys automatically rebuilds the bitmap.
Note that this option isn’t effective with the -f (no fix) option.
The -s (no stats) option prevents the display of the statistics message that normally
appears at the end of a chkfsys run.
The -v (verbose) option displays information on the checking.
The -P (no prompt) option causes chkfsys to automatically fix problems
encountered without prompting the user before each fix. However, there are some
serious errors (disk IO error or corruption of a high level directory) for which the fix
may be to remove a directory (and all its hierarchy/contents). This may not be a
prudent action to undertake without user confirmation. In such a situation -P will print
an error message and exit. If you wish chkfsys to continue unattended in all
circumstances, you can specify this as “-PP”.
The -z zapfile option is used to record, in the named file, the names of files that should
be zapped after chkfsys is finished. The zapfile must be on a different filesystem
from the one being checked. When a file is found to use an area of the disk allocated

84 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. chkfsys

to another file, or when a file uses an area of the disk marked as bad in the bitmap, the
files must be zapped and chkfsys run again.
After a power failure
The chkfsys utility may also be run after a system crash or power failure, which may
have left some files busy. The utility makes the files “unbusy” and also makes checks
to ensure that no damage to the filesystem has occurred. QNX is designed to be
immune to this type of damage.
In the event of the loss of a filesystem due to the corruption of the root directory and
the bitmap (first few blocks of the disk), you should refer to the QNX Neutrino System
Architecture, and the dinit utility documentation for methods of initializing just
those portions of your disk. If only the root block and bitmap are damaged, chkfsys
is able to recover the files in most cases. If the root directory or inode file is damaged
(the next areas on the disk), recovery may be possible with the dinit, spatch, and
chkfsys utilities. Note that such repair requires intimate knowledge of the filesystem
structure. Many users would just recover lost files from a backup at this point. You
shouldn’t expect to run into such problems; these are very rare events that we’ve tried
to anticipate.

Summary of filesystem commands


The following table shows the shared objects and related commands for the
filesystems:

Partition type Filesystem Shared object Initialize with: Check with:


1, 4, or 6 DOS fs-dos.so mkdosfs chkdosfs
7 Windows NTa fs-nt.so N/A N/A
11, 12, or 14 FAT32 fs-dos.so mkdosfs chkdosfs
77, 78, or 79 QNX 4 fs-qnx4.so dinit chkfsys
131 Linux (Ext2) fs-ext2.so N/A N/A
175 Apple Macintosh HFS or HFS Plusa fs-mac.so N/A N/A
177, 178, or 179 Power-Safe fs-qnx6.so mkqnx6fs chkqnx6fsb

a Read-only.
b Not usually necessary.
For more information, see the Filesystems chapter of the System Architecture guide.

Examples:
Check the filesystem on the QNX partition of a hard disk:
chkfsys /hd

June 22, 2010 Utilities 85


chkfsys © 2010, QNX Software Systems GmbH & Co. KG.

Check the QNX filesystem mounted as the root (/) and automatically rebuild the
bitmap:

chkfsys -rs /

Exit status:
The exit status depends on whether or not you specified the -x option:

• If you didn’t specify the -x option, the exit status is as follows:

0 The filesystem(s) have been checked.

CAUTION: An exit status of zero doesn’t indicate that no problems were found with
! the filesystem(s). It merely indicates that no irrecoverable errors internal to the
chkfsys utility were encountered.
>0 The filesystem(s) may not have been checked. The chkfsys operation may
have been interrupted at the request of the user or an internal error (such as
running out of memory) may have occurred.

• If you specified the -x option, the lower bit of the error code indicates whether or
not anything was fixed, while the upper four bits identify the cause of failure if
nonzero:

0x00 The filesystem was clean; there was nothing to do.


0x01 The disk data has been fixed.
0x10 Insufficient memory.
0x20 General program failure.
0x30 The filesystem query or request failed.
0x40 Failed to read from the device.
0x50 Failed to write to the device.
0x60 Filesystem corruption was detected but not fixed.

See also:
chkdosfs, chkqnx6fs, dcheck, dinit, fs-qnx4.so, spatch, zap
Backing Up and Recovering Data in the Neutrino User’s Guide

86 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. chkqnx6fs
Check an entire Power-Safe filesystem for consistency (QNX Neutrino)

You must be logged in as root to run this utility.

Syntax:
chkqnx6fs [-sv] host

Runs on:
Neutrino

Options:
-s Display header information from the superblock. The number of -v options
controls which fields chkqnx6fs displays.

If you specify -s, chkqnx6fs locates and verifies the active superblock, but doesn’t
check the filesystem itself.

-v Increase output verbosity. You can specify multiple -v options.

host The host of the filesystem. You can specify this as a block-special device or
partition (e.g. /dev/hd0t76), as a regular file, or as the root directory of a
mounted fs-qnx6 filesystem (which will be resolved to the real host device).

Description:
The chkqnx6fs performs a consistency check on a Power-Safe (fs-qnx6)
filesystem. The check is conducted in these passes:

1 Locate and verify superblocks and select the newest stable one.

2 Traverse the system inodes and bitmap files.

3 Recursively walk the directory hierarchy from the root.

Only a stable filesystem can be checked (i.e. one that isn’t going to change or be
updated during the scan). A stable filesystem is one of the following:

• unmounted

• mounted read-only

• mounted read-write with snapshots disabled (in which case the stable filesystem,
not the working copy, is checked)

June 22, 2010 Utilities 87


chkqnx6fs © 2010, QNX Software Systems GmbH & Co. KG.

You shouldn’t actually need to use chkqnx6fs in a production system (e.g. in a boot
script). The design of the fs-qnx6 filesystem should (in the absence of software bugs,
physical bad blocks, or malicious data modification on the raw device) make any such
check unnecessary.

Summary of filesystem commands


The following table shows the shared objects and related commands for the
filesystems:

Partition type Filesystem Shared object Initialize with: Check with:


1, 4, or 6 DOS fs-dos.so mkdosfs chkdosfs
7 Windows NTa fs-nt.so N/A N/A
11, 12, or 14 FAT32 fs-dos.so mkdosfs chkdosfs
77, 78, or 79 QNX 4 fs-qnx4.so dinit chkfsys
131 Linux (Ext2) fs-ext2.so N/A N/A
175 Apple Macintosh HFS or HFS Plusa fs-mac.so N/A N/A
177, 178, or 179 Power-Safe fs-qnx6.so mkqnx6fs chkqnx6fsb

a Read-only.
b Not usually necessary.
For more information, see the Filesystems chapter of the System Architecture guide.

Examples:
# chkqnx6fs -v /dev/hd0t76
** Prelude: read and verify superblocks **
** Pass 1 : verify bitmap and inodes **
** Pass 2 : verify directory hierarchy **
** Summary: 20216/8040524 blocks, 142/62816 inodes **

Exit status:
0 The filesystem is consistent/stable.

1 An error occurred checking the filesystem (descriptive messages are written to


stderr).

88 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. chkqnx6fs

See also:
chkdosfs, chkfsys, fs-qnx6.so, mkqnx6fs
Backing Up and Recovering Data in the Neutrino User’s Guide
“Power-Safe filesystem” in the Filesystems chapter of the System Architecture guide
“Power-Safe filesystem” in the Filesystems chapter of the Neutrino User’s Guide

June 22, 2010 Utilities 89


chmod © 2010, QNX Software Systems GmbH & Co. KG.
Change file modes (POSIX)

Syntax:
chmod [-Rv] mode file...

Runs on:
QNX Neutrino, Linux, Microsoft Windows

Options:
-R Recursively change file modes. For each file that names a directory, chmod
changes the file mode bits of the directory and all files in the file hierarchy
below it.

-v Be verbose; display the operations that are being performed.

mode Represents the change to be made to the file mode of each file named (see
the Description below).

file The pathname of a file whose file mode bits are to be modified.

Description:
The chmod utility lets you change any or all of the file permission mode bits of one or
more files. For each file that you name, chmod changes the file permission mode bits
according to the mode operand.
To change a file’s permission mode bits, the user of chmod must be either the owner of
the file or the superuser, root.
The mode option can be either a symbolic_mode expression or a nonnegative octal
integer.

Symbolic Modes
The symbolic_mode has the following form:

[who]operator[copy|permissions][,symbolic_mode]

The who part of the symbolic mode is any combination of:

a User, group, and other access

g Group access

o Other access

u User access

The operator is one of:

90 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. chmod

+ Add specified permissions to the group, other, or user category of the specified
files.

- Remove specified permissions from the group, other, or user category of the
specified files.

= Set the specified permissions for the group, other, or user category of the
specified files.

The copy part specifies the unmodified permissions (i.e. before the chmod command
has been executed) of one of:

g Group

o Other

u User

The permissions part is any combination of:

r Read permission

s When executed, set the user ID (if who contains or implies u) and/or group ID
(if who contains or implies g)

t Sticky bit

w Write permission

X Execute/search permission if the file is a directory or at least one execute bit is


on before any of the file mode bits are modified

x Execute permission

The who specification is optional. When it isn’t supplied, all the permissions (user,
group and other) are affected, but for + and = operators, only those permissions that
aren’t set in the file creation mask (see umask) are set.
The permissions part is also optional. If omitted, it defaults to none (i.e. the command
adds no permissions, removes no permissions, or sets the permissions to none,
depending on the operator).

Some examples of symbolic modes:

Make myfile executable by all:

chmod a+x myfile


Remove read permission for group and others:

chmod og-r myfile

June 22, 2010 Utilities 91


chmod © 2010, QNX Software Systems GmbH & Co. KG.

Perform both the above operations, in the order given, on three files: myfile, file2,
and zzz:

chmod a+x,og-r myfile file2 zzz

Add read permission to the user, remove write permission from the user, and set the
group permissions to be the same as the other permissions:

chmod u+r,u-w,g=o myfile

Octal Modes
In octal mode, permissions are specified with a three-digit octal number. The three
digits represent user, group, and other permissions in that order.
Each permission may be specified with an octal number: read = 4; write = 2; execute
= 1; no permission = 0. The octal equivalents are derived by adding the numbers
associated with the four basic permissions. The following table illustrates their use:

Octal number Symbolic Permission


0 --- None
1 --x Execute
2 -w- Write
3 -wx Write/execute
4 r-- Read
5 r-x Read/execute
6 rw- Read/write
7 rwx Read/write/execute

For example, give the user read/write/execute (octal 7 = rwx), group read/execute
(octal 5 = r-x), and other read only (octal 4 = r--) for the file myfile:

chmod 754 myfile

Setgid and setuid


The following table shows how the setgid and setuid file modes are represented in
octal:

92 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. chmod

Octal number File mode


1000 Sticky
2000 Setgid
4000 Setuid
6000 Setgid and setuid

You can combine these file modes with the permission modes described above. For
example:

chmod 4666 testfile

In this case, setuid is set, and the user, group, and other get read/write access.

Exit status:
0 The utility executed successfully and all requested changes were made.

>0 An error occurred.

Caveats:
If the mode operand isn’t valid, chmod doesn’t change the file mode bits of any file.

See also:
chgrp, chown, find ... -chmod ..., ls, umask
Working with Files in the Neutrino User’s Guide

June 22, 2010 Utilities 93


chown © 2010, QNX Software Systems GmbH & Co. KG.
Change the ownership of files and directories (POSIX)

Syntax:
chown [-Rv] owner[:group] file...

Deprecated:

chown [-Rv] owner[.group] file...

Runs on:
Neutrino

Options:
-R Recursively change ownership of files. For each file operand that names a
directory, chown changes the user ID of that directory and of all files in the
file hierarchy below it.

-v Verbose. Display to stdout the operations which are being performed.

owner A username from the user database, or a numeric userid. The chown utility
changes the owner of each file to the user ID of the specified owner.

group A group name from the user database, or a numeric groupid. The chown
utility changes the group of each file to the groupid of the specified group.

file The pathname of a file whose ownership is to be modified.

Description:
The chown utility sets each file’s owner and group to the user and group IDs specified
by the owner and group operands.

Examples:
Change the owner of file data to user 27:

chown 27 data

Change the owner of the file data to dtdodge:

chown dtdodge data

Change the owner of the file subfile to dtdodge and set the group of the file to
techies:

chown dtdodge:techies subfile

94 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. chown

Exit status:
0 The utility executed successfully and all requested changes were made.

>0 An error occurred.

Caveats:
If you invoke chown with the -R option, and chown attempts but fails to change the
owner or group of a particular file in a specified file hierarchy, it continues to process
the remaining files in the hierarchy. The chown utility can fail to change the user or
group of a file if you don’t have appropriate permissions.

In QNX Neutrino, the _PC_CHOWN_RESTRICTED flag is enforced, therefore you


must be root to use chown unless you are changing ownership to yourself. Normal
users can’t give a file away to another user by changing the file ownership.

For compatibility with some other implementations of chown, a deprecated syntax


allows a period (.) to be used instead of a colon (:) to separate user and group (e.g.
user:group and user.group are both allowed). However, be aware that if a userid
contains a period, it may be specified either alone or in conjunction with a group using
:, but may not be used in conjunction with a group using .. For instance, if there was
a userid my.name and a group tech, you could do a chown my.name myfile or
chown my.name:tech myfile, but not chown my.name.tech myfile.

See also:
chgrp, chmod, find ... -chown ...
Working with Files in the Neutrino User’s Guide

June 22, 2010 Utilities 95


cksum © 2010, QNX Software Systems GmbH & Co. KG.
Display file checksums and block counts (POSIX)

Syntax:
cksum [-o algorithm] [-q|-v] [file...]

Runs on:
QNX Neutrino, Linux, Microsoft Windows

Options:
-o algorithm Use the specified algorithm. Valid algorithm values include:

Algorithm Action
1 Use historic 16-bit checksum algorithm.
2 Use historic 32-bit checksum algorithm.
9 Use 1003.2 draft 9 algorithm (QNX versions 4.0 and 6)
11 Use 1003.2 draft 11 algorithm
12 Use 1003.2 draft 12 algorithm
92 Use 1003.2-1992 standard algorithm (DEFAULT)
4.1 Use old QNX cksum algorithm (QNX 4.10-4.21)

-q Quiet. Don’t display header (counteracts -v). (Default)

-v Verbose. Display a header which states the algorithm used and


names the output columns.

file The pathname of a file to be checked. If no files are specified, the


standard input is used.

Description:
The cksum utility writes one line to standard output for each file you specify. This line
contains the checksum of the file, as well as the file size and the name of the file being
checked. The format of this output varies slightly depending on the command line
options specified to cksum as follows:

-o algorithm: Filesize units Output format


1 Kilobytes %lu %lu %s

continued. . .

96 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. cksum

-o algorithm: Filesize units Output format


2 512-byte blocks %lu %lu %s
All others Bytes %10lu %10lu %s

If you don’t specify any files, cksum processes standard input; no filename is given in
the output line.
The cksum utility lets you quickly compare a suspect version of a file to a trusted
version of the same file. You can also use cksum to check files after they have been
transferred by modem, restored from backup media, or unpacked from a compressed
form. The utilities that perform these operations have their own checks, but cksum
serves as a useful independent checking mechanism.
If you wish to perform a byte-by-byte comparison of files, you can use the cmp utility.

Exit status:
0 All files were processed successfully.

>0 An error occurred.

See also:
cmp, diff

June 22, 2010 Utilities 97


clear © 2010, QNX Software Systems GmbH & Co. KG.
Clear the screen

Syntax:
clear

Runs on:
Neutrino

Options:
None.

Description:
This utility clears the text-mode screen or the current pterm window.

98 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. cmp
Compare two files (POSIX)

Syntax:
cmp [-l|-s] file1 file2

Runs on:
Neutrino

Options:
-l (“el”) Print the byte position (in decimal) and the differing bytes (octal) for
all differences (not just the first one) between the two files.
-s Be silent. Return the exit status only.
file1 The pathname of the first file to be compared. If file1 is the dash (-)
character, standard input is used.
file2 The pathname of the second file to be compared.

Description:
The cmp utility compares two files.

This utility is intended for comparing binary files, if you want to compare text files,
use diff.

If you don’t specify any options, cmp behaves as follows:

• If the two files are the same, cmp writes no output.


• If the files differ, cmp writes to standard output the byte and line number at which
the first difference occurred. Bytes and lines are numbered beginning at 1.

If you specify both the -s and -l options, nothing is printed (no long output).

Examples:
Compare the files myfile.dat and save.dat:
cmp myfile.dat save.dat

Exit status:
0 The files are identical.
1 The files differ. This includes cases where one file is identical to the first part
of the other. In such cases, if you haven’t specified the -s option, cmp writes to
standard error a message that EOF was reached in the shorter file (before any
differences were found).
>1 An error occurred.

June 22, 2010 Utilities 99


cmp © 2010, QNX Software Systems GmbH & Co. KG.

See also:
cksum, diff, patch, wc

100 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. /etc/context.conf
Context definitions for SNMPv2

Name:
/etc/context.conf

Description:
The context.conf file is used to define a collection of object resources that’s
accessible by a network entity. A context is made up of:

• information stored on the agent machine (views; see /etc/view.conf)

• information stored on another machine that doesn’t understand SNMP.

The agent acts as a proxy machine for the remote non-SNMP system.
Here’s the search order that’s used to find this file:

1 /nodecfg/node_name/etc/context.conf, where node_name is the value


of the CS_NODENAME configuration string (see getconf and setconf)

2 /etc/context.conf

The file is in this format:


contextname contextidentity
contextviewindex contextlocalentity contextlocaltime
contextdstpartyindex contextsrcpartyindex contextproxyxcontext

where:

contextName Unique alphanumeric friendly name.

contextIdentity Unique object identifier.

contextViewIndex Numeric value representing a view as defined in


/etc/view.conf.

contextLocalEntity String or NULL.

contextLocalTime CurrentTime or restartTime.

contextDstpartyIndex
Decimal value.
contextSrcpartyIndex
Decimal value.
contextProxyContext
Object identifier.

For example, the following defines a context (agent_context) that consists of view
index number 3 from the /etc/view.conf file:

June 22, 2010 Utilities 101


/etc/context.conf © 2010, QNX Software Systems GmbH & Co. KG.

agent_context .1.3.6.1.6.3.3.1.4.10.0.0.59.3
3 NULL CurrentTime
0 0 0

See also:
snmpget, snmpgetnext, snmptest, snmptrapd, snmpwalk
Based on ISO IS 8824 (ASN.1), RFC 1065, RFC 1066, RFC 1067, RFC 1446

102 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. coreinfo
Display information about a QNX Neutrino core file

Syntax:
coreinfo

Runs on:
Neutrino

Options:
None.

Description:
The coreinfo utility displays information about a QNX Neutrino core file. It lets you
examine a core dump directly, without using a debugger.

See also:
dumper

June 22, 2010 Utilities 103


cp © 2010, QNX Software Systems GmbH & Co. KG.
Copy files (POSIX)

Syntax:
cp [-f|-i] [-Rrp] [QNX Neutrino extensions]
source_file target_file

cp [-f|-i] [-Rrp] [QNX Neutrino extensions]


source_file... target_dir

Runs on:
QNX Neutrino, Linux, Microsoft Windows

Options:
-A (QNX Neutrino extension) Preserve source file access times.
-B (QNX Neutrino extension) Use a very small (2 KB) copy buffer.
-c (QNX Neutrino extension) Create any directories necessary to open
the destination path. For example, if the directory /home/eric
doesn’t exist, and you enter:
cp -c file /home/eric/source/file

cp performs the equivalent of:


mkdir -p /home/eric/source
cp file /home/eric/source/file

-D (QNX Neutrino extension) Descend past device boundaries when


using the -R option. This is the default behavior; if you want to
prevent cp -R from descending past device boundaries, use the -N
option.
-f (QNX Neutrino extension) Force the unlinking of the destination
file prior to copying. This option prevents interactive prompting
(unless you also specify -i) but doesn’t disable diagnostic
messages.
-i Run interactively; always prompt for confirmation when the
destination path exists, regardless of whether you have write
permission for the destination file. The -i option is useful when
you want to avoid accidentally clobbering files when copying.
When you don’t have write permission for the destination file and
you answer yes to the prompt, the destination file is unlinked first.
Otherwise, the destination is simply overwritten and truncated.
The combination of -i and -f works as if you specified only -i,
except that when you answer yes to the prompt, the destination is
always unlinked first — even if you have write permission for the
destination file. When you specify only -i, the destination is
unlinked only when you don’t have write permission for the
destination file.

104 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. cp

-l n (“el” — QNX Neutrino extension) If source_file is a directory, and


you specify the -R or -r option, copy only n levels of the directory
tree. If you specify -l 0, -R or -r is defeated; only files at the
current level (files named directly on the command line) are copied.

-L (QNX Neutrino extension) Attempt to preserve hard links. When


cp encounters a file that has a link count greater than 1, it
remembers that file’s device ID and serial number (inode). If
during the cp another file with a link count greater than 1 is found
matching the serial number and device ID, cp creates a link instead
of making a second copy of the file. When the destination media is
changed, cp wipes its memory of links encountered to that point.
(This is significant when making floppy backups, or backups to
removable hard disks.)

-M qnx|unix (QNX Neutrino extension) Do recursive copies in UNIX (the


default) or old-style QNX mode.
QNX has, in the past, copied the contents of the directories named
on the command line into the target directory. UNIX copies the
directory itself into the target directory (like mv). In either case, if
there’s only one directory being copied and the destination names a
directory that doesn’t exist, cp creates the destination directory and
then copies the contents of the source directory into the destination
directory.

The default mode under QNX Neutrino is different from that under QNX 4.

For more information, see “Recursive Copying,” below.

-N (QNX Neutrino extension) Don’t descend past device boundaries


when using the -R option. By default, cp -R descends past device
boundaries while traversing a directory tree; specifying -N prevents
this behavior. For example:

cp -R / /hd/backup

causes cp to back up the contents of the disk, including the


contents of the /dev directory.

In this particular example, only the disk devices (block special files) actually have
their data backed up to files in /hd/backup/dev because cp doesn’t copy character
special files on recursive copies.
The addition of -N, as follows:

cp -RN / /hd/backup

causes the contents of the disk to be backed up, but the /dev
directory is skipped, since it doesn’t exist on the hard disk device.

June 22, 2010 Utilities 105


cp © 2010, QNX Software Systems GmbH & Co. KG.

-n (QNX Neutrino extension) See the -u option.

-p After copying, attempt to duplicate the modification time and file


mode of each input file in the corresponding output file. Also
duplicate the ownership of each file if the process is run with the
privileges of the superuser (root). If the process doesn’t have the
appropriate privileges, the duplication fails.

-r Recursively copy directories. If a source file is a special file (e.g.


FIFO, named special file), cp doesn’t create a special file as the
destination. Read the section on recursive copying and see the -M
and -R options.

-R If the source_file is a directory, recursively copy the directory with


the files and subdirectories under it, attempting to preserve special
files. QNX Neutrino doesn’t allow block special files and character
special files to be created in this manner. Read the section on
recursive copying, and see the -M and -r options.

-s (QNX Neutrino extension) Run safely; copy only if the existing


destination file has write permission. If the file doesn’t have write
permission, skip the file without prompting.

-t (QNX Neutrino extension) Don’t attempt to duplicate file time and


mode if the -p option was specified or if the POSIX_STRICT
environment variable is set to on.

-u (QNX Neutrino extension) Copy only if the source is newer than


the destination (i.e the source has a more recent file-modified time),
or if the destination doesn’t already exist.

-V (QNX Neutrino extension) Be extra verbose. In addition to doing


everything -v does, this option displays a running progress counter
(% complete) and it also displays lines when cp skips a file or a
directory (i.e. you can see what cp isn’t doing as well as what it is
doing).
For example, if you select options -R and -n, you’ll find that cp
-VRn is more useful than cp -vRn, because the -v option in this
case might let cp go away and put you back at the prompt without
providing you with any feedback.

-v (QNX Neutrino extension) Be verbose. Display a line of


explanatory text every time a file is copied or a directory is created.

-X (QNX Neutrino extension) Copy only if the destination file doesn’t


exist.

-x (QNX Neutrino extension) Copy only if the destination file already


exists.

106 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. cp

source_file The pathname of a file to be copied. If you want source_file to


name a directory, you must also specify the -R option.

target_file The pathname to which a single file is copied.

target_dir The pathname of an existing directory that’s to contain the output


file(s).

Description:
There are two syntax forms for cp:

cp [-f|-i] [-Rrp] [QNX Neutrino extensions] source_file target_file


The cp utility copies the contents of the source file to the destination file named
by target_file. This first syntax form is assumed when the destination file isn’t
an existing directory and there’s only one source file.

cp [-f|-i] [-Rrp] [QNX Neutrino extensions] source_file... target_dir


For each source_file, cp copies the contents of the file to a destination file in the
existing directory named by target_dir. The destination’s filename under the
target directory is the same as its basename (final path component), unless it’s a
directory (see “Recursive Copying”). For example:

cp dir/dir/myfile /existingdir
copies the contents of dir/dir/myfile to the file /existingdir/myfile.
This second form is assumed when the destination file is an existing directory or
when you specify more than one source file.

General
Unless you specify the -R (recursive) option, cp refuses to copy any source_file that is
a directory.

For duplicating lists of files, see the pax -rw utility, which is another POSIX utility
for duplicating files. You can select sets of files that match complex criteria by using
find, and then pipe them to pax.

What cp does when a destination file already exists depends on the options used. If
you don’t specify -f or -i, cp prompts you only if you don’t have write permission
for the existing destination file. When this happens, you’re asked if you want to unlink
the file first. If you don’t, cp goes on to any remaining files. You’re prompted only if
stdin is a tty. Otherwise, cp prints a diagnostic message to stderr and skips that file.
If you’re copying to removable media, such as a floppy or removable disk, and the
media becomes full, cp closes and removes the incompletely copied destination file,
displays a message, then exits.

June 22, 2010 Utilities 107


cp © 2010, QNX Software Systems GmbH & Co. KG.

Recursive copying
When doing a recursive copy of a directory, the destination must be a directory. If
you’re copying more than one item, the directory must already exist. If you’re copying
a single directory, cp creates the destination directory (all intermediate directories
must already exist unless you specify the -c option).
There are two recursive copying modes available with cp:

• In the historical QNX 4 behavior, specified by the -Mqnx option, cp copies the files
and directories underneath the source directory to the destination directory. The
source directory itself isn’t duplicated within the destination directory.

• The default mode (-Munix) causes cp to duplicate the source directory within the
destination directory (unless a single directory is being copied and the destination
directory doesn’t yet exist, in which case -Munix and -Mqnx modes do the same
thing).

The default mode under QNX Neutrino is different from that under QNX 4.

In the default -Munix mode, cp -r /bin /mydir/bin duplicates /bin in


/mydir/bin, i.e. the destination is /mydir/bin/bin and, for example, the file
/bin/sh is copied to /mydir/bin/bin/sh. This is analogous to the way the mv
utility treats destinations.
In -Mqnx mode, cp -Mqnx -r /bin /mydir/bin copies the contents of /bin to
/mydir/bin (so, for example, /bin/sh is copied to /mydir/bin/sh).

Examples:
Copy file1, file2, and file3 from the current working directory to the
/home/eric directory:

cp file1 file2 file3 /home/eric


Perform a backup of the entire contents of the home directory to floppy disks
(assuming that /f0 is a mountpoint for /dev/fd0), in the (default) UNIX
recursive-copy mode:

cp -rvp /home /f0


Do the same in QNX recursive-copy mode:

cp -Mqnx -rvp /home /f0/home


Recursively copy the /home/eric directory to the /home/ejohnson directory,
assuming /home/ejohnson doesn’t yet exist (this works in either -Munix or -Mqnx
mode):

cp -rv /home/eric /home/ejohnson


Do the same in -Mqnx mode if the directory ejohnson already exists:

108 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. cp

cp -Mqnx -rv /home/eric /home/ejohnson


Do the same in -Munix mode if the directory ejohnson already exists:

cp -Munix -rv /home/eric/. /home/ejohnson


Recursively copy the contents of the current directory into /mydir/ in -Mqnx or
-Munix mode:

cp -Rpv . /mydir/
Do the same in -Munix mode only:

cp -Munix -Rpv * /mydir/

Using -Mqnx instead of -Munix in the previous example copies the contents of the
directories named on the command line into /mydir/ (i.e. the file ./bin/ls is
copied to /mydir/ls, and the directory ./usr/bin is /mydir/bin in the
destination).

Recursively copy the /home/eric directory to the /backups/eric directory:

cp -rv /home/eric /backups


Do the same in QNX-style recursive copy mode:

cp -Mqnx -rv /home/eric /backups/eric

Files:
Input files If you don’t specify the -r option, and you name only one source file,
that source file may be of any filetype.
If you specify the -r option, or there’s more than one source file, the
input files specified by each source_file operand, including those files
contained within named directories, must be either regular files, block
special files, or directories.
If you use the -R option, FIFOs are duplicated in the destination
directory structure, but contents of the source FIFOs aren’t copied. If
cp encounters any block special or character special files in the source
files, an error occurs, because cp can’t create them at the destination.

Output files Each newly created output file is one of the following:
• A directory that contains copies of the files and subdirectories — if
any — found in the input directory.
• A regular file that has the same contents as the corresponding input
file.
• A FIFO that was created because the corresponding input file was
a FIFO and you specified -R. The data from the original FIFO isn’t
copied into the new FIFO (i.e. the new FIFO is empty).

June 22, 2010 Utilities 109


cp © 2010, QNX Software Systems GmbH & Co. KG.

• A symbolic link that was created because the corresponding input


file was a symbolic link and you specified -R. The new symbolic
link references the same pathname as the original symbolic link.
If an existing destination names some other type of file, cp opens it
for writing and attempts to copy the contents of the corresponding
input file to it.

Environment variables:
POSIX_STRICT Affects whether file modification times are copied, and, if set
on, causes the QNX Neutrino extension options to be disabled.
The setting of the POSIX_STRICT environment variable
affects the -p and -t options, as follows:

POSIX_STRICT Option Action


Set Neither -p nor -t If the destination doesn’t exist, duplicate the mode only.
Set -p Duplicate the time and mode; if run by root, also duplicate the user ID
and group ID.
Set -pt If run by root, duplicate the user ID and group ID.
Set -t If destination doesn’t exist, duplicate the mode only.
Unset Neither -p nor -t Duplicate the time and mode.
Unset -p Duplicate the time and mode; if run by root, also duplicate the user ID
and group ID.
Unset -pt If run by root, duplicate the user ID and group ID.
Unset -t If destination doesn’t exist, duplicate the mode only.

Exit status:
0 All input files were copied successfully.

>0 An error occurred.

Caveats:
If cp is copying multiple files or doing a recursive copy, but you didn’t specify the -R
option, cp refuses to copy FIFO and character special files.
If you specify the -R option, and cp attempts but fails to copy a particular file in a
specified file hierarchy, it continues to process the remaining files in the hierarchy.

110 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. cp

See also:
mv, ln, pax

June 22, 2010 Utilities 111


cpio © 2010, QNX Software Systems GmbH & Co. KG.
Copy file archives in and out (UNIX)

Syntax:
Read/list an archive:

cpio -i[Bcdfmrtuv] [pattern...]

Write an archive:

cpio -o[Bacv]

Copy files:

cpio -p[adlmruv] directory

Runs on:
QNX Neutrino, Linux, Microsoft Windows

Options:
-a Reset access times of input files after they’ve been copied. When the -l
option is also specified, the access times of linked files aren’t reset. You
can use this option only with the -o or -i options.

-B Cause input/output to be blocked 5120 bytes to the record. You can use
this option only with the -o or -i options for data directed to or from
character special files.

-c Write header information in ASCII (Default; option present for


compatibility)

-d Create directories as needed. You can use this option only with the -i or
-p options.

-f Copy in all files except those in patterns. You can use this option only
with the -i option.

-i Copy in. (Extract files from an archive being read from standard input.)

-l (“el”) Whenever possible, link files rather than copy them. You can use
this option only with the -p option.

-m Retain previous modification times. This option won’t work on


directories that are being copied. You can use this option only with the
-i or -p options.

-o Copy out. (Write an archive to standard output.)

-p Pass. Conditionally copy files from a list read from standard input to the
destination directory named as an argument to cpio.

112 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. cpio

-r Interactively rename files. A new name for each file is requested from
the user. Read and write permissions for the controlling terminal
(/dev/tty) are required for this option. If you type a null line, the file
is skipped. You should use this option only with the -i or -o options.
-t Print a table of contents of the input. No files are created. You can use
this option only with the -i option.
-u Copy files unconditionally. Usually an older file doesn’t replace a new
file with the same name. You can use this option only with the -i or -p
options.
-v Be verbose. Print the names of the affected files. You can use this option
only with the -i option. It provides a detailed listing when used with the
-t option.

pattern Simple regular expression given in the name-generating notation of the


shell.
directory The destination directory.

Description:
The cpio utility produces and reads files in the format specified by the POSIX cpio
Archive/Interchange File Format. It operates in three modes.
The -i mode (copy in) extracts files from the standard input, which is assumed to be
the product of a previous cpio -o. Only files with names that match patterns are
selected. Multiple patterns may be specified. If no patterns are specified, the default
for patterns is to select all files. The extracted files are conditionally created and
copied into the current directory, and possibly any levels below, based on the options
used. The permissions of the files are those stored by the previous cpio -o
invocation. The owner and group of the files are that of the current user unless the user
has appropriate privileges, which causes cpio to retain the owner and group of the
files stored by the previous cpio -o invocation.
The -o mode writes the archive to the standard output.
The -p mode (pass) reads the standard input to obtain a list of pathnames of files that
are conditionally created and copied into the destination directory based upon the
options used.
If an error is detected, the cause is reported and the cpio utility continues to copy
other files. The utility skips over any unrecognized files encountered in the archive.
The following restrictions apply to the cpio utility:
• Pathnames are restricted to 256 characters.
• Appropriate privileges are required to copy special files.
• Blocks are reported in 512-byte quantities.
• Leading slashes (/) are stripped when files are extracted from an archive.

June 22, 2010 Utilities 113


cpio © 2010, QNX Software Systems GmbH & Co. KG.

Examples:
Copy out the files listed by the ls utility and redirect them to the file archive:

ls | cpio -o >archive

Use the output file archive from the cpio -o utility, extract those files that match
the patterns memo/al and memo/b*, create the directories below the current directory,
and place the files in the appropriate directories:

cpio -id "memo/al" "memo/b*" <archive

Take the filenames piped to cpio from the find utility and copy or link those files to
another directory named newdir, while retaining the modification time:

find . -depth -print | cpio -pdlmv newdir

Exit status:
0 All input files were copied.

2 The utility encountered errors in copying or accessing files or directories. An


error is reported for nonexistent files or directories or for permissions that don’t
allow the user to access the source or target files.

Caveats:
When cpio restores a directory, it matches the permissions of the directory created to
those of the original. If that directory lacks write permission, any attempt to copy
additional files under that directory fails. To get around this, save the files under a
directory first before the directory itself. If find is used to generate pathnames for
cpio, the -depth option should be supplied to find.
Note also that the controlling terminal (/dev/tty) is used to prompt the user for
information when the -i or -r options are specified.

See also:
cp, find, pax, tar
Backing Up and Recovering Data in the Neutrino User’s Guide

114 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. cron
Clock server (UNIX)

Syntax:
cron [-d crondir] [-s] [-v] &

Runs on:
Neutrino

Options:
-d crondir Use the named directory instead of /var/spool/cron.

-s Poll for jobs every minute (to compensate for clock skew).

-v Turn on verbose mode. Log and diagnostic messages are written to


standard error as cron operates.

Description:
The cron server schedules commands to be run at specified times, without user
intervention. This server supports user-specific cron entries, and runs continuously.
The server must be run in the background.

The cron server assumes it has sole use of the /var/spool/cron directory.
Therefore, you can run only one cron server per filesystem containing that directory.
You typically run the cron server on the network server.

Commands are specified by instructions found in crontab files, which you can access
via the crontab utility.
To minimize overhead, cron examines the contents of the files in
/var/spool/cron/crontabs when it first comes up, and then reexamines only
those that have been changed via the crontab utility.

Files:
Errors cause diagnostic messages to be written to standard error. If you specify -v, log
messages are written to the standard error.
The cron utility uses data read from the following:

/var/spool/cron
Each cron command assumes it has exclusive use of this directory.

/var/spool/cron/cron.allow
If present, this file lists the only users authorized to have their crontab run. By
default, all users are authorized. The cron.deny list (below) overrides the
setting of the cron.allow list.

June 22, 2010 Utilities 115


cron © 2010, QNX Software Systems GmbH & Co. KG.

/var/spool/cron/cron.deny
If present, this file lists users who aren’t authorized to have their crontab run.
This list overrides the list of users authorized (the cron.allow file).
/var/spool/cron/crontabs/*
The periodic commands to be run are read out of files found in this directory.

Exit status:
The cron utility normally runs indefinitely. However, it terminates early if errors are
encountered in startup, errors are encountered in reading the crontabs files, or if it’s
terminated by a signal.

0 cron was successfully and cleanly terminated by a SIGTERM or SIGPWR


signal.

>0 An error occurred. A diagnostic message will have been written to standard
error.

See also:
crontab

116 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. crontab
Schedule periodic background work (POSIX)

Syntax:
crontab [-d cron_dir] [-u user] [file]

crontab [-d cron_dir] [-e | -l | -r] [-u user]

Runs on:
Neutrino

Options:
-d cron_dir The location of the crontab directory.

-e Edit a user’s crontab entry. If you don’t specify the -u option,


crontab edits your own entry. It uses vi unless the EDITOR
environment variable names another editor.

-l (“el”) List the crontab entry of the user. Without the -u option, the
invoking user’s entry is listed.

-r Remove a user’s crontab entry. Without the -u option, the invoking


user’s entry is removed.

-u user Specify the user whose crontab is to be acted upon. When submitting
a crontab, the new crontab entry replaces or creates that user’s
crontab. When removing (-r) or listing (-l) existing crontabs, this
specifies which user’s crontab to remove or list. Only root may use
this option.

file The pathname of a file that contains specifications for crontab


entries (see the Description section for the format for these
specifications). If no file is specified, crontab uses the standard
input.

Description:
The crontab utility creates or replaces a user’s crontab entry. You can input the new
crontab entry by specifying a file that contains specifications for crontab entries. If you
don’t specify a file, the standard input is used.

This utility needs to have the setuid (“set user ID”) bit set in its permissions. If you use
mkefs, mketfs, or mkifs on a Windows host to include this utility in an image, use
the perms attribute to specify its permissions explicitly, and the uid and gid
attributes to set the ownership correctly.

Users may use crontab if their names appear in the


/var/spool/cron/cron.allow file. If that file doesn’t exist, the file
/var/spool/cron/cron.deny is checked to determine whether the user should be
denied access to crontab. If neither file exists, only the superuser is allowed to

June 22, 2010 Utilities 117


crontab © 2010, QNX Software Systems GmbH & Co. KG.

modify crontab entries. If cron.allow doesn’t exist and cron.deny exists and is
empty, then global usage is allowed. These permission files consist of one user name
per line.
Each command you specify is executed from your home directory using the shell
(/bin/sh). The cron utility supplies a default environment for the shell, defining
HOME, LOGNAME, SHELL(=/bin/sh), PATH (=:/bin:/usr/bin) and TZ.
Users who want to have their .profile executed must explicitly do so in their
crontab entry.
A crontab entry consists of lines of six fields each. The fields are separated by
blanks. The first five are integer patterns that specify the following:

• minute (0-59)

• hour (0-23)

• day of the month (1-31)

• month of the year (1-12)

• day of the week (0-6 with 0=Sunday)

Each of these patterns can be an asterisk (meaning all valid values), an element, a list
of elements separated by commas, or a range separated by a hyphen (-).
An element is either a number or two numbers separated by a hyphen (meaning an
inclusive range). You can specify days by two fields (day of the month and day of the
week). If both are specified, both are adhered to.
As an example of specifying the two types of days, the following line:

0 0 1,15 * 1

runs a command at 00:00h on the first and fifteenth of each month, as well as at 00:00h
on every Monday. To specify days with only one field, the other field should be set to
*. For example:

0 0 * * 1

runs a command only on Mondays.


The sixth field of a line in a crontab entry is a string that is executed by the command
interpreter at the specified times. A percent character in this field — unless escaped by
a backslash — is translated to a newline character.
Only the first line (up to a % or end-of-line) of the command field is executed by the
command interpreter.

Sample crontab entries


Invoke the calendar program each day one minute after midnight:

1 0 * * * calendar -

118 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. crontab

Display the current time on the system console every 20 minutes:

1,21,41 * * * * (echo -n " "; date; echo) > /dev/con1

Clean up the UUCP work directories each weekday at 5:30 am:

30 5 * * 1-5 /usr/lib/uucp/uuclean

Remove any files under /tmp that haven’t been modified in more than seven days:

0 4 * * * find /tmp -mtime +7 -exec rm -f {} \;

If you want the output from your commands, redirect it to a file.

Examples:
List your own crontab entry:

crontab -l

Files:
When an error occurs, a diagnostic message is written to the standard error.
The standard input may be read for the content of crontab files when they are being
created (none of -e, -l or -r are specified) and no file is specified on the command
line.
When a crontab file is being edited, the editor invoked by crontab inherits
crontab’s standard input, standard output, and standard error.
The following files relative to one of /var/spool/cron, or the directory named in
the -d option are used by crontab:

cron.allow If this file exists, it is read by crontab to determine the


exclusive list of userids who are allowed to schedule cron
jobs.

cron.deny If cron.allow doesn’t exist, crontab reads this file to


determine a list of userids who are NOT allowed to schedule
cron jobs.

crontabs/userid The crontab utility may create, edit, list or remove this file.

Exit status:
0 Successful completion.

>0 An error occurred.

June 22, 2010 Utilities 119


crontab © 2010, QNX Software Systems GmbH & Co. KG.

Caveats:
If you inadvertently enter the crontab utility with no argument, don’t try to get out
by typing Ctrl-D (end-of-file), since this would replace your crontab file with an empty
file. In this case, you should exit by typing your interrupt character, which is typically
Ctrl-C.

See also:
cron

120 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. ctags
Generate tags files (POSIX)

Syntax:
ctags options files...

Runs on:
QNX Neutrino, Linux, Microsoft Windows

Options:
-a Append to the tags file, instead of overwriting it.

-B Use ?regexp? instead of /regexp/.

-Dword Ignore word. This is handy for parameter macro names.

-e Include extern tags.

-F Use /regexp/ (the default).

-h Add hints to help elvis distinguish between overloaded tags.

-i Include inline definitions.

-l (“el”) Add a ln line number hint (implies -h).

-N Use line numbers instead of /regexp/.

-p Write parsing information to stdout (for debugging ctags).

-r Write a refs file, in addition to tags.

-s Include static tags.

-t Include typedefs.

-v Include variable declarations.

-x Write a cross-reference table to stdout instead of to the tags file.

files The pathnames of the files that are to be scanned for tags.

Description:
The ctags utility generates a file called tags from a group of C source files.
Each C source file is scanned for #define statements and function definitions. The
name of the macro or function becomes the name of a tag. For each tag, a line is added
to the tags file, which contains:

• the name of the tag

• a tab character

• the name of the file containing the tag

June 22, 2010 Utilities 121


ctags © 2010, QNX Software Systems GmbH & Co. KG.

• a tab character

• a way to find the particular line within the file

If you don’t specify any options, ctags uses -l -i -s -t -v.


The elvis, less, more, and vi utilities can use entries in the tags file to locate and
display a definition.

Examples:
Generate tags for all the C source and header files in the current directory:

ctags *.[ch]

Contributing author:
Steve Kirkendall; ctags is part of the elvis suite.

See also:
elvis, less, more, vi

122 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. cut
Cut out selected fields of each line of a file (POSIX)

Syntax:
cut -b list [-n] [file...]

cut -c list [file...]

cut -f list [-d delim] [-s] [file...]

Runs on:
Neutrino

Options:
-b list Cut out the bytes found in the byte positions specified by list.
-c list Cut out the characters found in the character positions specified by list.
For example, a list of -c 1-64 outputs the first 64 characters of each
line.
-d delim Use the delimiter specified by delim (default is tab).
-f list Cut out the fields specified by list. For example, -f 2,9 outputs the
second and ninth fields. The fields described by list are assumed to be
separated in the file by a delimiter character (see option -d). Lines
without field delimiters are passed through intact, unless -s is specified.
-n Don’t split multi-byte characters. Characters are output only if at least
one byte is selected, and, after a prefix of zero or more unselected bytes,
the rest of the bytes that form the character are selected.
-s If -f is specified, suppress lines with no field delimiters.
file The pathname of a text file, whose contents are used instead of the
standard input.

Description:
For every file you name, the cut utility cuts out columns or fields from each line,
concatenates them, and writes them to the standard output.
If the fields are of a fixed length, you can select them by the byte or character position
with option -b or -c. If, however, the fields vary in length from line to line, you can
select them with the -f option, provided they’re separated by a delimiter character. By
default, cut assumes the field delimiter character to be tab. You can use the -d option
to specify another delimiter.
In options -b, -c, and -f, list is a comma-separated list of integers (in increasing
order), with an optional dash (-) to indicate ranges.
You can use the cut utility as a filter; if no files are given, the standard input is used.

June 22, 2010 Utilities 123


cut © 2010, QNX Software Systems GmbH & Co. KG.

Examples:
The following are examples of the list argument:

list argument: Meaning:


1,4,7 Select the first, fourth, and seventh characters or fields.
1-3,8 Equivalent to 1, 2, 3, 8.
-5,10 Equivalent to 1, 2, 3, 4, 5, 10.
3- Equivalent to the third through last.

Map userids to names:

cut -d: -f1,5 /etc/passwd

List filenames and their permissions:

ls -l | cut -c57-79,56,56,1-11

Exit status:
0 All input files were output successfully.

>0 An error occurred.

See also:
grep, join, paste

124 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. cvs
Concurrent version-control system

Syntax:
cvs [ global_options ] cmd [ cmd_options ] [ args ]

Runs on:
QNX Neutrino, Linux, Microsoft Windows

Options:
The global_options are:

--allow-root=rootdir
Specify the legal CVSROOT directory (server only).

-a Authenticate all communication (client only).

-b Specify RCS location (CVS 1.9 and older).

-d root Specify the CVSROOT.

On Windows, cvs checks for environment variables in this order:


1 HOME
2 HOMEDRIVE
3 HOMEPATH
If these are not set, you won’t be able to access :pserver: repositories.

-eeditor Edit messages with editor.

-f Don’t read the ‘˜/.cvsrc’ file.

-H
--help Print a help message.

-l Don’t log in CVSROOT/history file.

-n Don’t change any files.

-Q Be really quiet.

-q Be somewhat quiet.

-r Make new working files read-only.

-s variable=value Set a user variable.

-T tempdir Put temporary files in tempdir.

-t Trace CVS execution.

June 22, 2010 Utilities 125


cvs © 2010, QNX Software Systems GmbH & Co. KG.

-v
--version Display version and copyright information for CVS.
-w Make new working files read-write.
-x Encrypt all communication (client only).
-z gzip-level Set the compression level (client only).

Description:
CVS is a concurrent version-control system that you can use to keep track of source
files. The cvs commands, command options, and command arguments are
summarized below; for more information, see Version Management with CVS by Per
Cederqvist et al.

This utility is subject to the GNU Public License (GPL). We’ve included it for use on
development systems.

add
add [options] [files...]
Add a new file or directory. The options include:

-k kflag Set keyword expansion. See “Keyword substitution,” below.


-m msg Set the file description.

admin
admin [options] [files...]
Administration of history files in the repository. The options include:

-b[rev] Set the default branch.


-cstring Set the comment leader.
-ksubst Set keyword substitution. See “Keyword substitution,” below.
-l[rev] Lock revision rev, or the latest revision.
-mrev:msg Replace the log message of revision rev with msg.
-orange Delete revisions from the repository.
-q Run quietly; don’t print diagnostics.
-sstate[:rev] Set the state.
-t Set the file description from standard input.
-tfile Set the file description from file.
-t-string Set the file description to string.
-u[rev] Unlock revision rev, or the latest revision.

126 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. cvs

annotate
annotate [options] [files...]

Show the last revision where each line was modified. The options include:

-D date Annotate the most recent revision no later than date.

-f Use the head revision if the specified tag or date isn’t found.

-l Local; run only in the current working directory.

-R Operate recursively (default).

-r tag Annotate revision tag.

checkout
checkout [options] modules...

Get a copy of the sources. The options include:

-A Reset any sticky tags/date/options.

-c Output the module database.

-D date Check out revisions as of date (is sticky).

-d dir Check out into dir.

-f Use the head revision if the specified tag or date isn’t found.

-j rev Merge in changes.

-k kflag Use kflag keyword expansion. See “Keyword substitution,” below.

-l Local; run only in the current working directory.

-N Don’t shorten module paths if -d is specified.

-n Don’t run the module program (if any).

-P Prune empty directories.

-p Check out files to standard output (avoids stickiness).

-R Operate recursively (default).

-r tag Checkout revision tag (is sticky).

-s Like -c, but include module status.

June 22, 2010 Utilities 127


cvs © 2010, QNX Software Systems GmbH & Co. KG.

commit
commit [options] [files...]

Check changes into the repository. The options include:

-F file Read the log message from file.

-f Force the file to be committed; disables recursion.

-l Local; run only in current working directory.

-m msg Use msg as the log message.

-n Don’t run the module program (if any).

-R Operate recursively (default).

-r rev Commit to rev.

diff
diff [options] [files...]

Show differences between revisions. In addition to the options shown below, diff
accepts a wide variety of options to control output style, for example ‘-c’ for context
diffs.
The options include:

-D date1 Diff revision for date against working file.

-D date2 Diff rev1/date1 against date2.

-l Local; run only in the current working directory.

-N Include diffs for added and removed files.

-R Operate recursively (default).

-r rev1 Diff revision for rev1 against the working file.

-r rev2 Diff rev1/date1 against rev2.

edit
edit [options] [files...]

Get ready to edit a watched file. The options include:

-a actions Specify actions for temporary watch, where the actions argument is
edit, unedit, commit, all, or none.

-l Local; run only in current working directory.

-R Operate recursively (default).

128 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. cvs

editors
editors [options] [files...]

See who’s editing a watched file. The options include:

-l Local; run only in current working directory.

-R Operate recursively (default).

export
export [options] modules...

Export files from CVS. The options include:

-D date Check out revisions as of date.

-d dir Check out into dir.

-f Use head revision if the tag or date isn’t found.

-k kflag Use kflag keyword expansion. See “Keyword substitution,” below.

-l Local; run only in current working directory.

-N Don’t shorten module paths if -d is specified.

-n Don’t run the module program (if any).]

-P Prune empty directories.

-R Operate recursively (default).

-r tag Checkout revision tag (is sticky).

history
history [options] [files...]

Show repository access history. The options include:

-a All users (default is self).

-b str Back to record with str in module/file/repos field.

-c Report on committed (modified) files.

-D date Since date.

-e Report on all record types.

-l Last modified (committed or modified report).

-m module Report on module (repeatable).

-n module In module.

June 22, 2010 Utilities 129


cvs © 2010, QNX Software Systems GmbH & Co. KG.

-o Report on checked out modules.

-r rev Since revision rev.

-T Produce report on all tags.

-t tag Since tag record placed in history file (by anyone).

-u user For user user (repeatable).

-w Working directory must match.

-x types Report on types, one or more of TOEFWUCGMAR.

-z zone Output for time zone zone.

import
import [options] repository vendor-tag release-tags...

Import files into CVS, using vendor branches. The options include:

-b bra Import to vendor branch bra.

-d Use the file’s modification time as the time of import.

-k kflag Set default keyword substitution mode. See “Keyword substitution,”


below.

-m msg Use msg for log message.

-I ign More files to ignore (! to reset).

-W spec More wrappers.

init
init

Create a CVS repository if it doesn’t exist.

log
log [options] [files...]

Print out history information for files. The options include:

-b List only revisions on the default branch.

-d dates Specify dates (d1<d2 for range, d for latest before).

-h Print only the header.

-l Local; run only in current working directory.

-N Don’t list tags.

130 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. cvs

-R Print only the name of the RCS file.

-rrevs List only revisions revs.

-s states List only revisions with the specified states.

-t Print only the header and descriptive text.

-wlogins List only revisions checked in by specified logins.

login
login

Prompt for password for authenticating server.

logout
logout

Remove stored password for authenticating server.

rdiff
rdiff [options] modules...

Show differences between releases. The options include:

-c Context diff output format (default).

-D date Select revisions based on date.

-f Use the head revision if the tag or date wasn’t found.

-l Local; run only in current working directory.

-R Operate recursively (default).

-r rev Select revisions based on rev.

-s Short patch — one line per file.

-t Top two diffs — last change made to the file.

-u Unidiff output format.

-V vers Use RCS Version vers for keyword expansion (obsolete).

release
release [options] directory

Indicate that a directory is no longer in use. The options include:

-d Delete the given directory.

June 22, 2010 Utilities 131


cvs © 2010, QNX Software Systems GmbH & Co. KG.

remove
remove [options] [files...]

Remove an entry from the repository. The options include:

-f Delete the file before removing it.

-l Local; run only in current working directory.

-R Operate recursively (default).

rtag
rtag [options] tag modules...

Add a symbolic tag to a module. The options include:

-a Clear the tag from removed files that would not otherwise be tagged.

-b Create a branch named tag.

-D date Tag revisions as of date.

-d Delete the given tag.

-F Move the tag if it already exists.

-f Force a head revision match if the tag/date wasn’t found.

-l Local; run only in current working directory.

-n No execution of tag program.

-R Operate recursively (default).

-r tag Tag the existing tag tag.

status
status [options] files...

Display status information in a working directory. The options include:

-l Local; run only in current working directory.

-R Operate recursively (default).

-v Include tag information for file.

132 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. cvs

tag
tag [options] tag [files...]

Add a symbolic tag to checked out version of files. The options include:

-b Create a branch named tag.

-D date Tag revisions as of date.

-d Delete the given tag.

-F Move the tag if it already exists.

-f Force a head revision match if the tag/date wasn’t found.

-l Local; run only in current working directory.

-n No execution of tag program.

-R Operate recursively (default).

-r tag Tag the existing tag tag.

unedit
unedit [options] [files...]

Undo an edit command. The options include:

-a actions Specify actions for temporary watch, where the actions argument is
edit, unedit, commit, all, or none.

-l Local; run only in current working directory.

-R Operate recursively (default).

update
update [options] [files...]

Bring the work tree into sync with the repository. The options include:

-A Reset any sticky tags/date/options.

-D date Check out revisions as of date (is sticky).

-d Create directories.

-f Use the head revision if the tag/date wasn’t found.

-I ign More files to ignore (! to reset).

-j rev Merge in changes.

-k kflag Use kflag keyword expansion. See “Keyword substitution,” below.

June 22, 2010 Utilities 133


cvs © 2010, QNX Software Systems GmbH & Co. KG.

-l Local; run only in current working directory.

-P Prune empty directories.

-p Check out files to standard output (avoids stickiness).

-R Operate recursively (default).

-r tag Checkout revision tag (is sticky).

-W spec More wrappers.

watch
watch [on|off|add|remove] [options] [files...]

For on/off, turn on/off read-only checkouts of files. For add/remove, add or remove
notification on actions. The options include:

-a actions Specify actions for temporary watch, where actions is edit, unedit,
commit, all, or none.

-l Local; run only in current working directory.

-R Operate recursively (default).

watchers
watchers [options] [files...]

See who’s watching a file. The options include:

-l Local; run only in current working directory.

-R Operate recursively (default).

Keyword substitution
Keyword expansion modes:

-kkv $Id: file1,v 1.1 1993/12/09 03:21:13 joe Exp $

-kkvl $Id: file1,v 1.1 1993/12/09 03:21:13 joe Exp harry $

-kk $Id$

-kv file1,v 1.1 1993/12/09 03:21:13 joe Exp

-ko No expansion.

-kb No expansion; file is binary.

Keywords:

134 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. cvs

$Author: joe $
$Date: 1993/12/09 03:21:13 $
$Header: /home/files/file1,v 1.1 1993/12/09 03:21:13 joe Exp harry $
$Id: file1,v 1.1 1993/12/09 03:21:13 joe Exp harry $
$Locker: harry $
$Name: snapshot_1_14 $
$RCSfile: file1,v $
$Revision: 1.1 $
$Source: /home/files/file1,v $
$State: Exp $
$Log: file1,v $
Revision 1.1 1993/12/09 03:30:17 joe
Initial revision

Contributing author:
Per Cederqvist et al, Version Management with CVS
Copyright (C) 1992, 1993 Signum Support AB
Permission is granted to make and distribute verbatim copies of this manual provided
the copyright notice and this permission notice are preserved on all copies.
Permission is granted to copy and distribute modified versions of this manual under
the conditions for verbatim copying, provided also that the entire resulting derived
work is distributed under the terms of a permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual into another
language, under the above conditions for modified versions, except that this permission
notice may be stated in a translation approved by the Free Software Foundation.

See also:
Using CVS in the Neutrino User’s Guide
Per Cederqvist et al, Version Management with CVS, available at
http://www.loria.fr/˜molli/cvs-index.html

June 22, 2010 Utilities 135


© 2010, QNX Software Systems GmbH & Co. KG. date
Display or set the date and time (POSIX)

Syntax:
Display the date and time:

date [-tuv] [-s seconds] [+format]

Set the date and time:

date [-uv] [-S seconds] date

Runs on:
QNX Neutrino, Linux, Microsoft Windows

Options:
-S seconds Set the maximum number of seconds (of real time) over which date
is to adjust the time. The date utility doesn’t increase the clock speed
by more than 100% or decrease it by more than 50%. If date can’t do
a slow adjustment within those constraints, the time is changed
immediately. (The default is 300 seconds; use -S0 to disable the
gradual adjustment.)

-s seconds Display the string equivalent of this date, supplied as seconds since the
start of the Epoch (00:00 January 1, 1970). This value is used instead
of the system time value for the number of seconds.

-t Display the current operating system time, in seconds since the start of
the Epoch, as a long integer.

-u Perform operations using Coordinated Universal Time (UTC) instead


of local time. UTC is the standard term for Greenwich Mean Time
(GMT).

-v Be verbose.

date A date specification to set the date to. Only the superuser (root) can
change the date. For more information, see “Setting the date,” below.

+format The format in which the date and time are to be displayed.

Description:
The date utility is used to display and set the current system date and time in
software. Only the superuser (root) may use date to set the time.

June 22, 2010 Utilities 137


date © 2010, QNX Software Systems GmbH & Co. KG.

Displaying the date


The date utility normally displays the current date and time according to the
operating system’s internal time, maintained in software as the number of seconds
since the Epoch (00:00 January 1, 1970). When the -s seconds option is used, date
uses the value specified by the seconds argument instead of the current OS time.
You can specify the format and content of the displayed date and time with the
+format option. The format is composed of ASCII characters and field descriptors
prefaced with %, in a manner similar to a C-language printf() format specifier (the
specific characters used to specify field types are, however, completely different). In
the output, each field descriptor is replaced by its corresponding value; all other
characters are copied to the output without change.

This utility uses strftime(), a libc library function, to format the time into a string.
For a complete list of the field descriptors you can use in the +format option, see
strftime() in the Library Reference.

The date utility always terminates its output with a newline character.

Setting the date


If you’re a system administrator running as root, you may use date to set the system
time. To set the hardware clock to match the current system time set by date, you
should use the rtc utility.

Be careful if you set the date during the period that a time zone is switching from
daylight saving time to standard time. When a time zone changes to standard time, the
local time goes back one hour (for example, 2:00 a.m. becomes 1:00 a.m.). The local
time during this hour is ambiguous (e.g. 1:14 a.m. occurs twice in the morning that the
time zone switches to DST). To avoid problems, use UTC time to set the date in this
period.

By default, if the new time is in the range of:


(-2.5 minutes + old time, 5 minutes + old time)
the date utility makes a “slow adjustment” — it increases the clock speed by less than
100% or decreases the clock speed by less than 50% over a period of time from 1
second to 5 minutes until the clock catches up with the new time. This slow
adjustment doesn’t cause major discontinuities in the time flow. You can disable the
slow adjustment by using the -S0 option.
The date utility recognizes three formats for setting the time:

1 [[[CC]YY]MM]DD]hhmm[.SS]

2 MMDDhhmm[YY]

3 DD [Month [[CC]YY [hh [mm [SS]]]]] [am|pm]

138 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. date

Where:

CC Century (e.g. 19 if the year is 1997)

YY Year modulo 100 (e.g. 97 if the year is 1997)

MM Numerical month of the year (01 for January, 02 for February, etc.)

Month Either the numerical month (1, 2,...12) or the standard English
abbreviation for the month (jan, feb,...dec)

DD Day of the month

hh Hour of the day

mm Minute of the hour

SS Seconds of the minute

am|pm Literally am or pm; you can combine them with hour values less than 13 if
you don’t want a 24-hour clock

Format 1 is compatible with the touch utility. Since each field is two digits, you must
specify a leading 0 for single-digit numbers. You should find this format particularly
useful for adjusting the time of day, since its minimal form is just hhmm (hour and
minute).
Format 2 follows the UNIX System V date conventions. It’s similar to the Format 1,
with the month and day specified, but the year is optional at the end of the
specification instead of the beginning. If there’s a dot (.) in the date, date assumes
the date is Format 1 instead of Format 2. The date utility also differentiates between
MMDDhhmmYY (Format 2) and YYMMDDhhmm (Format 1) by the value of the first
pair of digits. The years 00-12 are before the Epoch. Therefore, if the first pair of
digits is in that range, the date is treated as it is in Format 1.
Format 3 follows the date convention used in QNX 4.00 and earlier. This format is
assumed if there’s more than one operand (the other two formats consist of a single
string of digits), or if there’s just one number that’s two or fewer digits in length.
If you change the date or time, date adds a a line to the /var/log/wtmp if it already
exists.

The date utility doesn’t create /var/log/wtmp if it doesn’t already exist. This file
can quickly become very big, which isn’t good on an embedded system with limited
resources.

June 22, 2010 Utilities 139


date © 2010, QNX Software Systems GmbH & Co. KG.

Examples:
Display the date and time on separate lines:

$ date "+DATE: %m/%d/%y%nTIME: %H:%M:%S"


DATE: 01/20/99
TIME: 08:51:59

Display the time in 12-hour format:

$ date "+TIME: %r"


TIME: 01:36:32 PM

Set the system date to 22 February 1997:

date 22 2 97

Set the system date and time to 16 May 1997, 4:30 pm:

date 16 may 1997 4 30 pm

Adjust the system time to 4:34 pm; use today’s date:

date 1634

The following command, which illustrates the use of date -s, displays the date of
the last entry in the /usr/adm/syslog file (in this file, the first column of each
record is the time in seconds since the Epoch):

$ date -s ‘tail -n1 /usr/adm/syslog | cut -f1 -d ’ ’‘


Wed Apr 15 14:25:49 EDT 1997

For more information, see cut, logger, and tail.

Files:
/var/log/wtmp If you change the data or time, and this file already exists, an
entry is added to it to log the change.

Environment variables:
TZ Specifies the local time zone. The value of TZ affects the conversion between
the system clock (UTC) and the local time.

Exit status:
0 The date was displayed or set successfully.

>0 An error occurred.

140 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. date

Caveats:
Some field descriptors are of unspecified format when not in the POSIX locale. As a
result, parsing the output of date may be difficult in other locales. QNX Neutrino
currently supports only the POSIX (i.e. C) locale.

See also:
phlocale, rtc, uptime
strftime() in the Library Reference

June 22, 2010 Utilities 141


dcheck © 2010, QNX Software Systems GmbH & Co. KG.
Check a disk for bad blocks (QNX 4, QNX Neutrino)

Syntax:
dcheck [options] drive

Runs on:
Neutrino

Options:
-B max_blks The maximum number of blocks to read at a time; max_blks can be
up to 32 (the default).

-b blk_cnt The maximum number of blocks to check.

-f first_blk The first block to check.

-L loops Loop as in the -l option, but with a specified number of loops.

-l (“el”) Loop until input (switching serial/random).

-m In the bitmap, mark bad blocks as unavailable.

-p Prompt before starting.

-q Be quiet; don’t display progress information.

-r Use a random head-movement algorithm.

-V Verify write after read.

-v Be verbose; display every bad block on the disk.

-w Write after read (nondestructive) check.

drive The name of the disk (e.g. /dev/fd0, /dev/hd0t77) or the root of
the filesystem.

Description:
The dcheck utility verifies that a disk has been correctly formatted, by attempting to
read every block on the drive. The block numbers of any blocks that can’t be read are
displayed (in hex) to standard output. A summary of the total number of bad blocks is
also displayed. You can use dcheck to check any formatted disk, including disks that
contain files. The files aren’t damaged.
If you don’t specify the number of blocks to verify, dcheck obtains this information
from the filesystem and checks all the blocks on the specified drive.
If a disk has been initialized for a QNX 4 filesystem, you should use the -m option to
remove any bad blocks from the disk-allocation bitmap (/.bitmap). This is
especially true for hard disks. When you specify the -m option, dcheck attempts to
read the file /.bad_blks from the disk. This file contains a list of all known bad

142 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. dcheck

blocks, in sorted order. If /.bad_blks is found, dcheck reads it, and when it’s
finished checking the disk, dcheck updates the bitmap and recreates the /.bad_blks
file. Note that the dcheck utility only adds to, but never removes, bad block
information in this file.
Some blocks may be marginal, so if you run dcheck multiple times (see the -l and
-L options), you can increase the chance of recognizing these blocks and adding them
to the /.bad_blks file.

The chkfsys utility also recognizes the /.bad_blks file.

To help you find any marginal blocks, dcheck has a number of options to provide
additional checking of a disk. For example, the -r option checks the blocks in a
random order; each check consists of a random number of blocks between 1 and 32 (or
less, depending on the value specified in the -B option). The dcheck utility keeps
track of the checked blocks and checks each one only once. This option allows you to
find blocks that are bad due to a slight lag time in head movement.
The -l option makes dcheck continuously check the disk until you stop it. For this
option, -r is implicitly used and is toggled for each invocation. That is, for the first
loop, random checking is set on; for the second loop, it is off, etc. At the end of each
complete check, you’re prompted to stop the loop. If you don’t stop it within 15
seconds, dcheck is started again, etc. The -L option is identical to -l with an upper
limit to the number of loops.
The -w option makes dcheck rewrite each block on the device after reading it. This is
a nondestructive check that tests the write portion of the hardware. Note that, although
this is a more thorough test, it takes more time, depending on the hardware.
The -V option is similar to the -w option, in that dcheck rewrites each block after
reading it, but in this case dcheck also rereads each block after the rewrite check and
compares this second read with the first. Like the -w option, this test is nondestructive.
Note, however, that this is a more thorough test that takes longer.

Examples:
Check all blocks on the hard disk and mark bad blocks in the bitmap:

dcheck -m /

Check the first 640 blocks on the floppy disk:

dcheck -b 640 /dev/fd0

Check all blocks on the hard disk:

dcheck /dev/hd0t77

June 22, 2010 Utilities 143


dcheck © 2010, QNX Software Systems GmbH & Co. KG.

Files:
If you specify the -m (mark bad blocks) option, the block-special file being checked
must be a currently mounted QNX partition. The .bad_blks and .bitmap files on
that filesystem are updated if dcheck discovers any bad blocks.

Exit status:
0 No bad blocks were found.

>0 An error occurred, or bad blocks were found.

Caveats:
The dcheck utility normally opens the disk in read-only mode. However, if you
specify the -m, -w, or -V option, the disk is opened in read/write mode. For read/write
access, there must be no open files on the disk, or else dcheck fails with a “Device or
resource busy” message. While dcheck is working in read/write mode, no other
utilities or programs is allowed to access the disk.
When using the -m option, if dcheck is terminated by a SIGBREAK or other signal,
any pending bad blocks may not be recorded. In any event, the results are
nondestructive.

See also:
chkfsys, dinit, fdformat, io-blk.so
Backing Up and Recovering Data in the Neutrino User’s Guide

144 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. dd
Convert a file while copying it (UNIX)

Syntax:
dd [if=input_file] [of=output_file] [options]

Runs on:
Neutrino

Options:
if=input_file Read from input_file instead of the standard input.

of=output_file Write to output_file instead of the standard output. Unless


conv=notrunc is given, truncate the file to the size specified by
seek= (0 bytes if seek= isn’t given).

ibs=bytes Read bytes bytes at a time.

obs=bytes Write bytes bytes at a time.

bs=bytes Read and write bytes bytes at a time. Override ibs and obs.

cbs=bytes Convert bytes bytes at a time.

skip=blocks Skip blocks ibs-sized blocks at start of input.

seek=blocks Skip blocks obs-sized blocks at start of output.

count=blocks Copy only blocks ibs-sized input blocks.

conv=conversion[,conversion...]
Convert the file as specified by the conversion arguments.
Conversions are:

ascii Convert EBCDIC to ASCII.


ebcdic Convert ASCII to EBCDIC.
ibm Convert ASCII to alternate EBCDIC.
block Pad newline-terminated records to size of cbs,
replacing newline with trailing spaces.
unblock Replace trailing spaces in cbs-sized block with
newline.
lcase Change uppercase characters to lowercase.
ucase Change lowercase characters to uppercase.
swab Swap every pair of input bytes. Unlike the UNIX dd,
this works when an odd number of bytes are read. If
the input file contains an odd number of bytes, the last
byte is simply copied (since there’s nothing to swap it
with).

June 22, 2010 Utilities 145


dd © 2010, QNX Software Systems GmbH & Co. KG.

noerror Continue after read errors.


notrunc Don’t truncate the output file.
sync Pad every input block to size of ibs with trailing
NULs.

You can follow all numbers by a multiplier:

b Blocks (×512).

k Kbytes (×1024).

w Words (×2).

xm Multiply by m.

Description:
The dd utility copies a file (from the standard input to the standard output, by default)
with a user-selectable blocksize, while optionally performing conversions on it. It’s
meant for writing raw data directly to devices such as tape and disk or writing over the
network, with control over blocking factors and character set translations.

This utility is subject to the GNU Public License (GPL). We’ve included it for use on
development systems.

You can use this command for copying partial files. You can specify the block size,
skip count, and the number of blocks to copy. Sizes are in bytes by default; you can
append the letters w, b, or k to the number to indicate words (2 bytes), blocks (512
bytes), or K (1024 bytes). When dd is finished, it reports the number of full and partial
blocks read and written.

Examples:
Copy file file1 to file2, converting all text to lowercase letters:

dd if=file1 of=file2 conv=lcase

Exit status:
>0 An error occurred.

0 The copy and translation operation was successful.

146 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. dd

Contributing author:
GNU

See also:
cat, cp, pax, head, tr

June 22, 2010 Utilities 147


deflate © 2010, QNX Software Systems GmbH & Co. KG.
Compress files for flash filesystems

Syntax:
deflate [options] [filename]...

Runs on:
QNX Neutrino, Linux, Microsoft Windows

Options:
-b size The compression block size; one of 4K, 8K, 16K or 32K (default: 8K).
The K is assumed; you don’t need to specify it.

-o fname The output filename. A filename of - means standard output. By


default, deflate compresses the files in place.

-i Inflate files (default: deflate).

-t 1|2 The compression type; the default is 2. For a comparison of the types,
see below.

-v Be verbose; list information on each file as it’s compressed.

filename... The files to compress. If no files are given and the -i option is
specified, deflate reads from standard input and writes to standard
output, allowing it to be used as a filter.

Description:
The deflate utility compresses files for a flash filesystem. It’s intended to be used in
conjunction with the filter attribute for mkefs. It can also be used to precompress
files intended for a flash filesystem.
The compression types (specified with the -t option) are:

Type Compression Speed Decompression Speed Compression Amount


1 Fast Very fast 30% on executables
2 Slow Fast 45% on executables

Examples:
Deflate all executables that are to be placed on an embedded target:
deflate -v /target/bin/* /target/lib/*

Inflate a previously deflated file:


deflate -i deflated_file

Deflate a file without changing the input file:

148 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. deflate

deflate -o file.dfl file

See also:
devf-*, inflator

June 22, 2010 Utilities 149


deva-ctrl-4dwave.so © 2010, QNX Software Systems GmbH & Co. KG.
Sound driver for the Trident 4DWave

You must be root to start this driver.

Syntax:
Direct invocation (also causes a new io-audio process to start):

io-audio -d 4dwave [pci=xx] &

Mounting (requires that io-audio is already running):

mount -Tio-audio [-opci=xx] /lib/dll/deva-ctrl-4dwave.so &

Runs on:
Neutrino

Targets:
x86

Options:
pci xx The PCI index of the card you want to attach to. If this option is not
specified, the driver will attempt to find the first unused card in the system.

Description:
The deva-ctrl-4dwave.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-4dwave.so is running, you can use applications with sound, and
those that control the sound-system (e.g. mixer).

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Examples:
Invoke deva-ctrl-4dwave.so directly from io-audio:

io-audio -d 4dwave &

Mount deva-ctrl-4dwave.so (io-audio must be running):

mount -Tio-audio /lib/dll/deva-ctrl-4dwave.so &

150 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. deva-ctrl-4dwave.so

Files:
deva-mixer-ac97.so
Supports the mixer.

Errors:
When an error occurs, deva-ctrl-4dwave.so sends a description of the error to the
system logger (see slogger).

See also:
io-audio, mixer
Audio Developer’s Guide

June 22, 2010 Utilities 151


deva-ctrl-audiopci.so © 2010, QNX Software Systems GmbH & Co. KG.
Sound driver for the AudioPCI chip family

You must be root to start this driver.

Syntax:
Direct invocation (also causes a new io-audio process to start):

io-audio -d audiopci [pci=xx] &

Mounting (requires that io-audio is already running):

mount -Tio-audio [-opci=xx] /lib/dll/deva-ctrl-audiopci.so &

Runs on:
Neutrino

Targets:
x86, MIPS, and PPC

Options:
pci xx The PCI index of the card you want to attach to. If this option is not
specified, the driver will attempt to find the first unused card in the system.

Description:
The deva-ctrl-audiopci.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-audiopci.so is running, you can use applications with sound,
and those that control the sound-system (e.g. mixer).

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Examples:
Invoke deva-ctrl-audiopci.so directly from io-audio:

io-audio -d audiopci &

Mount deva-ctrl-audiopci.so (io-audio must be running):

mount -Tio-audio /lib/dll/deva-ctrl-audiopci.so &

152 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. deva-ctrl-audiopci.so

Files:
deva-mixer-ac97.so or deva-mixer-ak4531.so
Supports the mixer.

Errors:
When an error occurs, deva-ctrl-audiopci.so sends a description of the error to
the system logger (see slogger).

Contributing author:
This utility is based on software contributed to The NetBSD Foundation
by Lennart Augustsson <[email protected]> and Charles M. Hannum.

License:
This utility is based on software from The NetBSD foundation; for licensing
information, see the Third Party License Terms List at
http://licensing.qnx.com/third-party-terms/.

See also:
io-audio, mixer
Audio Developer’s Guide

June 22, 2010 Utilities 153


deva-ctrl-cs4281.so © 2010, QNX Software Systems GmbH & Co. KG.
Sound driver for the CS4281

You must be root to start this driver.

Syntax:
Direct invocation (also causes a new io-audio process to start):

io-audio -d cs4281 [pci=xx] &

Mounting (requires that io-audio is already running):

mount -Tio-audio [-opci=xx] /lib/dll/deva-ctrl-cs4281.so &

Runs on:
Neutrino

Targets:
x86

Options:
pci xx The PCI index of the card you want to attach to. If this option is not
specified, the driver will attempt to find the first unused card in the system.

Description:
The deva-ctrl-cs4281.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-cs4281.so is running, you can use applications with sound, and
those that control the sound-system (e.g. mixer).

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Examples:
Invoke deva-ctrl-cs4281.so directly from io-audio:

io-audio -d cs4281 &

Mount deva-ctrl-cs4281.so (io-audio must be running):

mount -Tio-audio /lib/dll/deva-ctrl-cs4281.so &

154 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. deva-ctrl-cs4281.so

Files:
deva-mixer-ac97.so
Supports the mixer.

Errors:
When an error occurs, deva-ctrl-cs4281.so sends a description of the error to the
system logger (see slogger).

See also:
io-audio, mixer
Audio Developer’s Guide

June 22, 2010 Utilities 155


deva-ctrl-ess1938.so © 2010, QNX Software Systems GmbH & Co. KG.
Sound driver for the ESS1938

You must be root to start this driver.

Syntax:
Direct invocation (also causes a new io-audio process to start):

io-audio -d ess1938 [pci=xx] &

Mounting (requires that io-audio is already running):

mount -Tio-audio [-opci=xx] /lib/dll/deva-ctrl-ess1938.so &

Runs on:
Neutrino

Targets:
x86

Options:
pci xx The PCI index of the card you want to attach to. If this option is not
specified, the driver will attempt to find the first unused card in the system.

Description:
The deva-ctrl-ess1938.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-ess1938.so is running, you can use applications with sound,
and those that control the sound-system (e.g. mixer).

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Examples:
Invoke deva-ctrl-ess1938.so directly from io-audio:

io-audio -d ess1938 &

Mount deva-ctrl-ess1938.so (io-audio must be running):

mount -Tio-audio /lib/dll/deva-ctrl-ess1938.so &

156 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. deva-ctrl-ess1938.so

Files:
deva-mixer-ac97.so
Supports the mixer.

Errors:
When an error occurs, deva-ctrl-ess1938.so sends a description of the error to
the system logger (see slogger).

See also:
io-audio, mixer
Audio Developer’s Guide

June 22, 2010 Utilities 157


deva-ctrl-geode.so © 2010, QNX Software Systems GmbH & Co. KG.
Sound driver for the National Semiconductor Geode family of chips

You must be root to start this driver.

Syntax:
Direct invocation (also causes a new io-audio process to start):

io-audio -d geode [pci=xx] &

Mounting (requires that io-audio is already running):

mount -Tio-audio [-opci=xx] /lib/dll/deva-ctrl-geode.so &

Runs on:
Neutrino

Targets:
x86

Options:
pci xx The PCI index of the card you want to attach to. If this option is not
specified, the driver will attempt to find the first unused card in the system.

Description:
The deva-ctrl-geode.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-geode.so is running, you can use applications with sound, and
those that control the sound-system (e.g. mixer).

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Examples:
Invoke deva-ctrl-geode.so directly from io-audio:

io-audio -d geode &

Mount deva-ctrl-geode.so (io-audio must be running):

mount -Tio-audio /lib/dll/deva-ctrl-geode.so &

158 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. deva-ctrl-geode.so

Files:
deva-mixer-ac97.so
Supports the mixer.

Errors:
When an error occurs, deva-ctrl-geode.so sends a description of the error to the
system logger (see slogger).

Caveats:
You need a current BIOS to run deva-ctrl-geode.so. The BIOS VSA (Virtual
System Architecture) technology must be sufficiently up-to-date to enable the native
audio programming techniques used by this driver. If the BIOS is too old,
deva-ctrl-geode.so will exit and slogger will contain the exit message.

See also:
io-audio, mixer
Audio Developer’s Guide

June 22, 2010 Utilities 159


deva-ctrl-i8x0.so © 2010, QNX Software Systems GmbH & Co. KG.
Sound driver for the Intel 8X0

You must be root to start this driver.

Syntax:
Direct invocation (also causes a new io-audio process to start):

io-audio -d i8x0 [pci=xx] &

Mounting (requires that io-audio already be running):

mount -Tio-audio [-opci=xx] /lib/dll/deva-ctrl-i8x0.so &

Runs on:
Neutrino

Targets:
x86

Options:
pci xx The PCI index of the card you want to attach to. If you don’t specify this
option, the driver attempts to find the first unused card in the system.

Description:
The deva-ctrl-i8x0.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-i8x0.so is running, you can use applications with sound, and
those that control the sound-system (e.g. mixer).

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Examples:
Invoke deva-ctrl-i8x0.so directly from io-audio:

io-audio -d i8x0 &

Mount deva-ctrl-i8x0.so (io-audio must be running):

mount -Tio-audio /lib/dll/deva-ctrl-i8x0.so &

160 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. deva-ctrl-i8x0.so

Files:
deva-mixer-ac97.so
Supports the mixer.

Errors:
When an error occurs, deva-ctrl-i8x0.so sends a description of the error to the
system logger (see slogger).

See also:
deva-mixer-ac97.so, io-audio, mixer
Audio Developer’s Guide

June 22, 2010 Utilities 161


deva-ctrl-intel_hda.so © 2010, QNX Software Systems GmbH & Co. KG.
Sound driver for the Intel High Definition Audio controllers

You must be root to start this driver.

Syntax:
Direct invocation (also causes a new io-audio process to start):

io-audio -d intel_hda [pci=xx] &

Mounting (requires that io-audio already be running):

mount -Tio-audio [-opci=xx] /lib/dll/deva-ctrl-intel_hda.so &

Runs on:
Neutrino

Targets:
x86

Options:
pci xx The PCI index of the card you want to attach to. If you don’t specify this
option, the driver attempts to find the first unused card in the system.

Description:
The deva-ctrl-intel_hda.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-intel_hda.so is running, you can use applications with sound,
and those that control the sound system (e.g. mixer).

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Examples:
Invoke deva-ctrl-intel_hda.so directly from io-audio:

io-audio -d intel_hda &

Mount deva-ctrl-intel_hda.so (io-audio must be running):

mount -Tio-audio /lib/dll/deva-ctrl-intel_hda.so &

162 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. deva-ctrl-intel_hda.so

Files:
deva-mixer-hda.so
Supports the mixer.

Errors:
When an error occurs, deva-ctrl-intel_hda.so sends a description of the error
to the system logger (see slogger).

See also:
deva-mixer-hda.so, io-audio, mixer
Audio Developer’s Guide

June 22, 2010 Utilities 163


deva-ctrl-nmg6.so © 2010, QNX Software Systems GmbH & Co. KG.
Sound driver for the NeoMagic 6 family of chips

You must be root to start this driver.

Syntax:
Direct invocation (also causes a new io-audio process to start):

io-audio -d nmg6 [pci=xx] &

Mounting (requires that io-audio already be running):

mount -Tio-audio [-opci=xx] /lib/dll/deva-ctrl-nmg6.so &

Runs on:
Neutrino

Targets:
x86

Options:
pci xx The PCI index of the card you want to attach to. If you don’t specify this
option, the driver attempts to find the first unused card in the system.

Description:
The deva-ctrl-nmg6.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-nmg6.so is running, you can use applications with sound, and
those that control the sound-system (e.g. mixer).

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Examples:
Invoke deva-ctrl-nmg6.so directly from io-audio:

io-audio -d nmg6 &

Mount deva-ctrl-nmg6.so (io-audio must be running):

mount -Tio-audio /lib/dll/deva-ctrl-nmg6.so &

164 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. deva-ctrl-nmg6.so

Files:
deva-mixer-ac97.so
Supports the mixer.

Errors:
When an error occurs, deva-ctrl-nmg6.so sends a description of the error to the
system logger (see slogger).

See also:
deva-mixer-ac97.so, io-audio, mixer
Audio Developer’s Guide

June 22, 2010 Utilities 165


deva-ctrl-sb.so © 2010, QNX Software Systems GmbH & Co. KG.
Driver for Sound Blaster 16 and compatible sound cards.

You must be root to start this driver.

Syntax:
Direct invocation (also causes a new io-audio process to start):

io-audio -dsb ioport=port,irq=req,dma=ch,dma1=ch &

Mounting (requires that io-audio is already running):

mount -Tio-audio -oioport=port,irq=req,dma=ch,dma1=ch \


/lib/dll/deva-ctrl-sb.so &

Runs on:
x86 only (requires ISA bus)

Options:
dma=ch The primary DMA channel to be used. The value of ch may be 0, 1,
3, 5, 6, or 7. The default value is 1.

dma1=ch The secondary DMA channel to be used. The value of ch may be 0,


1, 3, 5, 6, or 7. The default value is 0.

ioport=port Specifies the base I/O port for Sound Blaster commands. The value
of port is usually 0x220, 0x240, 0x260, or 0x280. The default
value is 0x220.

irq=req The interrupt request line specified by req cannot be shared. The
default value is 10.

Description:
The deva-ctrl-sb.so shared object is a DLL for the io-audio manager. It uses
the API described in the Audio Developer’s Guide.
While deva-ctrl-sb.so is running, you can use applications with sound, and those
that control the sound-system (e.g. mixer).

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

166 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. deva-ctrl-sb.so

Errors:
When an error occurs, deva-ctrl-sb.so sends a description of the error to the
system logger (see slogger).

Caveats:
Some sound cards listed as being Sound Blaster compatible default to another mode
(e.g. some ESS 18xx series (not ESS 1869), OPTi 931, Yamaha OPL3-SA). These
cards will not work with this driver.

See also:
io-audio, mixer Audio Developer’s Guide

June 22, 2010 Utilities 167


deva-ctrl-via686.so © 2010, QNX Software Systems GmbH & Co. KG.
Sound driver for the VIA686

You must be root to start this driver.

Syntax:
Direct invocation (also causes a new io-audio process to start):

io-audio -d via686 [pci=xx] &

Mounting (requires that io-audio is already running):

mount -Tio-audio [-opci=xx] /lib/dll/deva-ctrl-via686.so &

Runs on:
Neutrino

Targets:
x86

Options:
pci xx The PCI index of the card you want to attach to. If this option is not
specified, the driver will attempt to find the first unused card in the system.

Description:
The deva-ctrl-via686.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-via686.so is running, you can use applications with sound, and
those that control the sound-system (e.g. mixer).

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Examples:
Invoke deva-ctrl-via686.so directly from io-audio:

io-audio -d via686 &

Mount deva-ctrl-via686.so (io-audio must be running):

mount -Tio-audio /lib/dll/deva-ctrl-via686.so &

168 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. deva-ctrl-via686.so

Files:
deva-mixer-ac97.so
Supports the mixer.

Errors:
When an error occurs, deva-ctrl-via686.so sends a description of the error to the
system logger (see slogger).

See also:
io-audio, mixer
Audio Developer’s Guide

June 22, 2010 Utilities 169


deva-ctrl-vortex.so © 2010, QNX Software Systems GmbH & Co. KG.
Sound driver for the Aureal Vortex

You must be root to start this driver.

Syntax:
Direct invocation (also causes a new io-audio process to start):

io-audio -d vortex [pci=xx] &

Mounting (requires that io-audio is already running):

mount -Tio-audio [-opci=xx] /lib/dll/deva-ctrl-vortex.so &

Runs on:
Neutrino

Targets:
x86

Options:
pci xx The PCI index of the card you want to attach to. If this option is not
specified, the driver will attempt to find the first unused card in the system.

Description:
The deva-ctrl-vortex.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-vortex.so is running, you can use applications with sound, and
those that control the sound-system (e.g. mixer).

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Examples:
Invoke deva-ctrl-vortex.so directly from io-audio:

io-audio -d vortex &

Mount deva-ctrl-vortex.so (io-audio must be running):

mount -Tio-audio /lib/dll/deva-ctrl-vortex.so &

170 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. deva-ctrl-vortex.so

Files:
deva-mixer-ac97.so
Supports the mixer.

Errors:
When an error occurs, deva-ctrl-vortex.so sends a description of the error to the
system logger (see slogger).

Contributing author:
Aureal Semiconductor Inc.

See also:
io-audio, mixer
Audio Developer’s Guide

June 22, 2010 Utilities 171


deva-ctrl-ymfds1.so © 2010, QNX Software Systems GmbH & Co. KG.
Sound driver for the Yamaha DS1

You must be root to start this driver.

Syntax:
Direct invocation (also causes a new io-audio process to start):

io-audio -d ymfds1 [pci=xx] &

Mounting (requires that io-audio is already running):

mount -Tio-audio [-opci=xx] /lib/dll/deva-ctrl-ymfds1.so &

Runs on:
Neutrino

Targets:
x86

Options:
pci xx The PCI index of the card you want to attach to. If this option is not
specified, the driver will attempt to find the first unused card in the system.

Description:
The deva-ctrl-ymfds1.so shared object is a device driver DLL used by the
io-audio manager. It uses the API described in the Audio Developer’s Guide.
While deva-ctrl-ymfds1.so is running, you can use applications with sound, and
those that control the sound-system (e.g. mixer).

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Examples:
Invoke deva-ctrl-ymfds1.so directly from io-audio:

io-audio -d ymfds1 &

Mount deva-ctrl-ymfds1.so (io-audio must be running):

mount -Tio-audio /lib/dll/deva-ctrl-ymfds1.so &

172 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. deva-ctrl-ymfds1.so

Files:
deva-mixer-ac97.so
Supports the mixer.

Errors:
When an error occurs, deva-ctrl-ymfds1.so sends a description of the error to the
system logger (see slogger).

Contributing author:
Aureal Semiconductor Inc.

See also:
io-audio, mixer
Audio Developer’s Guide

June 22, 2010 Utilities 173


deva-mixer-ac97.so © 2010, QNX Software Systems GmbH & Co. KG.
Mixer DLL for the Intel Audio Codec ’97 (AC’97)

You can’t invoke this shared object. An audio driver (deva-ctrl-*) loads it if the
driver determines that your hardware needs it.

Syntax:
N/A

Runs on:
Neutrino

Options:
None.

Description:
The deva-mixer-ac97.so shared object provides an interface between the AC’97
standard codec and an audio driver.

Errors:
When an error occurs, deva-mixer-ac97.so sends a description of the error to the
system logger (see slogger).

See also:
io-audio, mixer
The Intel Corporation web site for the the Audio Codec ’97 specification

174 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. deva-mixer-ak4531.so
Mixer DLL for the ASAHI KASEI AK4531 CODEC

You can’t invoke this shared object. An audio driver (deva-ctrl-*) loads it if the
driver determines that your hardware needs it.

Syntax:
N/A

Runs on:
Neutrino

Options:
None.

Description:
The deva-mixer-ak4531.so shared object provides an interface between the
AK4531 CODEC and an audio driver.

Errors:
When an error occurs, deva-mixer-ak4531.so sends a description of the error to
the system logger (see slogger).

See also:
io-audio, mixer,

June 22, 2010 Utilities 175


deva-mixer-hda.so © 2010, QNX Software Systems GmbH & Co. KG.
Mixer DLL for High Definition Audio codecs

You can’t invoke this shared object. An audio driver (deva-ctrl-*) loads it if the
driver determines that your hardware needs it.

Syntax:
N/A

Runs on:
Neutrino

Options:
None.

Description:
The deva-mixer-hda.so shared object provides an interface between High
Definition Audio codecs and an audio driver.

The Dll has support for a subset of the codecs in production; your particular codec
may not yet be supported.

Errors:
When an error occurs, deva-mixer-hda.so sends a description of the error to the
system logger (see slogger).

See also:
io-audio, mixer

176 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. deva-util-restore.so
Shared object used to restore an audio driver’s state

You don’t invoke this object directly; io-audio loads it on loading a new driver.

Syntax:
N/A

Runs on:
Neutrino

Targets:
ARM, MIPS, PPC, SH, x86

Options:
None.

Description:
When io-audio loads a new driver, it uses the deva-util-restore.so shared
object to restore the driver’s state, which consists of all the device settings, such as the
output volume level and the selected input connection. The state information is
restored from a configuration file that was updated the last time the driver ran.

This shared object is an optional component of the audio system. If io-audio can’t
load it, io-audio continues, but doesn’t restore the driver state. See also the
io-audio global option config_write_delay.

Errors:
When an error occurs, deva-util-restore.so sends a description of it to the
system logger, slogger.

See also:
io-audio, mixer
Driver Development Kits Audio Devices

June 22, 2010 Utilities 177


devb-adpu320 © 2010, QNX Software Systems GmbH & Co. KG.
Driver for Adaptec AIC-7901/7902-based SCSI adapters (QNX Neutrino)

You must be root to start this driver.

Syntax:
devb-adpu320 [cam option[,option]...]
[cdrom option[,option]...]
[disk option[,option]...]
[optical option[,option]...]
[adpu320 option[,option]...]
[blk option[,option]...] &

Runs on:
Neutrino

Options:
Use commas (,) to separate the options. You can put the cam, cdrom, disk,
optical, adpu320, and blk groups of options in any order.

cam options
lun=mask Enable Logical Unit Number (LUN) scan for the devices specified in
mask. The mask is a hex bitmask specifying which IDs to scan for; the
default is 0x00.

quiet Be quiet: don’t display any information on startup.

verbose Be verbose: display full information about SCSI units (devices) on


startup.

cdrom options
The cdrom options control the driver’s interface to cam-cdrom.so. If specified, they
must follow the cdrom keyword.

disk options
The disk options control the driver’s interface to cam-disk.so. If specified, they
must follow the disk keyword.

optical options
The optical options control the driver’s interface to cam-optical.so. If specified,
they must follow the optical keyword.

178 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devb-adpu320

adpu320 options
The adpu320 options control the driver’s interface to the U320 series controllers. If
you’ve installed multiple controllers, you can repeat these options for each controller.
Remember, however, to specify the adpu320 keyword before each controller’s set of
options.

vid= vid The vendor ID of the controller.

did=did The device ID of the controller.

pci=index The PCI index of the controller in the machine, where index is a value
between 0 and the number of adapters.

blk options
The blk options control io-blk.so. If specified, they must follow the blk keyword.

Description:
The devb-adpu320 driver is for SCSI adapters based on the Adaptec AIC-790X
chips.
Controllers supported by this driver include, but aren’t necessarily limited to:

Manufacturer Controller
Adaptec AIC-7901
Adaptec AIC-7902
Adaptec 29320A-R

If you have problems with the PCI adapter make sure that you have an up to date
version of the the adapter BIOS as well as system BIOS.
Controllers are numbered from 0 to n, in the order they’re found. For each controller,
the driver performs a scan, looking for installed units. All targets are scanned (0 to 7)
and for each target, each LUN (Logical Unit Number) is scanned (0 to 7). Devices are
numbered starting from 0, and each type of device is numbered separately.
The devb-adpu320 driver closes its standard input, standard output and standard
error immediately after completing its initializations. Error messages may be
produced during the initialization phase and are written to standard error.

Examples:
Assume an U320 controller, and list all connected devices:

devb-adpu320 &
Assume an U320 PCI controller with a PCI index of 1, and list all connected devices:

June 22, 2010 Utilities 179


devb-adpu320 © 2010, QNX Software Systems GmbH & Co. KG.

devb-adpu320 adpu320 pci=1 &

Files:
The devb-adpu320 driver causes io-blk.so to adopt various block special devices
under /dev. These devices are normally named hd n (or cd n for CD-ROMs), where n
is the physical unit number of the device. This driver could also require the following
shared objects:

Binary Required
cam-cdrom.so For CD-ROM access
cam-disk.so For hard-disk access
libcam.so Always

Exit status:
The devb-adpu320 driver terminates only if an error occurs during startup, or if it
has successfully forked itself upon startup because it hadn’t been initially started in the
background.

0 The devb-adpu320 driver wasn’t started in the background and therefore


forked itself. The original process terminated with a zero exit status, the
forked process continued.

>0 An error occurred during startup.

Caveats:
Unless overridden with the blk automount= option (see io-blk.so), devices are
mounted as:

Device Mountpoint Filesystem type


/dev/hd0t77 /hd qnx4
/dev/cd0 /cd cd
/dev/hd0t6 /dos dos
/dev/hd0t11 /dos dos

While there’s no limit to the size of a disk or partition, I/O (i.e. the lseek(), read() and
write() functions) is currently limited to 2 gigabytes per partition (or disk). This I/O
limit has no effect on the partition size for mounted filesystems.
Known supported functions include:

180 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devb-adpu320

chmod(), chown(), close(), closedir(), creat(), devctl(), dup(), dup2(),


fcntl(), fpathconf(), fstat(), lseek(), mkdir(), mkfifo(), mknod(), open(),
opendir(), pathconf(), read(), readdir(), readlink(), rewinddir(), rmdir(),
stat(), symlink(), unlink() (not supported for directories$ utime(), write()

Note that certain calls (such as pipe(), as well as read() and write() on FIFOs) may
require the pipe manager.

See also:
cam-*, devb-*, fs-*, io-blk.so
“Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter of the QNX Neutrino User’s Guide

June 22, 2010 Utilities 181


devb-aha8 © 2010, QNX Software Systems GmbH & Co. KG.
Driver for Adaptec AIC-7870/7880 based SCSI adapters (QNX Neutrino)

You must be root to start this driver.

Syntax:
devb-aha8 [cam option[,option]...]
[cdrom option[,option]...]
[disk option[,option]...]
[optical option[,option]...]
[aha8 option[,option]...]
[blk option[,option]...] &

Runs on:
Neutrino

Options:
Use commas (,) to separate the options. You can put the cam, cdrom, disk,
optical, aha8, and blk groups of options in any order.

cam options
lun=mask Enable Logical Unit Number (LUN) scan for the devices specified in
mask. The mask is a hex bitmask specifying which IDs to scan for; the
default is 0x00.

quiet Be quiet: don’t display any information on startup.

verbose Be verbose: display full information about SCSI units (devices) on


startup.

cdrom options
The cdrom options control the driver’s interface to cam-cdrom.so. If specified, they
must follow the cdrom keyword.

disk options
The disk options control the driver’s interface to cam-disk.so. If specified, they
must follow the disk keyword.

optical options
The optical options control the driver’s interface to cam-optical.so. If specified,
they must follow the optical keyword.

182 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devb-aha8

aha8 options
The aha8 options control the drivers interface to the AHA 8 series controllers. If
you’ve installed multiple controllers, you can repeat these options for each controller.
Remember, however, to specify the aha8 keyword before each controller’s set of
options.

pci=index The PCI index of the controller in the machine, where index is a value
between 0 and the number of adapters.

noreset Don’t reset the SCSI bus.

blk options
The blk options control io-blk.so. If specified, they must follow the blk keyword.

Description:
The devb-aha8 driver is for SCSI adapters based on the Adaptec AIC-7870 and
AIC-7880 chips. Controllers supported by this driver include, but aren’t necessarily
limited to:

Manufacturer Controller
Adaptec AIC-7870
Adaptec AIC-7880
Adaptec AHA-2940
Adaptec AHA-2940W
Adaptec AHA-3940

The devb-aha8 driver queries the BIOS for PCI card memory addresses.

If you have problems with the PCI adapter make sure that you have an up to date
version of the the adapter BIOS as well as system BIOS.

Controllers are numbered from 0 to n, in the order they’re found.


For each controller, the driver performs a scan, looking for installed units. All targets
are scanned (0 to 7) and for each target, each LUN (Logical Unit Number) is scanned
(0 to 7). Devices are numbered starting from 0, and each type of device is numbered
separately.
The devb-aha8 driver closes its standard input, standard output and standard error
immediately after completing its initializations. Error messages may be produced
during the initialization phase and are written to standard error.

June 22, 2010 Utilities 183


devb-aha8 © 2010, QNX Software Systems GmbH & Co. KG.

Examples:
Assume an AHA 8 controller, and list all connected devices:
devb-aha8 &

Assume an AHA 8 PCI controller with a PCI index of 1, and list all connected devices:

devb-aha8 aha8 pci=1 &

Files:
The devb-aha8 driver causes io-blk.so to adopt various block special devices
under /dev. These devices are normally named hdn (or cdn for CD-ROMs), where n
is the physical unit number of the device.
This driver could also require the following shared objects:

Binary Required
cam-cdrom.so For CD-ROM access.
cam-disk.so For hard-disk access.
libcam.so Always

Exit status:
The devb-aha8 driver terminates only if an error occurs during startup, or if it has
successfully forked itself upon startup because it hadn’t been initially started in the
background.

0 The devb-aha8 driver wasn’t started in the background and therefore forked
itself. The original process terminated with a zero exit status, the forked
process continued.

>0 An error occurred during startup.

Caveats:
Unless overridden with the blk automount= option (see io-blk.so), devices are
mounted as:

Device Mountpoint Filesystem type


/dev/hd0t77 /hd qnx4

continued. . .

184 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devb-aha8

Device Mountpoint Filesystem type


/dev/cd0 /cd cd
/dev/hd0t6 /dos dos
/dev/hd0t11 /dos dos

While there’s no limit to the size of a disk or partition, I/O (i.e. the lseek(), read() and
write() functions) is currently limited to 2 gigabytes per partition (or disk). This I/O
limit has no effect on the partition size for mounted filesystems.
Known supported functions include:

chmod(), chown(), close(), closedir(), creat(), devctl(), dup(), dup2(),


fcntl(), fpathconf(), fstat(), lseek(), mkdir(), mkfifo(), mknod(), open(),
opendir(), pathconf(), read(), readdir(), readlink(), rewinddir(), rmdir(),
stat(), symlink(), unlink() (not supported for directories), utime(), write()

Note that certain calls (such as pipe(), as well as read() and write() on FIFOs) may
require the pipe manager.

See also:
cam-*, devb-*, fs-*, io-blk.so
“Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter of the QNX Neutrino User’s Guide

June 22, 2010 Utilities 185


devb-ahci © 2010, QNX Software Systems GmbH & Co. KG.
Driver for AHCI SATA interfaces (QNX Neutrino)

You must be root to start this driver.

Syntax:
devb-ahci [cam option[,option]...]
[ahci option[,option]...]
[blk option[,option]...] &

Runs on:
QNX Neutrino

Options:
Use commas (,) to separate the options. You can put the cam, ahci, and blk groups
of options in any order.

cam options
lun=mask Enable Logical Unit Number (LUN) scan for the devices specified in
mask. The mask is a hex bitmask specifying which IDs to scan for; the
default is 0x00.

quiet Be quiet: don’t display any information on startup.

verbose Be verbose: display full information about SCSI units (devices) on


startup.

ahci options
The ahci options control the driver’s interface to the AHCI controller. If you’ve
installed multiple controllers, you can repeat these options for each controller.
Remember, however, to specify the ahci keyword before each controller’s set of
options.
Interface-specific options:

irq=req The interrupt used by the controller.

vid=vid The vendor ID of the controller.

did=did The device ID of the controller.

pci=index The PCI index of the controller in the machine, where index is
a value between 0 and the number of adapters.

nobmstr Don’t use busmastering.

port=N ,device Specify options for device on port N.

186 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devb-ahci

priority=prio Set the priority of the processing thread. The default is 21.

timeout=timeout Set the I/O request timeout, in seconds. The default is 10.

Device-specific options:

geometry=heads:cyl:sect
Specify the drive geometry.

nobmstr Don’t use busmastering.

chs Use Cylinder-Head-Sector mode. The default is LBA.

blk options
The blk options control io-blk.so. If specified, they must follow the blk keyword.

Description:
The devb-ahci supports the Intel AHCI SATA controller with the following device
IDs:

• ICH-6 82801FB_SATA 0x2651

• ICH-6 82801FBM_SATA 0x2653

• ICH-7 82801GB_SATA 0x27c1

• ICH-7 82801GBM_SATA 0x27c5

You need to enable AHCI mode in the BIOS.

Examples:
Detect all SATA controllers, and list all connected devices:

devb-ahci &

Files:
The devb-ahci driver causes io-blk.so to adopt various block special devices
under /dev. These devices are normally named hdn, where n is the physical unit
number of the device.
This driver could also require the following shared objects:

June 22, 2010 Utilities 187


devb-ahci © 2010, QNX Software Systems GmbH & Co. KG.

Binary Required
cam-disk.so For hard-disk access.
libcam.so Always

Exit status:
The devb-ahci driver terminates only if an error occurs during startup, or if it has
successfully forked itself upon startup because it hadn’t been initially started in the
background.

0 The devb-ahci driver wasn’t started in the background and therefore forked
itself. The original process terminated with a zero exit status, the forked
process continued.

>0 An error occurred during startup.

Caveats:
Unless overridden with the blk automount= option (see io-blk.so), devices are
mounted as:

Device Mountpoint Filesystem type


/dev/hd0t77 /hd qnx4
/dev/hd0t6 /dos dos
/dev/hd0t11 /dos dos

While there’s no limit to the size of a disk or partition, I/O (i.e. the lseek(), read() and
write() functions) is currently limited to 2 gigabytes per partition (or disk). This I/O
limit has no effect on the partition size for mounted filesystems.
Known supported functions include:

chmod(), chown(), close(), closedir(), creat(), devctl(), dup(), dup2(),


fcntl(), fpathconf(), fstat(), lseek(), mkdir(), mkfifo(), mknod(), open(),
opendir(), pathconf(), read(), readdir(), readlink(), rewinddir(), rmdir(),
stat(), symlink(), unlink() (not supported for directories), utime(), write()

Note that certain calls (such as pipe(), as well as read() and write() on FIFOs) may
require the pipe manager.

188 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devb-ahci

See also:
cam-*, devb-*, fs-*, io-blk.so
“Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter of the QNX Neutrino User’s Guide

June 22, 2010 Utilities 189


devb-btmm © 2010, QNX Software Systems GmbH & Co. KG.
Driver for BusLogic/Mylex Multimaster host adapters (QNX Neutrino)

You must be root to start this driver.

Syntax:
devb-btmm [cam option[,option]...]
[cdrom option[,option]...]
[disk option[,option]...]
[optical option[,option]...]
[btmm option[,option]...]
[blk option[,option]...] &

Runs on:
Neutrino

Options:
Use commas (,) to separate the options. You can put the cam, cdrom, disk,
optical, btmm, and blk groups of options in any order.

cam options
lun=mask Enable Logical Unit Number (LUN) scan for the devices specified in
mask. The mask is a hex bitmask specifying which IDs to scan for; the
default is 0x00.

quiet Be quiet: don’t display any information on startup.

verbose Be verbose: display full information about SCSI units (devices) on


startup.

cdrom options
The cdrom options control the driver’s interface to cam-cdrom.so. If specified, they
must follow the cdrom keyword.

disk options
The disk options control the driver’s interface to cam-disk.so. If specified, they
must follow the disk keyword.

optical options
The optical options control the driver’s interface to cam-optical.so. If specified,
they must follow the optical keyword.

190 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devb-btmm

btmm options
The btmm options control the drivers interface to the BusLogic/Mylex Multimaster
series controllers. If you’ve installed multiple controllers, you can repeat these options
for each controller. Remember, however, to specify the btmm keyword before each
controller’s set of options.

ioport=port The I/O port of the interface. By default, it’s detected automatically.

clone Use this for clones; the default is for the driver to attempt to verify
the type of card, and clone disables this check.

dma=channel Use the specified DMA channel.

irq=req Assume that the controller is using this interrupt. Default is 11.

noreset Reset the controller and SCSI bus at initialization time.

scsiid=id Specify the SCSI ID used by the controller. Default is 7.

blk options
The blk options control io-blk.so. If specified, they must follow the blk keyword.

Description:
The devb-btmm driver is for the BusLogic/Mylex Multimaster and compatible SCSI
controllers.
Controllers supported by this driver include, but aren’t necessarily limited to:

Controller Description
BT-440C Bus master VL SCSI host adapter.
BT-445C Bus master VL SCSI host adapter with floppy controller.
BT-542B Bus master ISA SCSI host adapter with floppy controller.
BT-542D Bus master ISA-to-Fast SCSI host adapter with floppy controller.
BT-545C Bus master ISA SCSI host adapter with floppy controller.
BT-545S Bus master ISA-to-Fast SCSI host adapter with floppy controller.
BT-646S Bus master MCA SCSI host adapter.
BT-747S Bus master EISA SCSI host adapter.
BT-946C Bus master PCI-to-Fast SCSI host adapter with floppy controller.

June 22, 2010 Utilities 191


devb-btmm © 2010, QNX Software Systems GmbH & Co. KG.

The driver performs a scan, looking for installed units. All targets are scanned (0 to 7)
and for each target, each LUN (Logical Unit Number) is scanned (0 to 7). Devices are
numbered starting from 0, and each type of device is numbered separately.
The devb-btmm driver closes its standard input, standard output and standard error
immediately after completing its initializations. Error messages may be produced
during the initialization phase and are written to standard error.

Examples:
Start the Multimaster driver:

devb-btmm &

Start the Multimaster driver with an I/O port of 0x330 and an interrupt of 11:

devb-btmm btmm ioport=0x330,irq=11 &

Files:
The devb-btmm driver causes io-blk.so to adopt various block special devices
under /dev. These devices are normally named hdn (or cdn for CD-ROMs), where n
is the physical unit number of the device.
This driver could also require the following shared objects:

Binary Required
cam-cdrom.so For CD-ROM access
cam-disk.so For hard-disk access
libcam.so Always

Exit status:
The devb-btmm driver terminates only if an error occurs during startup, or if it has
successfully forked itself upon startup because it hadn’t been initially started in the
background.

0 The devb-btmm driver wasn’t started in the background and therefore forked
itself. The original process terminated with a zero exit status, the forked
process continued.

>0 An error occurred during startup.

192 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devb-btmm

Caveats:
The BusLogic/Mylex Multimaster host adapter is compatible with the Adaptec
AIC-154x SCSI controller. On startup, the enumerators recognize this adapter as the
Adaptec card but devb-aha4 will fail unless it includes the clone option.
Unless overridden with the blk automount= option (see io-blk.so), devices are
mounted as:

Device Mountpoint Filesystem type


/dev/hd0t77 /hd qnx4
/dev/cd0 /cd cd
/dev/hd0t6 /dos dos
/dev/hd0t11 /dos dos

While there’s no limit to the size of a disk or partition, I/O (i.e. the lseek(), read() and
write() functions) is currently limited to 2 gigabytes per partition (or disk). This I/O
limit has no effect on the partition size for mounted filesystems.
Known supported functions include:

chmod(), chown(), close(), closedir(), creat(), devctl(), dup(), dup2(),


fcntl(), fpathconf(), fstat(), lseek(), mkdir(), mkfifo(), mknod(), open(),
opendir(), pathconf(), read(), readdir(), readlink(), rewinddir(), rmdir(),
stat(), symlink(), unlink() (not supported for directories), utime(), write()

Note that certain calls (such as pipe() as well as read() and write() on FIFOs) may
require the pipe manager.

See also:
cam-*, devb-*, fs-*, io-blk.so
“Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter of the QNX Neutrino User’s Guide

June 22, 2010 Utilities 193


devb-eide © 2010, QNX Software Systems GmbH & Co. KG.
Driver for ATA/IDE disk interface and ATAPI CD-ROM interface (QNX Neutrino)

You must be root to start this driver.

Syntax:
devb-eide [blk option[,option]...]
[cam option[,option]...]
[cdrom option[,option]...]
[disk option[,option]...]
[eide option[,option]...] &

Runs on:
Neutrino

Options:
Use commas (,) to separate the options. You can put the blk, cam, cdrom, disk, and
eide groups of options in any order.

blk options
The blk options control io-blk.so. If specified, they must follow the blk keyword.

cam options
quiet Be quiet: don’t display any information on startup.

verbose Be verbose.

cdrom options
The cdrom options control the driver’s interface to cam-cdrom.so. If specified, they
must follow the cdrom keyword.

disk options
The disk options control the driver’s interface to cam-disk.so. If specified, they
must follow the disk keyword.

eide options
The eide options control the driver’s interface to the EIDE controller. If you’ve
installed multiple controllers, you can repeat these options for each controller.
Remember, however, to specify the eide keyword before each controller’s set of
options.

194 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devb-eide

Interface-specific options:

chnl=chnl The channel number of the controller (0 or 1).

decode=xor Set the layout between I/O registers. The default is 0.

did=did The device ID of the controller.

ioport=pri[:sec] The I/O port of the interface. By default, it’s detected


automatically.

irq=req The interrupt used by the controller.

master=device Specify master device options. For device-specific options, see


below.

nobios Do not use BIOS transfer mode settings. The default is to use
them.

nobmstr Do not use busmastering. Specify this option if you want to


disable DMA.

noconcurrent Don’t allow concurrent access to both channels.

nolegacy Don’t scan legacy addresses (0x1f0, 0x170).

nomaster Don’t scan for master devices.

noreset Don’t reset devices at initialization.

noslave Don’t scan for slave devices.

pci=index The PCI index of the controller in the machine, where index is
a value between 0 and the number of adapters.

priority=prio Set the priority of the processing thread. The default is 21.

slave=device. Specify slave device options. For device-specific options, see


below.

stride=space Set the spacing offset between I/O ports (IDE command
registers). E.g. if the ports are located on 4-byte boundaries, set
space to 4. The default is 1.

timeout=timeout Set the I/O request timeout in seconds. The default is 10.

vid=vid The vendor ID of the controller.

June 22, 2010 Utilities 195


devb-eide © 2010, QNX Software Systems GmbH & Co. KG.

Device-specific options:

ata Set the device type to ATA.


atapi Set the device type to ATAPI.
chs Use Cylinder-Head-Sector mode instead of Logical Block
Addressing. LBA is used by default.
geometry=heads:cyl:sect
Specify drive geometry.
lba48 Enable LBA 48-bit addressing (off by default).
mdma=mode Set multi-word DMA mode. Values for mode can be 0-2 (or off
to disable).
multiblk=blks Set the number of blocks per interrupt for multiblk mode.
nonremovable Report the device as nonremovable.
pio=mode Set PIO mode. Values for mode can be 0-4 (or off to disable
PIO).
smart Enable SMART monitoring.
udma=mode Set ultra DMA mode. Values for mode can be 0-6 (or off to
disable).
wcache Enable the device write cache.
xfer=width Set the I/O access width (8, 16, or 32 bits).

Description:
The devb-eide driver is for IDE (Integrated Drive Electronics), EIDE (Enhanced
IDE) and ATA (AT Attachment) hard disk interface, as well as the ATAPI (ATA Packet
Interface) CD-ROM interface. This driver autodetects all interfaces.

If you’re installing multiple operating systems on the drive, make sure they all use a
compatible mode. For example, if your drive is ≥ 528M and DOS will also be installed
on the drive, the driver should be configured to use LBA.

The devb-eide driver uses DMA by default. If you want to disable DMA, specify
the nobmstr command-line option.
By default, the driver uses LBA (Logical Block Addressing) modes if the drive
supports them. If you want the device programmed to CHS (Cylinder-Head-Sector)
mode, specify the chs option.
The devb-eide driver closes its standard input, standard output, and standard error
immediately after completing its initializations. Any error messages produced during
the initialization phase are written to standard error.

196 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devb-eide

Examples:
Detect all IDE controllers, and list all connected devices:
devb-eide &

Detect an IDE controller at a specific I/O port address and IRQ number, and list all
connected devices:
devb-eide eide ioport=0x1f0,irq=14

Detect a PCMCIA disk that is configured in contiguous I/O mapped addressing at a


specific I/O port address and IRQ number:
devb-eide eide ioport=0x320:0x32c,irq=7,noslave

For PCMCIA devices configured in contiguous I/O mapped addressing, you should
always specify the control block address of the interface by adding an offset (usually
12) to the base address of the port. This is not required for legacy addressing (0x1f0
or 0x170), where the driver adds the standard control block offset (0x200)
automatically.

Detect an IDE controller with a specific vendor and device identity, and list all
connected devices:
devb-eide eide vid=0x8086,did=0x2411,pci=0,chnl=0

Detect an IDE controller with a specific vendor ID, device ID, and channel number,
and disable ultra DMA on the master:
devb-eide eide vid=0x8086,did=0x2411,pci=0,chnl=1,master=udma=off

Pass cache and delwri options to io-blk.so, uid and gid options to fs-cd.so,
and vollabel option to fs-dos.so:
devb-eide blk cache=2m,delwri=2s cd uid=234,gid=120 dos \
vollabel=ignore &

The cd and dos options apply to any filesystems of those types that are mounted
(either by the automatic mounter or a later explicit mount).
You can also pass generic mount options (as described in io-blk.so) as follows:
devb-eide blk noatime dos hidden=show,noexec qnx4 ro &

This sets the ST_NOATIME mount bit for all filesystems, the ST_RDONLY bit for any
QNX 4 filesystem, and the ST_NOEXEC bit for any DOS filesystem. The mount
message also has these bits, which apply only to that mountpoint.

Files:
The devb-eide driver causes io-blk.so to adopt various block special devices
under /dev. These devices are normally named hdn (or cdn for CD-ROMs), where n
is the physical unit number of the device.
This driver could also require the following shared objects:

June 22, 2010 Utilities 197


devb-eide © 2010, QNX Software Systems GmbH & Co. KG.

Binary Required
cam-cdrom.so For CD-ROM access
cam-disk.so For hard-disk access
libcam.so Always

Exit status:
The devb-eide driver terminates only if an error occurs during startup, or if it has
successfully forked itself upon startup because it hadn’t been initially started in the
background.

0 The devb-eide driver wasn’t started in the background and therefore forked
itself. The original process terminated with a zero exit status, the forked
process continued.

>0 An error occurred during startup.

Caveats:
Unless overridden with the blk automount= option (see io-blk.so), devices are
mounted as:

Device Mountpoint Filesystem type


/dev/hd0t77 /hd qnx4
/dev/cd0 /cd cd
/dev/hd0t6 /dos dos
/dev/hd0t11 /dos dos

While there’s no limit to the size of a disk or partition, I/O (i.e. the lseek(), read(), and
write() functions) is currently limited to 2 gigabytes per partition (or disk). This I/O
limit has no effect on the partition size for mounted filesystems.
Known supported functions include:

chmod(), chown(), close(), closedir(), creat(), devctl(), dup(), dup2(),


fcntl(), fpathconf(), fstat(), lseek(), mkdir(), mkfifo(), mknod(), open(),
opendir(), pathconf(), read(), readdir(), readlink(), rewinddir(), rmdir(),
stat(), symlink(), unlink() (not supported for directories), utime(), write()

Note that certain calls (such as pipe(), as well as read() and write() on FIFOs) may
require the pipe manager.

198 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devb-eide

See also:
cam-*, devb-*, fs-*, io-blk.so
Controlling How Neutrino Starts and Connecting Hardware chapters, and
“Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter of the QNX Neutrino User’s Guide

June 22, 2010 Utilities 199


devb-fdc © 2010, QNX Software Systems GmbH & Co. KG.
Driver for floppy disk interface (QNX Neutrino)

You must be root to start this driver.

Syntax:
devb-fdc [cam option[,option]...]
[disk option[,option]...]
[fdc option[,option]...]
[blk option[,option]...] &

Runs on:
Neutrino

Targets:
x86

Options:
Use commas (,) to separate the options. You can put the cam, disk, fdc, and blk
groups of options in any order.

cam options
quiet Be quiet: don’t display any information on startup.

verbose Be verbose.

disk options
The disk options control the driver’s interface to cam-disk.so. If specified, they
must follow the disk keyword.

fdc options
The fdc options control the driver’s interface to the fdc controller. If you’ve installed
multiple controllers, you can repeat these options for each controller. Remember,
however, to specify the fdc keyword before each controller’s set of options.

ioport=port The I/O port of the interface. The default is 0x3f0.

irq=req The interrupt used by the controller. The default is 6.

dma=channel Use the specified DMA channel. The default is 2.

200 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devb-fdc

blk options
The blk options control io-blk.so. If specified, they must follow the blk keyword.

Description:
The devb-fdc driver is for the floppy disk interface. It autodetects interfaces at
address 0x3f0, interrupt 6, dma channel 2 by default. If you have an interface at a
different address/interrupt/dma, specify them to the driver using the fdc options.

• The default cache size specified by io-blk.so is excessive for devb-fdc. You’ll
probably want to reduce it to something more reasonable:
devb-fdc blk cache=512k &

• The device enumerator (see enum-devices, as well as “Device enumeration” in


the Controlling How Neutrino Starts chapter of the QNX Neutrino User’s Guide)
doesn’t start devb-fdc by default. If your system has a floppy drive, you can start
the driver manually or uncomment the devb-fdc lines in the
/etc/system/enum/devices/block file.

Examples:
Assume an FDC interface, and list all connected devices:

devb-fdc &

Mount a floppy drive that can access QNX or DOS floppy disks:

devb-fdc blk cache=128k &


mount -tqnx4 /dev/fd0 /qnxflop
mount -tdos /dev/fd0 /dosflop

or:

devb-fdc blk cache=128k,automount=+fd0:/qnxflop:qnx4,\


automount=+fd0:/dosflop:dos &

Files:
The devb-fdc driver causes io-blk.so to adopt various block special devices under
/dev. These devices are normally named fdn, where n is the physical unit number of
the device.
This driver could also require the following shared objects:

June 22, 2010 Utilities 201


devb-fdc © 2010, QNX Software Systems GmbH & Co. KG.

Binary Required
cam-disk.so For floppy-disk access.
libcam.so Always

Exit status:
The devb-fdc driver terminates only if an error occurs during startup, or if it has
successfully forked itself upon startup because it hadn’t been initially started in the
background.

0 The devb-fdc driver wasn’t started in the background and therefore forked
itself. The original process terminated with a zero exit status, the forked
process continued.

>0 An error occurred during startup.

Caveats:
While there’s no limit to the size of a disk or partition, I/O (i.e. the lseek(), read() and
write() functions) is currently limited to 2 gigabytes per partition (or disk). This I/O
limit has no effect on the partition size for mounted filesystems.
Known supported functions include:

chmod(), chown(), close(), closedir(), creat(), devctl(), dup(), dup2(),


fcntl(), fpathconf(), fstat(), lseek(), mkdir(), mkfifo(), mknod(), open(),
opendir(), pathconf(), read(), readdir(), readlink(), rewinddir(), rmdir(),
stat(), symlink(), unlink() (not supported for directories), utime(), write()

Note that certain calls (such as pipe(), as well as read() and write() on FIFOs) may
require the pipe manager.

See also:
cam-*, devb-*, fdformat, fs-*, io-blk.so
Connecting Hardware chapter, and “Filesystems and block I/O (devb-*) drivers” in
the Fine-Tuning Your System chapter of the QNX Neutrino User’s Guide

202 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devb-loopback
Pseudo block driver

In order to start this driver, you must be logged in as root.

Syntax:
devb-loopback [loopback loopback_option[,option]]
[blk option[,option]...] &

Runs on:
Neutrino

Options:
Use commas (,) to separate the options. You can put the blk and loopback groups
of options in any order.

loopback options
fd=path Specify a filename (a path registered by your resource manager) to
be presented as a block device by devb-loopback. This
pathname must support open(), close(), read(), write(), and fstat();
for more information, see “Driver support,” below.
Each pathname will result in the creation of a corresponding
block-special device (see prefix= below), the content of which
will be mirrored over the file descriptor using standard read/write
calls. You can then mount traditional block filesystems (such as
fs-dos.so and fs-qnx4.so) on top of these pseudo devices and
use them transparently.
You can specify multiple fd= pathnames; they’re managed by a
single devb-loopback process.

prefix=name The name by which the loopback pseudo block devices are
registered. The default is lo; thus each fd= entry named on the
command line will appear as /dev/lo0, /dev/lo1, and so on.
This is a global option, and applies to all fd= instances.
rw, ro Set the reading mode with which to open the underlying file
descriptor (corresponds to O_RDWR or O_RDONLY). If you
specify read-only, then in turn you can mount only read-only
filesystems onto the corresponding devb-loopback device (the
pseudo-device is advertised up as DEV_RDONLY). The default is
rw. This option applies to all subsequent instances of fd=.

sync, async Set the synchronous write mode with which to open the underlying
file descriptor (corresponds to O_SYNC). The effect of this
depends on the resource manager responsible for each file
(typically it’s ignored).

June 22, 2010 Utilities 203


devb-loopback © 2010, QNX Software Systems GmbH & Co. KG.

This option affects writes that are presented to the pseudo-device, and not the write
behavior of any mounted filesystems above this (that can be controlled via mount
options or blk delwri=... commit=...).
The default is sync.
denyno, denyrd, denywr, denyrw
The SH_DENY mode with which to open the underlying file
descriptor. A deny mode stops other processes from opening the
host file, thus preventing the content of it from being changed
behind the back of the devb-loopback filesystems, which will
prevent coherence issues. The default is denyrw. This option
applies to all subsequent instances of fd=.

seek, xtype Configure I/O onto the file descriptor using either an
LSEEK+READ combined message or via a
READ+XTYPE_OFFSET composite. By default,
devb-loopback probes the host filesystem as to whether it
supports the pread() and pwrite() API. The default is xtype. This
option applies to all subsequent instances of fd=.

blksz=size Override the device blocksize. This is typically probed from a


stat() or DCMD_CAM_DEVINFO devctl() call onto the resource
manager responsible for each file and the same value advertised
up, but some resource managers don’t advertise a useful blocksize
(in particular, devf-* reports 1-byte blocks).
You might also need this option in some cases where a filesystem
image was originally formatted on a device with a different sector
size to that of the hosting filesystem; it may be necessary for
correct operation or performance reasons to mimic the original
sector size.
This option applies to all subsequent instances of fd=, but you can
reset it to use the probed value with an empty option (e.g.
blksz=2048,fd=/F1,blksz=,fd=/F2).

nio=num The number of asynchronous I/O threads (which are responsible


for executing an internal block device read/write as a normal
read/write over the external file descriptor). This multi-threading is
useful if you’ve specified multiple fd= devices.
The default is 1; you can specify a value of 0 to force all I/O to be
performed synchronously in the context of the filesystem caller; it
can be higher to prevent this I/O from becoming a bottleneck to the
filesystem layers above (appropriate only when multiple fd= paths
have been specified). This is a global option; the pool of threads
services requests to all fd= files in the order of client priority.

204 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devb-loopback

blk options
The blk options are as for io-blk.so. If specified, they must follow the blk
keyword. For more information, see io-blk.so.
Since devb-loopback loads the standard block device DLLs, which will create a
buffer cache using the same default rules as for the disk filesystems, the cache is likely
to be too big for devb-loopback. You can reduce the cache size using blk
cache=size. Depending on the actual size of the device, and the level of caching
already implemented by its driver, a value of 128k may be sufficient.

Description:
The block filesystems in QNX Neutrino are implemented as a series of DLL modules
and a set of internal APIs. Thus it is possible to mount disk-based filesystems (such as
QNX or DOS) only onto released QNX devb-* drivers. The devb-loopback driver
implements a mapping between an arbitrary file descriptor and the block API,
allowing any resource manager to be used to host a disk filesystem.
Internal function calls, normally targeted at a SCSI/CAM driver, are translated into
standard read() and write() calls onto the host file descriptor, and are used to populate
the data content of a pseudo block device, which appears to the system as a disk.
Within this framework, any resource-manager or file-descriptor object can be viewed
as a block-special device and be mounted as a disk filesystem. For example, you can’t
normally directly use an ISO9660 image stored on a devf-* device, because devf-*
doesn’t load fs-*.so modules; by using devb-loopback to present this image file
as a block device, you can then mount it using fs-cd.so. For example:
devb-loopback fd=/devf/iso blk automount=lo0:/fs/iso:cd

This results in the following arrangement:

devb-loopback

/devf/iso /dev/lo1

User io-blk.so
resource
manager
(e.g. devf-*) /fs/iso User
applications

fs-cd.so

Other uses might be to mount images from /dev/shmem, an image filesystem (IFS),
or over NFS.
The host file needs to be pregrown. For example, assuming that /fs/flash is a
mounted devf filesystem, you’d have to do the following setup first:

June 22, 2010 Utilities 205


devb-loopback © 2010, QNX Software Systems GmbH & Co. KG.

touch /fs/flash/q4.img
dinit -hq -S32m /fs/flash/q4.img

You could then use that file on flash as a read-write fs-qnx4.so filesystem:
devb-loopback blk cache=128k,auto=none loopback fd=/fs/flash/q4.img
mount -tqnx4 /dev/lo0 /q4flash

Using devb-loopback in this case adds functionality that a disk filesystem format
offers (access times, hard links, etc.) to the devf-* filesystem. In other cases,
devb-loopback lets you use the caching (e.g. names and sectors) that io-blk.so
supports, but that the resource manager underlying the host file might not.

Driver support
The resource manager(s) implementing the pathnames specified by fd= operands must
support the following standard interfaces:

open(), close() The device must be able to open and close a file descriptor to it.
The O_RDONLY and O_RDWR modes should be supported, as
should the SH_DENY share flags and O_SYNC modifier (if those
options are used from the devb-loopback command line); the
default libc iofunc open handler is suitable.
fstat() The device must support a stat method, which is used to
determine the size and geometry of the underlying device. The
default libc iofunc handler is suitable, provided there’s an
associated iofunc_mount_t which sets a suitable “blocksize”
(the default is 1 byte, which isn’t appropriate for use as a block
device; it must be one of 512, 1024, 2048, or 4096). See also
devctl() (below) and the loopback blksz= option (above).
read(), write() The device must support read and write callouts, which are used to
transfer “disk blocks” between the device and the filesystem buffer
cache. I/O is in units of the advertised block size and within the
bounds of the advertised device size. If the device supports the
_IO_XTYPE_OFFSET modifier (corresponding to pread() and
pwrite()), then that interface is used; otherwise a combined seek
plus normal read/write is made.
lseek() If _IO_XTYPE_OFFSET isn’t supported (above), then the device
must implement an lseek method. The default libc iofunc
callout is suitable.
devctl() The device may optionally implement the DCMD_CAM_DEVINFO
devctl() command (refer to the <sys/dcmd_cam.h> and
<sys/cam_device.h> header files). This allows the device to set
certain low-level fields to fine-tune emulation behavior. The
DCMD_ALL_GETFLAGS command is also used to probe the status
of a (removable) file descriptor. However, suitable defaults for both
these can be inferred from the fstat() query (above).

206 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devb-loopback

Mounting
You can mount the filesystem image via the loopback device (/dev/lo*) from the
command line with the mount command:

# devb-loopback blk cache=256k,vnode=128 \


loopback ro,blksz=2048,fd=/mnt/EFS/tts.iso &
# mount -r -tcd /dev/lo0 /mnt/tts

or via the blk automount= option:

# devb-loopback blk cache=256k,vnode=128,automount=lo0:/mnt/tts:cd \


loopback ro,blksz=2048,fd=/mnt/EFS/tts.iso &

You can use umount to unmount the filesystem. The file descriptors to the underlying
host image files aren’t closed, and /dev/lo* remain present, until devb-loopback
is terminated.

See also:
cam-*, devb-*, fs-*, io-blk.so, mount, umount
close(), devctl() fstat(). open(), pread() pwrite() read(), stat() write() in the QNX
Neutrino Library Reference
Writing a Resource Manager

June 22, 2010 Utilities 207


devb-mvSata © 2010, QNX Software Systems GmbH & Co. KG.
Driver for Marvell 88SX50XX SATA interfaces (QNX Neutrino)

You must be root to start this driver.

Syntax:
devb-mvSata [cam option[,option]...]
[mvSata option[,option]...]
[blk option[,option]...] &

Runs on:
QNX Neutrino

Options:
Use commas (,) to separate the options. You can put the cam, mvSata, and blk
groups of options in any order.

cam options
lun=mask Enable Logical Unit Number (LUN) scan for the devices specified in
mask. The mask is a hex bitmask specifying which IDs to scan for; the
default is 0x00.

quiet Be quiet: don’t display any information on startup.

verbose Be verbose: display full information about SCSI units (devices) on


startup.

mvSata options
The mvSata options control the driver’s interface to the mvSata controller. If you’ve
installed multiple controllers, you can repeat these options for each controller.
Remember, however, to specify the mvSata keyword before each controller’s set of
options.
Interface-specific options:

irq=req The interrupt used by the controller.

vid=vid The vendor ID of the controller.

did=did The device ID of the controller.

pci=index The PCI index of the controller in the machine, where index is
a value between 0 and the number of adapters.

nobmstr Don’t use busmastering.

port=N ,device Specify options for device on port N.

208 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devb-mvSata

priority=prio Set the priority of the processing thread. The default is 21.
timeout=timeout Set the I/O request timeout, in seconds. The default is 10.

cache_line=size Set the PCI cache line size (16, 32, 64, or 128 bytes). Default
pci config.

Device-specific options:

geometry=heads:cyl:sect
Specify the drive geometry.

nobmstr Don’t use busmastering.

multiblk=blks Set multiblock mode, specifying the number of blocks per


interrupt.

nonremovable Report the device as being nonremovable.

chs Use Cylinder-Head-Sector mode. The default is LBA.

blk options
The blk options control io-blk.so. If specified, they must follow the blk keyword.

Description:
The devb-mvSata driver is for Marvell 88SX50XX SATA interfaces. It supports
vendor ID 0x11ab with at least the following device IDs:

Device ID Chipset
5080 88SX5080
5081 88SX5081
5040 88SX5040
5041 88SX5041
6081 88SX6081
6041 88SX6041

Due to a chipset limitation, CD-ROM and DVD-ROM drives aren’t supported.

Examples:
Detect all SATA controllers, and list all connected devices:

devb-mvSata &

June 22, 2010 Utilities 209


devb-mvSata © 2010, QNX Software Systems GmbH & Co. KG.

Files:
The devb-mvSata driver causes io-blk.so to adopt various block special devices
under /dev. These devices are normally named hdn, where n is the physical unit
number of the device.
This driver could also require the following shared objects:

Binary Required
cam-disk.so For hard-disk access.
libcam.so Always

Exit status:
The devb-mvSata driver terminates only if an error occurs during startup, or if it has
successfully forked itself upon startup because it hadn’t been initially started in the
background.

0 The devb-mvSata driver wasn’t started in the background and therefore


forked itself. The original process terminated with a zero exit status, the
forked process continued.

>0 An error occurred during startup.

Caveats:
Unless overridden with the blk automount= option (see io-blk.so), devices are
mounted as:

Device Mountpoint Filesystem type


/dev/hd0t77 /hd qnx4
/dev/hd0t6 /dos dos
/dev/hd0t11 /dos dos

While there’s no limit to the size of a disk or partition, I/O (i.e. the lseek(), read() and
write() functions) is currently limited to 2 gigabytes per partition (or disk). This I/O
limit has no effect on the partition size for mounted filesystems.
Known supported functions include:

chmod(), chown(), close(), closedir(), creat(), devctl(), dup(), dup2(),


fcntl(), fpathconf(), fstat(), lseek(), mkdir(), mkfifo(), mknod(), open(),
opendir(), pathconf(), read(), readdir(), readlink(), rewinddir(), rmdir(),
stat(), symlink(), unlink() (not supported for directories), utime(), write()

210 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devb-mvSata

Note that certain calls (such as pipe(), as well as read() and write() on FIFOs) may
require the pipe manager.

See also:
cam-*, devb-*, fs-*, io-blk.so
“Filesystems and block I/O (devb-*) drivers” in the Fine-Tuning Your System
chapter of the QNX Neutrino User’s Guide

June 22, 2010 Utilities 211


devb-ram © 2010, QNX Software Systems GmbH & Co. KG.
Driver for RAM disk interface (QNX Neutrino)

You must be root to start this driver.

Syntax:
devb-ram [cam option[,option]...]
[disk option[,option]...]
[ram option[,option]...]
[blk option[,option]...] &

Runs on:
Neutrino

Options:
Use commas (,) to separate the options. You can put the cam, disk, ram, and blk
groups of options in any order.

cam options
quiet Be quiet: don’t display any information on startup.

verbose Be verbose.

disk options
The disk options control the driver’s interface to cam-disk.so. If specified, they
must follow the disk keyword. For more information, see cam-disk.so.

ram options
The ram options control the driver’s interface to RAM:

address=addr The physical address to overlay. The default is not to overlay.

blksize=size Set the sector size. The default is 512 bytes.

capacity=blocks Specify the capacity of the RAM drive in the blocks of the size
specified by the blksize option. The default is 4096 blocks (2
MB).

nodinit Don’t partition the RAM disk or format a QNX 4 filesystem on


it.

blk options
The blk options control io-blk.so. These options must follow the blk keyword
and must be specified after any general or disk options. For more information, see
io-blk.so.

212 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devb-ram

Description:
The devb-ram driver creates a RAM disk interface. When the capacity option isn’t
specified, devb-ram creates a 2 MB RAM disk.
By default, devb-ram partitions the RAM disk, leaving one block for the partition
table itself, and making the remainder of the RAM disk (capacity minus 1) a t77
partition, which it then initializes (internally, not by spawning dinit) to have a blank
fs-qnx4.so filesystem on it. If you specify the nodinit option, you can later
manually format it, optionally partition the RAM disk with fdisk (but you can make
the whole thing a filesystem), and then mount it.

By default, io-blk.so allocates 15% of system RAM for cache. The devb-ram
system looks like a disk drive to io-blk.so, so it doesn’t know that the cache is
unnecessary. You should use the blk cache=512k option to reduce the cache size to
the minimum.

Because devb-ram is a block device which reads from and writes to RAM, its
operations go through a lot of layers before they actually get to RAM. For a RAM disk
with better performance, use the blk ramdisk=... option to io-blk.so. For more
information, see “RAM disks” in the Connecting Hardware chapter of the QNX
Neutrino User’s Guide.

Examples:
Create a 4 MB RAM drive:

devb-ram ram capacity=8192 &

Files:
The devb-ram driver causes io-blk.so to adopt various block special devices under
/dev. These devices are normally named hdn, where n is the physical unit number of
the device.
This driver could also require the following shared objects:

Binary Required
cam-disk.so For RAM disk access.
libcam.so Always

Exit status:
The devb-ram driver terminates only if an error occurs during startup, or if it has
successfully forked itself upon startup because it hadn’t been initially started in the
background.

June 22, 2010 Utilities 213


devb-ram © 2010, QNX Software Systems GmbH & Co. KG.

0 The devb-ram driver wasn’t started in the background and therefore forked
itself. The original process terminated with a zero exit status, the forked
process continued.

>0 An error occurred during startup.

Caveats:
While there’s no limit to the size of a disk or partition, I/O (i.e. the lseek(), read() and
write() functions) is currently limited to 2 gigabytes per partition (or disk). This I/O
limit has no effect on the partition size for mounted filesystems.
Known supported functions include:

chmod(), chown(), close(), closedir(), creat(), devctl(), dup(), dup2(),


fcntl(), fpathconf(), fstat(), lseek(), mkdir(), mkfifo(), mknod(), open(),
opendir(), pathconf(), read(), readdir(), readlink(), rewinddir(), rmdir(),
stat(), symlink(), unlink() (not supported for directories), utime(), write()

Note that certain calls (such as pipe(), as well as read() and write() on FIFOs) may
require the pipe manager.

See also:
cam-*, devb-*, dinit, fdisk, fs-*, io-blk.so
“RAM disks” in the Connecting Hardware chapter, and “Filesystems and block I/O
(devb-*) drivers” in the Fine-Tuning Your System chapter of the QNX Neutrino
User’s Guide

214 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devb-umass
Driver for USB Mass Storage interface

In order to start this driver, you must be logged in as root, and the USB stack
(io-usb) needs to be running.

Syntax:
devb-umass [blk option[,option]...]
[cam option[,option]...]
[umass options[,option]...]

Runs on:
Neutrino

Options:
Use commas (,) to separate the options. You can put the blk, cam, and umass groups
of options in any order.

cam options
quiet Be quiet: don’t display any information on startup.
verbose Be verbose: display full information about units (devices) on startup.
pnp Enable CAM plug and play (i.e. don’t exit at startup when no devices
are found). The default is off.

umass options
The umass options control the driver’s interface to the USB device. If you’ve installed
multiple devices, you can repeat these options for each device. Remember, however, to
specify the umass keyword before each controller’s set of options.

path=name Connect to the specified USB stack. The default is


/dev/io-usb/io-usb.

wait=num Wait num of seconds for the USB stack. The default is 60
seconds.
vid=vid The vendor ID of the device.
did=did The device ID of the device.
busno=bus The bus number of the USB controller.
devno=dev The USB address of the device.
iface=if The particular interface number of the device.
priority=prio Set the priority of the processing thread. The default is 21.
ignore_csw Ignore the Command Status Wrapper. Some devices return
invalid data for the CSW.

June 22, 2010 Utilities 215


devb-umass © 2010, QNX Software Systems GmbH & Co. KG.

blk options
The blk options control io-blk.so. If specified, they must follow the blk keyword.
For more information, see io-blk.so.

Description:
The devb-umass driver is the driver for a USB mass storage interface.

Examples:
Assume a USB controller, and list all connected devices:

devb-umass &

Assume a USB controller, and list/wait for all connected devices:

devb-umass cam pnp &

See also:
cam-*, devb-*, enum-usb, fs-*, io-blk.so, io-usb
Connecting Hardware chapter, and “Filesystems and block I/O (devb-*) drivers” in
the Fine-Tuning Your System chapter of the QNX Neutrino User’s Guide

216 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devc-con, devc-con-hid
Simple VGA console and keyboard I/O manager (QNX Neutrino)

You must be root to start this manager.

Syntax:
devc-con [options] &

devc-con-hid [options] &

Runs on:
Neutrino

Targets:
x86

Options:
-C size Specify the size of the canonical buffer in bytes (default 256).

-E Start in raw mode.

-e Start in edited mode (the default).

-h (devc-con-hid only) Don’t connect to the io-hid server; read


from the keyboard controller instead.

-I size Specify the size of the interrupt input buffer in bytes (default
2048).

-k (devc-con and devc-con-hid only) Disable keyboard (don’t


attach a keyboard interrupt handler).

-L [P][N][C][S] Set the initial state of the keyboard and its LEDs (default all off):
• C — turn CapsLock on.
• P — preserve the keyboard state. This overrides all the other
-L options.
• N — turn NumLock on.
• S — turn ScrollLock on.

-n num_ports (devc-con and devc-con-hid only) The number of virtual


console ports to create. The default is 4; the maximum is 9.

-O size Specify the size of the interrupt output buffer in bytes (default
2048).

-o nodaemon Don’t call procmgr_daemon() to make the driver run in the


background. Use this option if you need to know when the
devc-con or devc-con-hid device terminates.

June 22, 2010 Utilities 217


devc-con, devc-con-hid © 2010, QNX Software Systems GmbH & Co. KG.

-r rate[,delay] Specify the initial keyboard typematic rate (in Hz) and, optionally,
the initial keyboard delay (in ms). The default values are 30 Hz
and 500 ms.
The keyboard typematic rate is the number of times per second
that a depressed key repeats. On a PC/AT-compatible system, this
ranges from 2 - 30 characters per second. If the option -r 0 is
specified, the keyboard typematic rate isn’t set by the driver.
The keyboard delay is defined as the time from when a key is first
pressed to when the start of the first repeated key is generated. On
a PC/AT-compatible system, the keyboard delay can range from
250 - 1000 milliseconds.

Description:
The devc-con manager provides an interface to the VGA console screen and
keyboard. It’s usually started as a system startup procedure (see diskboot).

For serial ports, use the appropriate devc-ser* manager.

When devc-con starts, it creates and manages the devices /dev/con1, /dev/con2,
and so on, up to the number of ports specified by the -n option.
The devc-con-hid manager is similar to devc-con, but works in conjunction with
io-hid and supports PS2, USB, and all other human-interface devices.

The devc-con-hid manager was added in QNX Momentics 6.3.0 Service Pack 3;
diskboot starts it instead of devc-con.

If you read from /dev/console, these managers return the characters typed on the
keyboard; if you write to /dev/console, the managers write to the screen.

If your application uses /dev/console, you should create a link from it to one of
/dev/con1, /dev/con2, . . . by adding a line like this to the buildfile used by mkifs:

[type=link] /dev/console = /dev/con1

The devc-con and devc-con-hid managers all emulate an 80×25 ANSI terminal.

Keyboard control
You can use the keyboard to switch between virtual consoles.
Each virtual console can run different applications that use the entire screen. The
keyboard is attached to the virtual console that’s currently visible. You can switch
from one virtual console to another — and thus from one application to another — by
entering the following keychords:

218 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devc-con, devc-con-hid

If you want to see: Press:


The next active console Ctrl-Alt-Enter or Ctrl-Alt-+ (plus)
The previous active console Ctrl-Alt-- (minus)

The + (plus) and - (minus) keys used in the console-switching keychords are those
found on the numeric keypad.

You can also jump to a specific console by using the Ctrl-Alt-n, where n is a numeric
digit that represents the console number of a virtual console. For instance:

If you want to see: Press:


/dev/con1 Ctrl-Alt-1
/dev/con2 (if available) Ctrl-Alt-2
.. ..
. .
/dev/con10 (if available) Ctrl-Alt-0

Character sets
The devc-con and devc-con-hid managers let you choose the character sets in use
from a “palette” of character sets, each of which is independently programmable to
contain one of several builtin character sets.
The in-use range of characters is divided into four regions which span character
numbers (in hexadecimal) 0x00 through 0xff. Two of these regions are fixed sets of
control characters, while the other two are configurable to contain a choice of
character sets:

Hex: Name: May be set to one of:


0x00-0x1f C0 (Control Zero) Not configurable
0x20-0x7f GL (Graphics Left) G0, G1, G2, G3
0x80-0x9f C1 (Control One) Not configurable
0xa0-0xff GR (Graphics Right) G1, G2, G3

You can set each of the GL and GR in-use character sets to a choice of several
character sets from the G0, G1, G2 and G3 character sets.
The screen control codes to set GL and GR are as follows:

June 22, 2010 Utilities 219


devc-con, devc-con-hid © 2010, QNX Software Systems GmbH & Co. KG.

To set: To: Use:


GL G0 {LS0} = {SI} (0f)
GL G1 {LS1} = {SO} (0e)
GL G2 {LS2} = {ESC n} (1b 6e) or {SS2} (8e)
GL G3 {LS3} = {ESC o} (1b 6f) or {SS3} (8f)
GR G1 {LS1R}= {ESC ˜} (1b 7e)
GR G2 {LS2R}= {ESC }} (1b 7d)
GR G3 {LS3R}= {ESC |} (1b 7c)

The {LS*} codes stand for “Locking Shift”. When character sets are selected by these
means, they remain in effect until another {LS*} code is sent.
The {SS*} codes stand for “Single Shift” and affect the next character only. After that
character, the character set in effect reverts to its previous setting. There are only two
{SS*} codes, {SS2} and {SS3} which maps G2 into GL and G3 into GL, respectively.
The G0 through G3 characters sets may each be set to any of the available builtin fonts.
The control code to do this is:

ESC g s

Where:

g: Sets:
( G0
) G1
* G2
+ G3

And:

s: Specifies:
B ASCII
0 Special (DEC Graphic)
< ISO-Latin1 Supplemental
U PC Character Set

220 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devc-con, devc-con-hid

Character set defaults

The in-use character sets are as follows:

In-use char set: Defaults to:


GR G2
GL G0

The character set codes are as follows:

Char set: Defaults to:


G0 ASCII charset
G1 Special charset (DEC Graphic)
G2 Supplemental charset (ISO-Latin 1)
G3 Special charset (DEC Graphic)

Character set example:

Set the GL in-service character set (0x20-0x7f) to the PC character set through G1,
write some characters, then switch GL back to G0:

{ESC )U} 1e 29 55 (Set G1 to be the PC character set)


{SO} 0e (Set GL to G1)
.
. (Write chars in PC graphics char set)
.
{SI} 0f (Set GL to G0)

June 22, 2010 Utilities 221


devc-con, devc-con-hid © 2010, QNX Software Systems GmbH & Co. KG.

The PC character set 0x00-0x7f.

222 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devc-con, devc-con-hid

The PC character set 0x80-0xff.

June 22, 2010 Utilities 223


devc-con, devc-con-hid © 2010, QNX Software Systems GmbH & Co. KG.

ANSI screen control codes


Note the following abbreviations used in the tables:

(220+) A VT220 Level 2 function

(NA) Not ANSI standard

(NI) Not implemented

(NFI) Not fully implemented

C0 control codes

The C0 control codes are as follows:

ASCII ANSI Mnemonic Hex Action


{NUL} 00 Null
{BEL} 07 Bell
{BS} 08 Back Space (VT100 defaults to no wrap
from left margin)
{HT} 09 Horizontal Tab (VT100 defaults to no
autowrap)
{LF} 0A Linefeed or Newline
{VT} 0B Same as LF
{FF} 0C Clears Screen (QNX Extension)
{CR} 0D Move cursor to left margin
{SO} {LS1} 0E GL is set to G1
{SI} {LS0} 0F GL is set to G0 (default)
{XON} {DC1} 11 XON
{XOFF} {DC0} 13 XOFF
{CAN} 18 Cancels ESC sequence
{SUB} 1A Cancels ESC sequence and prints ?
{ESC} 1B Start of ESC sequence
{DEL} 7F Ignored on output

224 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devc-con, devc-con-hid

ESC control sequences

The ESC control sequence codes are as follows:

String Hex Action


{ESC 7} 1B 37 Save cursor
{ESC 8} 1B 38 Restore cursor
{ESC =} 1B 3D Set application keypad mode
{ESC >} 1B 3E Set numeric keypad mode (default)
{ESC D} 1B 44 7-bit codes for {IND} (84)
{ESC E} 1B 45 7-bit codes for {NEL} (85)
{ESC H} 1B 48 7-bit codes for {HTS} (88)
{ESC M} 1B 4D 7-bit codes for {RI} (8D)
{ESC N} 1B 4E 7-bit codes for {SS2} (8E)
{ESC O} 1B 4F 7-bit codes for {SS3} (8F)
{ESC P} 1B 50 7-bit codes for {DCS} (90)
{ESC [} 1B 5B 7-bit codes for {CSI} (9B)
{ESC \} 1B 5C 7-bit codes for {ST} (9C)
{ESC ]} 1B 5D 7-bit codes for {OSC} (9D)
{ESC ˆ} 1B 5E 7-bit codes for {PM} (9E)
{ESC _} 1B 5F 7-bit codes for {APC} (9F)
{ESC Z} 1B 5A Identify terminal
{ESC c} 1B 63 Hard Reset (clears screen) (use {CSI ! P} for soft
reset)
{ESC n} 1B 6E (LS2) GL is set to G2 (220+)
{ESC o} 1B 6F (LS3) GL is set to G3 (220+)
{ESC |} 1B 7C (LS3R) GR is set to G3 (220+)
{ESC }} 1B 7D (LS2R) GR is set to G2 (220+) (default)
{ESC ˜} 1B 7E (LS1R) GR is set to G1
{ESC sp F} 1B 20 46 Keyboard generates 7-bit C1 codes (incl. CSI) (default)
{ESC sp G} 1B 20 47 Keyboard generates 8-bit C1 codes (incl. CSI) (220+)
{ESC ( 0} 1B 28 30 Set G0 to special charset

continued. . .

June 22, 2010 Utilities 225


devc-con, devc-con-hid © 2010, QNX Software Systems GmbH & Co. KG.

String Hex Action


{ESC ( <} 1B 28 3C Set G0 to supplemental charset
{ESC ( A} 1B 28 41 Set G0 to U.K. charset (Not implemented; same as
ASCII)
{ESC ( B} 1B 28 42 Set G0 to ASCII charset (default)
{ESC ( U} 1B 28 55 Set G0 to PCterm graphics
{ESC ) 0} 1B 29 30 Set G1 to special charset (default)
{ESC ) <} 1B 29 3C Set G1 to supplemental charset
{ESC ) A} 1B 29 41 Set G1 to U.K. charset (NI; same as ASCII)
{ESC ) B} 1B 29 42 Set G1 to ASCII charset
{ESC ) U} 1B 29 55 Set G1 to PCterm graphics
{ESC * 0} 1B 2A 30 Set G2 to special charset (220+)
{ESC * <} 1B 2A 3C Set G2 to supplemental charset (220+) (default)
{ESC * B} 1B 2A 42 Set G2 to ASCII charset (220+)
{ESC * U} 1B 2A 55 Set G2 to PCterm graphics
{ESC + 0} 1B 2B 30 Set G3 to special charset (220+) (default)
{ESC + <} 1B 2B 3C Set G3 to supplemental charset (220+)
{ESC + B} 1B 2B 42 Set G3 to ASCII charset (220+)
{ESC + U} 1B 2B 55 Set G3 to PCterm graphics

C1 control characters (220+)

You can do any 8-bit C1 code with 7-bit ESC followed by the 8-bit code minus 0x40
hex. For instance, you can represent the CSI (control sequence introducer) in 8-bit
mode as 0x9b, while in 7-bit mode you must express it as ESC [ (0x1b 0x5b).

The C1 control character codes are as follows:

ASCII Hex Action


{IND} 84 Move cursor down with scroll
{NEL} 85 Move to left margin on next line with scroll
{HTS} 88 Set horizontal tab

continued. . .

226 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devc-con, devc-con-hid

ASCII Hex Action


{RI} 8D Move cursor up with scroll
{SS2} 8E GL is set to G2 for 1 character
{SS3} 8F GL is set to G3 for 1 character
{DCS} 90 Start of Device control string
{CSI} 9B Control sequence introducer
{ST} 9C End of Device control string
{OSC} 9D Operating System Command
{PM} 9E Privacy Message
{APC} 9F Application Program Command

CSI control sequences

In 7-bit mode, CSI is ESC [. In 8-bit mode, CSI is (hex)0x9B. Use the ANSI
specification to represent the variable n, e.g. to print two spaces:
printf( "%c%c", 0x9b, 0x32 ) ;

The CSI control sequence codes are as follows:

ASCII Hex Action


{CSI [n] @} 9B [n] 40 Insert n spaces at cursor (default = 1
space)
{CSI [n] A} 9B [n] 41 Cursor up n rows, no wrap (default =
1 row)
{CSI [n] B} 9B [n] 42 Cursor down n rows, no wrap
(default = 1 row)
{CSI [n] C} 9B [n] 43 Cursor right n columns, no wrap
(default = 1 column)
{CSI [n] D} 9B [n] 44 Cursor left n columns, no wrap
(default = 1 column)
{CSI [n] F} 9B [n] 46 Cursor up n rows, positioned in first
column (default = 1 row)
{CSI [n] G} 9B [n] 47 Move cursor to column n (default =
column 1)

continued. . .

June 22, 2010 Utilities 227


devc-con, devc-con-hid © 2010, QNX Software Systems GmbH & Co. KG.

ASCII Hex Action


{CSI [r[;c]] H} 9B [r [3B c]] 48 Cursor position (default = row 1;
column 1)
{CSI [n] J} 9B [n] 4A Erase 0=cur-EOS 1=HOME-cur
2=screen (default = 0 (to end of
screen))
{CSI [n] K} 9B [n] 4B Erase 0=cur-EOL 1=BOL-cur 2=line
(default = 0 (to end of line))
{CSI [n] L} 9B [n] 4C Insert n lines (default = 1 line)
{CSI [n] M} 9B [n] 4D Delete n lines (default = 1 line)
{CSI [n] P} 9B [n] 50 Delete n chars (default = 1 char)
{CSI [n] S} 9B [n] 53 Scroll forward n lines (default = 1
line)
{CSI [n] T} 9B [n] 54 Scroll backward n lines (default = 1
line)
{CSI [n] X} 9B [n] 58 Erase cur for n-1 chars (default = 1
(0 chars))
{CSI Z} (9B 5A) Back tab
{c CSI [n] b} c 9B [n] 62 Repeat GR or GL character c, n
times. c is the last displayable
character; n defaults to 1 time.
{CSI 0 c} (9B 30 63) Primary device attrib request
{CSI [n] d} 9B [n] 64 Move cursor to line n (default = line
1)
{CSI [n] g} 9B [n] 67 Tab clear 0=cursor 2=all (default =
0)
{CSI [n[;n]...] h} 9B [n[3B n]...] 68 Standard Set mode (See modes
table) (default=none)
{CSI ? [n[;n]...] h} 9B 3F [n[3B n]...] 68 Private Set mode (See modes table)
(default=none)
{CSI [n[;n]...] l} 9B [n[3B n]...] 6C Standard Reset mode (See modes
table) (default=none)
{CSI ? [n[;n]...] l} 9B 3F [n[3B n]...] 6C Private Reset mode (See modes
table) (default=none)
{CSI [n[;n]...] m} 9B [n[3B n]...] 6D Select Graphic Rendition (See
below) (default = 0)

continued. . .

228 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devc-con, devc-con-hid

ASCII Hex Action


{CSI n n} 9B n 6E Device status 5=status 6=cursor/pos
{CSI [r[;c]] r} 9B [r [3B c]] 72 Set scroll region and home cursor
{CSI r} 9B 72 Disable scroll region & home cursor
{CSI s} 9B 73 Save cursor
{CSI u} 9B 75 Restore cursor
{CSI ! p} 9B 21 70 Soft reset
{CSI [n[;n]] ]} 9B [n [3B n]...] 5D Set default 1=underline
2=half-intensity 8=colorset
(default=none)
{CSI = [f [;d]] B} 9B 3D [f [3B d]] 46 Set frequency(Hz) and duration (ms)
for bell (default=100Hz, 250ms)
{CSI = [n] F} 9B 3D [n] 46 Set and Save foreground color
{CSI = [n] G} 9B 3D [n] 47 Set and Save background color

Graphic rendition

The graphic rendition codes are as follows:

Number Meaning
0 All attributes off (except charset (10, 11, 12))
1 Bold
2 Half intensity (default to cyan on color screen)
4 Underline (default to red on color screen)
5 Blink
7 Reverse
9 Invisible
10 Exit alternate char set (GR & GL are restored)
11 Enter PC-lower char set (GR & GL are ASCII; C0 & C1 are PC_LO
except for ESC)
12 Enter PC-higher char set (GR, C1 & GL, C0 are PC_HI except for ESC)
21 Normal intensity (un-Bold)
22 Normal intensity (un-Half intensity)

continued. . .

June 22, 2010 Utilities 229


devc-con, devc-con-hid © 2010, QNX Software Systems GmbH & Co. KG.

Number Meaning
24 Disable underline
25 Disable blink
27 Disable reverse
29 Visible
30-37 Set foreground color (30+color_number, see below)
39 Set foreground to saved
40-47 Set background color (40+color_number, see below)
49 Set background to saved

Color numbers

The color codes are as follows:

color_number Description
0 Black
1 Red
2 Green
3 Brown
4 Blue
5 Violet
6 Cyan
7 White

Modes

Modes are as follows:

Mode string Description


?1h cursor key = Application
?1l cursor key = ANSI (default)
?3h 132 column (Not Implemented)

continued. . .

230 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devc-con, devc-con-hid

Mode string Description


?3l 80 column (default)
?5h Reverse screen
?5l Not Reverse screen (default)
?6h Origin mode
?6l Absolute mode
?7h Auto wrap on
?7l Auto wrap off (default)
?25h Visible cursor (default)
?25l Invisible cursor
?45h Reverse wrap-around mode
?45l No reverse wrap-around
?66h keypad = Application
?66l keypad = ANSI
?67h Backspace key generates BS
?67l Backspace key generates DEL

Mapping from QNX keyboard to ANSI keys


The ANSI key mapping codes are as follows:

Key Normal Shift Ctrl Alt


Enter CR CR CR CR
Tab TAB CSI Z CSI z
BS BS RUB RUB BS
ESC ESC ESC ESC ESC
F1 SS3 P SS3 p CSI 1˜ CSI 17˜
F2 SS3 Q SS3 q CSI 2˜ CSI 18˜
F3 SS3 R SS3 r CSI 3˜ CSI 19˜
F4 SS3 S SS3 s CSI 4˜ CSI 20˜
F5 SS3 T SS3 t CSI 5˜ CSI 21˜
F6 SS3 U SS3 u CSI 6˜ CSI 22˜

continued. . .

June 22, 2010 Utilities 231


devc-con, devc-con-hid © 2010, QNX Software Systems GmbH & Co. KG.

Key Normal Shift Ctrl Alt


F7 SS3 V SS3 v CSI 7˜ CSI 23˜
F8 SS3 W SS3 w CSI 8˜ CSI 24˜
F9 SS3 X SS3 x CSI 9˜ CSI 25˜
F10 SS3 Y SS3 y CSI 10˜ CSI 26˜
F11 SS3 Z SS3 z CSI 11˜ CSI 27˜
F12 SS3 A SS3 a CSI 12˜ CSI 28˜
Home CSI H CSI h CSI H
↑ CSI A CSI a CSI A
PgUp CSI V CSI v CSI V
Minus CSI S CSI s CSI S
← CSI D CSI d CSI D
kpd 5 CSI G CSI g CSI G
→ CSI C CSI c CSI C
Plus CSI T CSI t CSI T
End CSI Y CSI y CSI Y
↓ CSI B CSI b CSI B
PgDn CSI U CSI u CSI U
Ins CSI @ CSI ‘ CSI @
Del CSI P CSI p CSI P
Prt NOP NOP NOP NOP
SysRq NOP NOP NOP NOP
a a A SOH SS2 a
b b B STX SS2 b
c c C ETX SS2 c
d d D EOT SS2 d
e e E ENQ SS2 e
f f F ACK SS2 f
g g G BEL SS2 g
h h H BS SS2 h

continued. . .

232 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devc-con, devc-con-hid

Key Normal Shift Ctrl Alt


i i I HT SS2 i
j j J LF SS2 j
k k K VT SS2 k
l l L FF SS2 l
m m M CR SS2 m
n n N SO SS2 n
o o O SI SS2 o
p p P DLE SS2 p
q q Q DC1 SS2 q
r r R DC2 SS2 r
s s S DC3 SS2 s
t t T DC4 SS2 t
u u U NAK SS2 u
v v V SYN SS2 v
w w W ETB SS2 w
x x X CAN SS2 x
y y Y EM SS2 y
z z Z SUB SS2 z

International keyboard layouts


The devc-con and devc-con-hid managers support international keyboard layouts.
By default, they use the original US-101 layout.
If the file /etc/kbd.tbl is present when you start devc-con or devc-con-hid,
it’s loaded and used instead. You can reload this file at runtime by pressing
Ctrl-Alt-Space. (If you’re using VMWare, you may need to press this twice).

This, like all other key combinations, is subject to configuration! However, it isn’t
possible to redefine compose sequences.

We provide the following layout files, in ${QNX_TARGET}/etc/:

kbd.tbl.de DE-102 (German) layout.

kbd.tbl.us US-101 layout (the default).

June 22, 2010 Utilities 233


devc-con, devc-con-hid © 2010, QNX Software Systems GmbH & Co. KG.

The keyboard-layout file’s structure is very simple and rigid. It must contain either
exactly 5 × 96 or exactly 6 × 96 hexadecimal entries, separated by whitespace,
newlines, or commas:
• If the file contains 5 × 96 entries, the left and right Alt keys are both treated as
regular Alt keys.

• If the file has 6 × 96 entries, the right Alt key is treated as an AltGr key, and the last
96 entries must define key codes for each key with AltGr pressed.

Entries must be no longer than 4 hex digits (16 bits) each. Comments start with a
number sign (#) and extend to the end of the line.
Each run of 96 entries defines the semantics of up to 96 different keys under certain
conditions:

Entries: Define semantics for keys:


000–095 Without any modifiers
096–191 With Shift pressed
192–287 With Ctrl pressed
288–383 With Alt pressed
384–479 With Ctrl-Alt pressed
480–575 With AltGr (right Alt) pressed

The 96 entries in a run are indexed by keyboard scan codes. You’ll need to know those
scan codes in order to make up your own keyboard definition. Given below is the
scancode/symbol-mapping for a US-101 keyboard:
0 1 2 3 4 5 6 7 8 9 A B C D E F
, Esc, ’1’, ’2’, ’3’, ’4’, ’5’, ’6’ ’7’, ’8’, ’9’, ’0’, ’-’, ’=’, Rub, Tab ; 00
’q’, ’w’, ’e’, ’r’, ’t’, ’y’, ’u’, ’i’ ’o’, ’p’, ’[’, ’]’, Ent, Ctl, ’a’, ’s’ ; 10
’d’, ’f’, ’g’, ’h’, ’j’, ’k’, ’l’, ’;’ ’’’, ’’, Shf, ’\’, ’z’, ’x’, ’c’, ’v’ ; 20
’b’, ’n’, ’m’, ’,’, ’.’, ’/’, Rsh, ’*’ Alt, SP, Cap, F1, F2, F3, F4, F5 ; 30
F6, F7, F8, F9, F10, Num, Scr, Hom Up, PgU, K-, Lft, K5, Rig, K+, End ; 40
Dwn, PgD, Ins, Del, , , , F11 F12, , , , , , , ; 50

For every scan code, two bytes of data are given by the entries. The high byte defines a
number of flags for the key (see below), while the low byte usually carries the actual
data to be given to the user when the key is pressed. For Shift, Lock, and special keys,
the low byte carries additional, function-dependent information (see below).
The entries’ high bits are as follows:

• 00 — Data key

• 01 — Function key

• 02 — Shift key:
- 0201 — Shift

234 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devc-con, devc-con-hid

- 0202 — Ctrl
- 0204 — Alt
- 0208 — Rshift

• 04 — NumLock-dependent

• 08 — Lock key:
- 0801 — ScrollLock
- 0802 — NumLock
- 0804 — CapsLock

• 10 — Dead key

• 20 — CapsLock-dependent

• 40 — Special:
- 4001 — reboot (Ctrl-Alt-Del)
- 4002 — debug (Ctrl-Alt-Esc)
- 4003 — next console (Ctrl-Alt-+ or Ctrl-Alt-Enter)
- 4004 — previous console (Ctrl-Alt--)
- 4005 — console 1 (Ctrl-Alt-1)
- 4006 — console 2 (Ctrl-Alt-2)
...
- 400C — console 8 (Ctrl-Alt-8)
- 400D — console 9 (Ctrl-Alt-9)
- 400E — console 10 (Ctrl-Alt-0)
- 400F — increase font size (Ctrl-Alt->)
- 4010 — decrease font size (Ctrl-Alt-<)
- 4011 — help (Ctrl-Alt-?)
- 4012 — break (Ctrl-Break)
- 4013 — hang up (Ctrl-Alt-End)
- 4020 — print screen (Ctrl-Alt-PrtScn)
- 4021 — hot1 (Ctrl-Alt-F1)
- 4022 — hot2 (Ctrl-Alt-F2)
...
- 402B — reload (Ctrl-Alt-Space)

• 80 — invalid key

June 22, 2010 Utilities 235


devc-con, devc-con-hid © 2010, QNX Software Systems GmbH & Co. KG.

Examples:
Typical command line:

devc-con -n4

Files:
/dev/con1, /dev/con2, . . .
Console port devices.

/etc/kbd.tbl The keyboard layout; see “International keyboard layouts,”


above.

Errors:
If an error occurs, the keyboard doesn’t work in text mode.

See also:
devc-*, io-hid, mkkbd
Using the Command Line and Controlling How Neutrino Starts in the Neutrino User’s
Guide

236 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devc-par
Parallel port manager (QNX Neutrino)

You must be root to start this driver.

Syntax:
devc-par [options] &

Runs on:
Neutrino

Targets:
x86

Options:
-b port Which BIOS port to use (1-4). Don’t use this option with the -p
option.

-p address Base I/O address of the parallel port. The I/O port address may be
specified in hexadecimal form (e.g. 0x140) or octal form (e.g. 0140)
as well as in decimal. Don’t use this option with the -b option.

-N name Register the parallel devices using name as the name (defaults to
par, giving /dev/par).

-O size Size of the output buffer in bytes (default 1000).

-o nodaemon Don’t call procmgr_daemon() to make the driver run in the


background. Use this option if you need to know when the devc-par
device terminates.

-P priority Priority of the writer agent task. Because the writer agent polls the
parallel ports, it should run at a lower priority than most other tasks.
The default priority is 9.

-s number Number of times to check a busy printer before resorting to a 100 ms


sleep. (Default is -1, always sleep if the printer is busy.)

Description:
The devc-par manager is a parallel port manager for QNX Neutrino. It can support
up to 4 parallel ports.
The devc-par driver polls the hardware to detect if a character has been sent.
If you don’t specify any ports (using the -p or -b options), devc-par tries to
interrogate the BIOS area to determine the number of parallel ports detected by the
BIOS. If no ports are found, devc-par silently exits.

June 22, 2010 Utilities 237


devc-par © 2010, QNX Software Systems GmbH & Co. KG.

You can use the -p option to override the use of the BIOS data area (at 0040:0008).
The only translation of output is the mapping of a newline character to a CR/LF if the
OPOST flag is set.
Reading from devc-par works the same as reading from /dev/null.

Examples:
Start devc-par, defaulting for all parallel ports found by the BIOS:

devc-par &

Start devc-par with only the first parallel port:

devc-par -p 0x3f8 &

Or:

devc-par -b 1 &

See also:
Connecting Hardware in the Neutrino User’s Guide

238 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devc-pty
Pseudo-tty communications manager (QNX Neutrino)

You must be root to start this manager.

Syntax:
devc-pty [options] &

Runs on:
Neutrino

Options:
-C size Specify the size of the canonical buffer in bytes (default 256).

-I size Size of input buffer in bytes (default 256).

-n numptys Create numptys ptys (default 8).

-O size Size of output buffer in bytes (default 3 × 512).

-o nodaemon Don’t call procmgr_daemon() to make the driver run in the


background. Use this option if you need to know when the devc-pty
device terminates.

Description:
The devc-pty manager is a small pseudo-tty manager for QNX Neutrino. It can
support up to 256 ptys, using the naming scheme:

• pty[p-zP-T][0-9a-f] for the master device

• tty[p-zP-T][0-9a-f] for the slave device

The master and slave device pair share the same letter and hexadecimal digit.

Examples:
Start devc-pty with 32 ptys:

devc-pty -n 32 &

June 22, 2010 Utilities 239


devc-ser8250 © 2010, QNX Software Systems GmbH & Co. KG.
8250 serial communications manager (QNX Neutrino)

You must be root to start this driver.

Syntax:
devc-ser8250 [[options]
[port[ˆshift][,intr]]]... &

Runs on:
Neutrino

Targets:
x86, PowerPC, and MIPS hardware with an 8250-compatible UART

Options:
The options are position-dependent and affect the subsequent ports.

-b number The initial baud rate (default 57600).

-C size The size of the canonical buffer in bytes (default 256).

-c clock[/divisor] Define a custom clock rate, in hertz, and divisor for the serial
port. The default (-c 1843200/16) is suitable for compatible
PC serial ports.

-E Start in raw mode (the default). Software flow control is


disabled by default.

-e Start in edited mode (default raw). Software flow control is


enabled by default.

-F Disable hardware flow control (default to hardware flow


control enabled). Hardware flow control is not supported in
edited mode.

-f Enable hardware flow control (default). Hardware flow control


is not supported in edited mode.

-I number The size of the interrupt input buffer in bytes (default 2048).

-O number The size of the interrupt output buffer in bytes (default 2048).

-o nodaemon Don’t call procmgr_daemon() to make the driver run in the


background. Use this option if you need to know when the
devc-ser8250 device terminates.

240 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devc-ser8250

-S|s Disable / enable software flow control. The default depends on


the mode: in raw mode (-E, the default), it’s disabled; in edited
mode (-e), it’s enabled.
The order in which you specify the -E or -e, and -S or -s
options matters:

Options Mode Software flow control


-e Edited Enabled
-S -e Edited Enabled
-e -S Edited Disabled
-E Raw Disabled
-s -E Raw Disabled
-E -s Raw Enabled

-T number Enable the transmit FIFO and set the number of characters to
be transmitted at each TX interrupt to 1, 4, 8, or 14. The
default is 0 (FIFO disabled).

-t number Enable the receive FIFO and set its threshold to 1, 4, 8, or 14


characters. The default is 0 (trigger disabled).

-u number Append number to the device name prefix (/dev/ser). The


default is 1; additional devices are given increasing numbers.

port The hex I/O address (for x86 systems) or the physical memory
address (for PowerPC and MIPS) of a serial port.

shift The spacing of the device registers as a power of 2. For


example:

0 Registers are 1 byte apart.


1 Registers are 2 bytes apart.
2 Registers are 4 bytes apart.
...
n Registers are 2n bytes apart.

The default shift is 0.

intr The interrupt used by this port; specified in hex if prefixed with
0x, otherwise it’s decimal.

June 22, 2010 Utilities 241


devc-ser8250 © 2010, QNX Software Systems GmbH & Co. KG.

Description:
The devc-ser8250 manager is a small serial device manager for QNX Neutrino. It
can support any number of serial ports using 8250s, 14450s or 16550s. Each device
can be assigned its own interrupt, or share an interrupt if the hardware supports
interrupt sharing. If you don’t specify any I/O ports for devices on an x86 system,
devc-ser8250 assumes you want to use the standard PC ports of COM1 (3f8,4) and
COM2 (2f8,3).
The serial driver’s priority floats to the priority of the client. All internal events are
processed at priority 24 (inherited from the internal pulse). The event handling priority
is hard coded and isn’t configurable by any of the options listed. (The driver’s main.c
program would need modification in order to change the priority).
When the driver talks to a client application, it’s running at the priority of the client.
All other processing takes place either at priority 24r or at interrupt time.
Each device is given a name in the pathname space of /dev/sern, where n starts at 1
(unless changed via the -u option) and increases. If you use the default PC serial
ports, this results in:

Device Port Interrupt


/dev/ser1 3f8 4
/dev/ser2 2f8 3

If your application uses /dev/console, you should create a link from it to one of
/dev/ser1, /dev/ser2, . . . by adding a line like this to the buildfile used by mkifs:

[type=link] /dev/console = /dev/ser1

All devices are fully interrupt driven and by default support standard hardware flow
control on input and output (RTS/CTS). This can be disabled by the -F option.

Hardware flow control is not supported in edited mode.

A read request by default returns when at least 1 character is available. To increase


efficiency, you can control three parameters to control when a read is satisfied:

Time Return after a specified amount of time has elapsed.

Min Return when this number of characters are in the input buffer.

Char Return if this forwarding character is in the input buffer.

242 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devc-ser8250

If the Min value is greater than the size of the input buffer, the Min value is clipped to
the size of the buffer. To avoid this, the size of the input buffer can be changed with
the -I option.

These parameters are set using library routines (see tcgetattr(), tcsetattr(), readcond()
and TimerTimeout() in the Library Reference).
The devc-ser8250 manager supports both raw and edited modes, making it a real tty
device.
The following fields and flags are supported in the termios structure:

Field Supported flags


c_cc All characters
c_iflag BRKINT ICRNL IGNBRK IXON
c_oflag OPOST
c_cflag CLOCAL CSIZE CSTOPB PARENB PARODD
c_lflag ECHO ECHOE ECHOK ECHONL ICANON IEXTEN ISIG NOFLSH

Examples:
Start devc-ser8250, defaulting for COM1 and COM2:

devc-ser8250 &

Start devc-ser8250, defaulting for COM1 and COM2, but change baud rate to
38400 from 57600 default:

devc-ser8250 -b 38400 &

Start devc-ser8250 with five ports (the last four preset to 38400 baud):

devc-ser8250 3f8,4 -b 38400 280,3 288,3 290,3 298,3 &

You can specify multiple -F and -f options; they’re position-dependent, and affect the
next serial port:

devc-ser8250 -F 3f8,4 -f 2f8,3 &

Start devc-ser8250 on an NEC 4111 eval board (MIPS):

devc-ser8250 0x1600ffc0ˆ1,0x80010007 &

June 22, 2010 Utilities 243


devc-ser8250 © 2010, QNX Software Systems GmbH & Co. KG.

See also:
devc-*
Connecting Hardware in the Neutrino User’s Guide

244 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devc-serpci
Driver for serial PCIs

You must be root to start this driver.

Syntax:
devc-serpci [vid=vid,did=did[,pci=pci]] [options] &

Runs on:
Neutrino

Targets:
x86

Options:
-b number The initial baud rate (default 57600).
-C size The size of the canonical buffer in bytes (default 256).
-c clock[/divisor] Define a custom clock rate, in hertz, and divisor for the serial
port. The default (-c 1843200/16) is suitable for compatible
PC serial ports.
did=did The PCI device ID, in hexadecimal (0xXXXX).
-E Set options to “raw” (default).
-e Start in edited mode (default raw). Software flow control is
enabled by default.
-F Disable hardware flow control (default to hardware flow
control enabled). Hardware flow control is not supported in
edited mode.
-f Enable hardware flow control (default). Hardware flow control
is not supported in edited mode.
-I number The size of the raw input buffer in bytes (default 2048).
-O number (“Oh”) The size of the interrupt output buffer in bytes (default
2048).
pci=pci The PCI index, in decimal (XX).
-S|s Disable / enable software flow control. The default depends on
the mode: in raw mode (-E, the default), it’s disabled; in edited
mode (-e), it’s enabled.
The order in which you specify the -E or -e, and -S or -s
options matters:

June 22, 2010 Utilities 245


devc-serpci © 2010, QNX Software Systems GmbH & Co. KG.

Options Mode Software flow control


-e Edited Enabled
-S -e Edited Enabled
-e -S Edited Disabled
-E Raw Disabled
-s -E Raw Disabled
-E -s Raw Enabled

-t number Enable the receive FIFO and set its threshold to 1, 4, 8, or 14


characters. The default is 0 (trigger disabled).

-u number Append number to the device name prefix (/dev/ser). The


default is 1; additional devices are given increasing numbers.

-v Increase verbosity.

vid=vid The PCI vendor ID, in hexadecimal (0xXXXX).

Description:
The devc-serpci manager is a small serial device manager for QNX Neutrino. This
driver supports 16Cxxx compatible Serial PCI cards.

The boards must use PCI I/O space for the registers, and the ports must be contiguous
in memory.

See also:
devc-serusb

246 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devc-serusb
Driver for USB-to-serial adaptors

You must be root to start this driver.

Syntax:
devc-serusb [options]

Runs on:
Neutrino

Targets:
ARMLE, MIPSLE, PPCBE, SHLE, x86

Options:
-b number The initial baud rate (default 57600).

-C size The size of the canonical buffer in bytes (default 256).

-d args[,args ...] Device-specific options. See below.

-E Set options to “raw” (default).

-e Start in edited mode (default raw). Software flow control is


enabled by default.

-F Disable hardware flow control (default to hardware flow control


enabled). Hardware flow control is not supported in edited
mode.

-f Enable hardware flow control (default). Hardware flow control


is not supported in edited mode.

-I number The size of the raw input buffer in bytes (default 2048).

-O number (“Oh”) The size of the interrupt output buffer in bytes (default
2048).

-S|s Disable / enable software flow control. The default depends on


the mode: in raw mode (-E, the default), it’s disabled; in edited
mode (-e), it’s enabled.
The order in which you specify the -E or -e, and -S or -s
options matters:

June 22, 2010 Utilities 247


devc-serusb © 2010, QNX Software Systems GmbH & Co. KG.

Options Mode Software flow control


-e Edited Enabled
-S -e Edited Enabled
-e -S Edited Disabled
-E Raw Disabled
-s -E Raw Disabled
-E -s Raw Enabled

The device-specific options that you can specify with the -d option are:

busno=bus The bus number of the USB controller.

devno=dev The USB address of the device.

did=did The device ID of the device.

ign_remove Specify to prevent the removal callback from being attached.

module=name Set the hardware module to use for an unknown vendor ID or


device ID.

path=name Connect to the specified USB stack. Default is


/dev/io-usb/io-usb.

pindex=idx Set the port that the index options are to be applied to.

priority=prio Set the priority of the event-processing thread. Default is 21.

query_modules Display the currently supported hardware modules.

rx_urbs=num The number of URBs for BulkIn. Default is 4.

tx_urbs=num The number of URBs for BulkOut. Default is 4.

unit=num The unit number: 1 = /dev/serusb1, 2 = /dev/serusb2,


etc. Default is the first available number, starting from 1.

vid=vid The vendor ID of the device.

wait=num Wait num seconds for the USB stack. Default is 60 seconds.

248 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devc-serusb

Description:
The devc-serusb is a driver for USB-to-serial adaptors.
If you provide the vid, did, busno and devno arguments for device-specific options,
devc-serusb does not attach an insertion callback to detect newly inserted devices.
The driver will work only with the already-inserted device that corresponds to the
arguments specified on the command line. If you do not also specify the ign_remove
option, the driver is terminated when the device is removed.
The unit option has meaning only when the driver is started for a specific device by
using the vid, did, busno and devno arguments. If the driver is managing device
insertions, the default behavior always applies.

Because devc-serusb is a USB class driver, the USB stack (io-usb) must be
running before you start this driver.

See also:
devc-serpci, io-usb

June 22, 2010 Utilities 249


devc-serzscc © 2010, QNX Software Systems GmbH & Co. KG.
Zilog SCC serial communications manager (QNX Neutrino)

You must be root to start this driver.

Syntax:
devc-serzscc [[options]
[port[ˆshift][+offset][,intr]]]... &

Runs on:
Neutrino

Targets:
PPCBE, x86

Options:
The options are position-dependent and affect the subsequent ports.

-1 Enable only channel A for this device.

-2 Enable both channel A and B for this device.

-b number The initial baud rate (default 57600).

-C size The size of the canonical buffer in bytes (default 256).

-c clock[/divisor] Define a custom clock rate, in hertz, and divisor for the serial
port. The default is suitable for compatible serial ports.

-D delay Inter-register access delay of delay.

-E Start in raw mode (the default). Software flow control is


disabled by default.

-e Start in edited mode (default raw). Software flow control is


enabled by default.

-F Disable hardware flow control (default to hardware flow


control enabled). Hardware flow control is not supported in
edited mode.

-f Enable hardware flow control (default). Hardware flow control


is not supported in edited mode.

-I number The size of the interrupt input buffer in bytes (default 2048).

-O number The size of the interrupt output buffer in bytes (default 2048).

250 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devc-serzscc

-o nodaemon Don’t call procmgr_daemon() to make the driver run in the


background. Use this option if you need to know when the
devc-serzscc device terminates.
-S|s Disable / enable software flow control. The default depends on
the mode: in raw mode (-E, the default), it’s disabled; in edited
mode (-e), it’s enabled.
The order in which you specify the -E or -e, and -S or -s
options matters:

Options Mode Software flow control


-e Edited Enabled
-S -e Edited Enabled
-e -S Edited Disabled
-E Raw Disabled
-s -E Raw Disabled
-E -s Raw Enabled

-u number Append number to the device name prefix (/dev/ser). The


default is 1; additional devices are given increasing numbers.

port Hex physical memory address of a serial port.

shift The spacing of the registers as a power of 2. For example:

0 Registers are 1 byte apart.


1 Registers are 2 bytes apart.
2 Registers are 4 bytes apart.
...
n Registers are 2n bytes apart.

The default shift is 0.

offset Offset to add to the port value.

intr Decimal interrupt used by this port.

Description:
The devc-serzscc manager is a small serial device manager for QNX Neutrino. It
supports the Zilog SCC chip.
All devices are fully interrupt driven and by default support standard hardware flow
control on input and output (RTS/CTS). This can be disabled by the -F option.

June 22, 2010 Utilities 251


devc-serzscc © 2010, QNX Software Systems GmbH & Co. KG.

Hardware flow control is not supported in edited mode.

If your application uses /dev/console, you should create a link from it to one of
/dev/ser1, /dev/ser2, . . . by adding a line like this to the buildfile used by mkifs:

[type=link] /dev/console = /dev/ser1

A read request by default returns when at least 1 character is available. To increase


efficiency, you can control three parameters to control when a read is satisfied:

Time Return after a specified amount of time has elapsed.

Min Return when this number of characters are in the input buffer.

Char Return if this forwarding character is in the input buffer.

If the Min value is greater than the size of the input buffer, the Min value is clipped to
the size of the buffer. To avoid this, the size of the input buffer can be changed with
the -I option.

These parameters are set using library routines (see tcgetattr(), tcsetattr(), readcond()
and TimerTimeout() in the Library Reference).
The devc-serzscc manager supports both raw and edited modes, making it a real tty
device.
The following fields and flags are supported in the termios structure:

Field Supported flags


c_cc All characters
c_iflag BRKINT ICRNL IGNBRK IXON
c_oflag OPOST
c_cflag CLOCAL CSIZE CSTOPB PARENB PARODD
c_lflag ECHO ECHOE ECHOK ECHONL ICANON IEXTEN ISIG NOFLSH

252 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devc-serzscc

Examples:
Start devc-serzscc in edited mode, specifying the clock rate, baud rate, and
inter-register access delay:

devc-serzscc -e -c4915200/16 -b9600 -D4000 0x81000000ˆ3+4,0x8002 &

See also:
devc-*

June 22, 2010 Utilities 253


devf-generic © 2010, QNX Software Systems GmbH & Co. KG.
Generic flash filesystem

You must be root to start this driver.

Syntax:
devf-generic
[-a] [-b priority] [-d log_method] [-E] [-e auto]
[-f verifylevel] [-i arrayindex[,partindex]]
[-l] [-m mountover
[-p backgroundpercent[,superlimit]] [-R] [-r]
[-s base[,wsize[,aoffset[,asize[,usize[,bwidth[,ileave]]]]]]]
[-t threads] [-u update] [-V] [-v]
[-w buffersize]

Runs on:
Neutrino

Targets:
Most flash devices

Options:
-a Don’t automount filesystem partitions present on the media. If
you specify both the -a and -R options, the driver ignores the -R
option.

-b priority Enable background reclaim at the specified priority. By default,


background reclamation is disabled.

-d log_method Control the logging from the flash driver. The possible values for
log_method are:
• 0 — log to stdout (the default).
• 1 — log to slogger.
• 2 — log to both stdout and slogger.

-E Don’t daemonize. If the driver detects a corrupt filesystem, the


exit status is that filesystem’s partition number plus 1.

-e auto Only enumerate the flash partitions, instead of doing a full scan
and mount. The flash driver automounts all partitions with a
partition number less than or equal to auto.
For example, assume we have a flash layout as follows:
• /dev/fs0p0 — raw
• /dev/fs0p1 — formatted
• /dev/fs0p2 — formatted

254 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devf-generic

• /dev/fs0p3 — formatted
If you start the driver with -e 1, the driver creates all the raw
entries in /dev, but mounts only /dev/fs0p1 (/dev/fs0p0 is
raw, so it’s never mounted, regardless of the -e option)

-f verifylevel Enable flash verify. (default=0, 0=none, write=1, erase=2, all=3)

-i arrayindex[,partindex]
Starting socket index and first partition index; 0 ≥ index ≥15. The
default is 0,0. Use this to give multiple drivers unique IDs. The -i
option is just a suggestion for the resource database manager; the
selected indexes can be larger.

-l List the available flash databases and exit.

-m mountover Override the mountpoints assigned to the file system that are
formatted with an empty (i.e. flashctl -p/dev/fs0p0 -f
-n "") mountpoint. The mountover argument can include two %X
format specifiers (like those for printf()) that are replaced by the
socket index and the partition index.

The -m option doesn’t override a mountpoint specified with mkefs.

-p backgroundpercent[,superlimit]
Set the background-reclaim percentage trigger (stale space over
free space) and, optionally, the superseded extent limit before
reclaim. The default is 100,16.

-R Mount any automount filesystems as read-only. This option


doesn’t affect raw partition mounts, and it has an effect only at
startup and initialization. Any subsequent mounting (with either
flashctl or mount) ignores the -R option. If you also specify
the -a option, the driver ignores the -R option.

-r Enable fault recovery for dirty extents, dangling extents, and


partial reclaims.

You should always specify the -r option unless you’re trying to debug an issue
concerning flash corruption.
If you don’t specify -r, and a power failure occurs, the following
can happen:
• You can waste space. If an erasure was happening when the
power was cut off, there will be some “dangling” extents (i.e.
marked for deletion, but not actually deleted). If you specify
the -vv option, the driver prints dangle for every dangling
extent found. These extents will continue to occupy space

June 22, 2010 Utilities 255


devf-generic © 2010, QNX Software Systems GmbH & Co. KG.

forever, until they’re deleted. Using the -r option will cause


them to be reclaimed.
• The system may be marked as read-only. If the driver detects
an error in the structure of the filesystem, and you haven’t
specified the -r option, the driver marks the partition as
read-only, so that it can’t be further damaged.
• If a reclaim operation is interrupted by a power loss, the spare
block may be unusable. In this case, if you specify the -vv
option, the driver prints partial to the console. The partition
is still read-write, but reclaims are turned off; if you continue to
overwrite files, you’ll eventually fill the filesystem with stale
data.
-s base[,wsize[,aoffset[,asize[,usize[,bwidth[,ileave]]]]]]
Set socket options, normally the base physical address, window
size, array offset, array size, unit size, bus width, and interleave.
The format is left flexible for socket services with customized
drivers. This option must be specified.
The arguments are:

base Physical base address of the flash part. This value is


board-specific.
wsize Size of the physically contiguous flash part.
aoffset For SRAM, the offset from the base address to the start of
the flash array.
asize For SRAM, the size of the flash array. The default is
equal to wsize.
usize The size of a physical erase sector. For SRAM, this
number can be any power of two. 64 KB should be the
minimum, for performance reasons.
bwidth The total width of the data bus, as seen from the
microprocessor’s perspective. This is the width of one
flash chip multiplied by the interleave. The value must be
a power of 2 (1, 2, 4, or 8).
ileave The number of flash chips arranged on the data bus. Two
16-bit wide chips used as the upper and lower halves of a
32-bit databus give an interleave of 2. This number must
be a power of 2 (1, 2, 4, or 8).

You can specify the base physical address, sizes, and offset in
octal (1000), hexadecimal (0x200), or decimal (512). The sizes
must be a power of two, and you can specify them with any of the
following suffixes:
• (nothing) — bytes

256 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devf-generic

• k — kilobytes
• m — megabytes

-t threads The number of threads. The minimum is 1, the default is 2, and


the maximum is 100. Extra threads increase performance when
background reclaiming is enabled (with the -b option) and when
multiple chips and/or spare blocks are available.

-u update Specify the update level for timestamps. POSIX specifies that
timestamps be kept when you access, create, or modify a file.
FFSv3 is documented as not supporting the access timestamp, in
order to reduce wear on the hardware.
The values for update are:
• 0 — don’t update the modification time for files (the default).
• 1 — update the modification time for files according to the
POSIX rules.
• 2 — update the modification time for files, as well as for the
parent directory.

The -u2 option is very, very expensive and will cause many reclaims because the time
updates have to flow right up to the root directory, so one file update may cause many
directory updates.

-V Display filesystem and MTD version information, and then exit.

-v Be verbose; specify additional v characters for more verbosity.


For more information, see “Verbose output,” below.

-w buffersize Write (append) buffer size in bytes. The default buffersize is 512.
Using a larger write-buffer prevents the creation of very small
extents, reducing overhead. If buffersize is 0, appending is
disabled.

Description:
The devf-generic manager provides Flash filesystem support for any standard flash
device. Typically, all you need to do is to pass the address and size using the -s
option. The manager should detect the device automatically.
For information on creating a custom variant of devf-generic for your embedded
system, see the Customizing the Flash Filesystem chapter of Building Embedded
Systems
The default filenames are as follows (you can use the -i option to change the ID, n,
appended to /dev/fs):

/dev/fsn Default mountpoint for socket n.

June 22, 2010 Utilities 257


devf-generic © 2010, QNX Software Systems GmbH & Co. KG.

/dev/fsnp0 Raw access for socket n, partition 0.

mountpoint Flash filesystem mountpoint for socket n, partition 0 with


transparent decompression.

You can specify the mountpoint above with the mount attribute of the mkefs
command, and override it with the -n option to flashctl. By default, it’s /fsnp0.

If you erase a raw partition or the raw array (socket), you might erase any boot
monitor, BIOS, or other data installed by the manufacturer. Check the documentation
for the board.

The driver probes the hardware to determine its block size. If you need to know the
block size, you can:

• Look in the documentation for the hardware.


Or:

• Start the driver in verbose mode by specifying the -v option. In the output, U:
indicates the number of units (also known as blocks or sectors), and S: indicates
the block size. Both numbers are in hexadecimal.
Or:

• Start the driver, and then run flashctl, specifying the -i option.

Verbose output
If you specify the -v option, a devf-* driver provides some useful information. This
section describes the output that you get if you specify -vvv; at higher levels of
verbosity, the output also includes messages about the use of malloc() and free(), but
these aren’t likely to be useful to you.
The output starts with something like this:

Flash Development Library - HEAD


Build: Jan 15 2010 13:00:00
MTD Build: Jan 15 2010, 13:25:55

These lines identify the source branch of the build, as well as the build times for
libfs-flash3.a and libmtd-flash.a.
The rest of the messages that the driver prints are variable; messages are printed as the
driver discovers things of interest. The general format of a message is
(devf tN ::function:line) Message string
where tN is the thread printing the message, function is the function emitting the
message, and line is the line number that emitted the message.
The standard messages include the following:

258 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devf-generic

(devf t1::f3s_skt_attach:109) fs0 socket RAM (flash simulation)


The flash driver located a flash socket, number zero (fs0). This message also
indicates that the hardware identification succeeded.
(devf t1::f3s_flash_probe:248) chip total = 1, bus_width = 8,
interleave = 2
After identifying the hardware, the driver prints the geometry. The chip total is
the number of contiguous chips. The bus width is the size of the data bus, in
bytes. The interleave is the number of physical chips sharing the data bus (high
and low halves of the data bus, for example).
This particular example indicates that there are two physical chips sharing a
64-bit data bus.

(devf t1::f3s_skt_attach:135) fs0 array SRAM U: 80 S: 020000


The flash driver has allocated the flash array (i.e. the storage media) of type
SRAM, with 0x80 hardware sectors, and a sector size of 0x020000 bytes.
(devf t1::f3s_recover_boot:248) fs0p0 boot P[00] U: 80
The filesystem is now scanning for partitions. It has found a boot header, and
has named the partition /dev/fs0p0. The boot signature is located on physical
block 0, and the partition has 0x80 sectors (called “units” in devf-*
nomenclature).
(devf t1::f3s_recover_reclaim:989) fs0p0 spare P[7F]
The second phase of the startup scan is processing /dev/fs0p0, and has found
a spare block. The spare block is located on physical sector 0x7F.
(devf t3::f3s_table_find:66) fs0p1 raw U: 09
A region of flash was found that isn’t formatted. The region is given the name
/dev/fs0p1; its size is 0x09 sectors.

Examples:
Start devf-generic and automatically mount the flash filesystem partitions at the
base address 0xFF000 with a window size of 16 megabytes, with an initial fault
recovery process, most POSIX semantics enabled and background reclaim at priority
5:

devf-generic -s 0xFF000,16M -r -u2 -b5 &


Create a 32 MB flash partition, with a 64 KB unit (sector) size:

devf-generic -s0,32m,,,64k -v -r
Create a 128 MB flash partition, with large block sizes (to speed formatting):

devf-generic -s0,128m,,,512k -v -r
Create a 4 MB partition:

devf-generic -s0,4m,,,64k -v -r

June 22, 2010 Utilities 259


devf-generic © 2010, QNX Software Systems GmbH & Co. KG.

Create a 16 MB flash partition, from a given physical address, with a 128 KB unit size,
and a 16-bit wide data bus:

devf-generic -s0xa4000000,16m,,,128k,2 -v -r

Create a 16 MB flash partition, from a given physical address, with a 256 KB unit size,
and a 32-bit-wide data bus, with an interleave of two:

devf-generic -s0,16m,,,256k,4,2 -v -r

Caveats:
You must specify the -s option when using this driver.
Although the Flash filesystem supports most POSIX semantics, some functionality
isn’t implemented in order to keep the driver simple and efficient. The unsupported
POSIX semantics include:

• Hard links, and everything related to hard links (the . and .. directories don’t
exist, struct stat’s nlink member is hard-coded, and unlink() of directories
returns ENOTSUP).

• Access times aren’t updated on the media; they’re set to the modification time.

QNX Neutrino flash filesystem version 3 no longer provides built-in decompression.


The flash filesystem’s decompression functionality has moved into the inflator
resource manager. You should now use the deflate utility to compress files.
Performance might be slow when multiple writers are writing randomly to a shared
file or to a shared directory (e.g. using unlink or rename). In these cases, the offset
pointers have to be rewound for every access. There’s no performance penalty when
appending to a file, or when creating files with open(O_CREAT), mkdir, mknod, or
link.

See also:
deflate, devf-ram, flashctl, inflator, mkefs
“Flash filesystems” in the Working With Filesystems chapter of the User’s Guide
Customizing the Flash Filesystem chapter of Building Embedded Systems

260 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devf-ram
Simulate flash filesystem using RAM memory

You must be root to start this driver.

Syntax:
devf-ram
[-a] [-b priority]
[-E] [-f verifylevel] [-i arrayindex[,partindex]]
[-l] [-m mountover]
[-p backgroundpercent[,superlimit]] [-R] [-r]
[-s base[,wsize[,aoffset[,asize[,usize[,bwidth[,ileave]]]]]]]
[-t threads] [-u update] [-V] [-v]
[-w buffersize]

Runs on:
Neutrino

Targets:
MIPS, PowerPC, x86, SH, and ARM

Options:
-a Don’t automount filesystem partitions present on the media. If you
specify both the -a and -R options, the driver ignores the -R
option.

-b priority Enable background reclaim at the specified priority. By default,


background reclamation is disabled.

-E Don’t daemonize. If the driver detects a corrupt filesystem, the exit


status is that filesystem’s partition number plus 1.

-f verifylevel Simulate flash verify; only provided for syntax compatibility with
real flash hardware (default=0, 0=none, write=1, erase=2, all=3).
-i arrayindex[,partindex]
Starting socket index and first partition index; 0 ≥ index ≥15. The
default is 0,0. Use this to give multiple drivers unique IDs. The -i
option is just a suggestion for the resource database manager; the
selected indexes can be larger.

-l List the available flash databases and exit.

-m mountover Override the mountpoints assigned to a file system that are


formatted with an empty (i.e. flashctl -p/dev/fs0p0 -e -f
-n "") mountpoint. The mountover argument can include two %X
format specifiers (like those for printf()) that are replaced by the
socket index and the partition index.

June 22, 2010 Utilities 261


devf-ram © 2010, QNX Software Systems GmbH & Co. KG.

The -m option doesn’t override a mountpoint specified with mkefs.

-p backgroundpercent[,superlimit]
Set the background-reclaim percentage trigger (stale space over
free space) and, optionally, the superseded extent limit before
reclaim. The default is 100,16.

-R Mount any automount filesystems as read-only. This option


doesn’t affect raw partition mounts, and it has an effect only at
startup and initialization. Any subsequent mounting (with either
flashctl or mount) ignores the -R option. If you also specify
the -a option, the driver ignores the -R option.

-r Enable fault recovery for dirty extents, dangling extents, and


partial reclaims.

You should always specify the -r option unless you’re trying to debug an issue
concerning flash corruption.
If you don’t specify -r, and a power failure occurs, the following
can happen:
• You can waste space. If an erasure was happening when the
power was cut off, there will be some “dangling” extents (i.e.
marked for deletion, but not actually deleted). If you specify the
-vv option, the driver prints dangle for every dangling extent
found. These extents will continue to occupy space forever,
until they’re deleted. Using the -r option will cause them to be
reclaimed.
• The system may be marked as read-only. If the driver detects an
error in the structure of the filesystem, and you haven’t specified
the -r option, the driver marks the partition as read-only, so that
it can’t be further damaged.
• If a reclaim operation is interrupted by a power loss, the spare
block may be unusable. In this case, if you specify the -vv
option, the driver prints partial to the console. The partition
is still read-write, but reclaims are turned off; if you continue to
overwrite files, you’ll eventually fill the filesystem with stale
data.
-s base[,wsize[,aoffset[,asize[,usize[,bwidth[,ileave]]]]]]
Set socket options, normally the base physical address, window
size, array offset, array size, unit size, bus width, and interleave.
The format is left flexible for socket services with customized
drivers.
The arguments are:

262 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devf-ram

base Physical base address of the flash part. This value is


board-specific.

For the devf-ram utility, the base argument carries a special meaning:
0 Allocate system memory.
Nonzero Use the exact physical address. You must
exercise caution here. See the caveats below.
wsize Size of the physically contiguous flash part.
aoffset For SRAM, the offset from the base address to the start of
the flash array.
asize For SRAM, the size of the flash array. The default is
equal to wsize.
usize The size of a physical erase sector. For SRAM, this
number can be any power of two. 64 KB should be the
minimum, for performance reasons.
bwidth The total width of the data bus, as seen from the
microprocessor’s perspective. This is the width of one
simulated flash chip multiplied by the interleave. This
value must be a power of 2 (1, 2, 4, or 8).
ileave The number of simulated flash chips arranged on the data
bus. This value must be a power of 2 (1, 2, 4, or 8).

You can specify the base physical address, sizes, and offset in octal
(0777), hexadecimal (0x1ff), or decimal (511). The sizes must
be a power of two, and you can specify them with any of the
following suffixes:
• (nothing) — bytes
• k — kilobytes
• m — megabytes

On ARM targets, devf-ram can’t resize the shared object /dev/shmem/fs*. If you
need to restart devf-ram with a new size, first unlink the old shared object:

rm /dev/shmem/fs*

-t threads The number of threads. The minimum is 1, the default is 2, and the
maximum is 100. Extra threads increase performance when
background reclaiming is enabled (with the -b option) and when
multiple chips and/or spare blocks are available.

-u update Specify the update level for timestamps. POSIX specifies that
timestamps be kept when you access, create, or modify a file.
FFSv3 is documented as not supporting the access timestamp, in
order to reduce wear on the hardware.

June 22, 2010 Utilities 263


devf-ram © 2010, QNX Software Systems GmbH & Co. KG.

The values for update are:


• 0 — don’t update the modification time for files (the default).
• 1 — update the modification time for files according to the
POSIX rules.
• 2 — update the modification time for files, as well as for the
parent directory.

The -u2 option is very, very expensive and will cause many reclaims because the time
updates have to flow right up to the root directory, so one file update may cause many
directory updates.

-V Display filesystem and MTD version information, and then exit.

-v Be verbose; specify additional v characters for more verbosity. For


more information, see “Verbose output” in the entry for
devf-generic.

-w buffersize Write (append) buffer size in bytes. The default buffersize is 512.
Using a larger write-buffer prevents the creation of very small
extents, reducing overhead. If buffersize is 0, appending is
disabled.

Description:
The devf-ram manager simulates flash filesystem in RAM using the following
default filenames (the ID, n, appended to /dev/fs can be changed via the -i option):

/dev/fsn Default mountpoint for socket n.

/dev/fsnp0 Raw access for socket n, partition 0.

mountpoint Flash filesystem mountpoint for socket n, partition 0 with


transparent decompression.

You can specify the mountpoint above with the mount attribute of the mkefs
command, and override it with the -n option to flashctl. By default, it’s /fsnp0.

Examples:
Start devf-ram with a 16 MB partition.

devf-ram -s0,16m
Start devf-ram and automatically mount the flash filesystem partitions, with an initial
fault recovery process, most POSIX semantics enabled and background reclaim at
priority 5 (default size: 1 MB):

devf-ram -r -u2 -b5 &

264 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devf-ram

Create a 32 MB flash partition, allocated from system RAM, with a 64 KB unit


(sector) size:
devf-ram -s0,32m,,,64k -v -r
Create a 128 MB flash partition in system RAM, with large block sizes (to speed
formatting):
devf-ram -s0,128m,,,512k -v -r
Create a 4 MB partition from system RAM:
devf-ram -s0,4m,,,64k -v -r

You must format and erase a devf-ram partition before you can mount the flash
filesystem. See the caveats below.

If you specify a block size in your buildfile for DRAM-based flash filesystems, limit
the size to the default, which is 64 KB.

Caveats:
Although the flash filesystem supports most POSIX semantics, some functionality
isn’t implemented in order to keep the driver simple and efficient. The unsupported
POSIX semantics include:
• Hard links, and everything related to hard links (the . and .. directories don’t
exist, struct stat’s nlink member is hard-coded, and unlink() of directories
returns ENOTSUP).
• Access times aren’t updated on the media; they’re set to the modification time.

QNX Neutrino flash filesystem version 3 no longer provides built-in decompression.


The flash filesystem’s decompression functionality has moved into the inflator
resource manager. You should now use the deflate utility to compress files.
Performance might be slow when multiple writers are writing randomly to a shared
file or to a shared directory (e.g. using unlink or rename). In these cases, the offset
pointers have to be rewound for every access. There’s no performance penalty when
appending to a file, or when creating files with open(O_CREAT), mkdir, mknod, or
link.
Don’t try to create a devf-ram partition at the address of a real flash memory. You
may get an error message: Unable to properly identify any flash
devices.
Don’t try to create a devf-ram partition (e.g. using nonzero value for base argument)
at the address of physical memory that is in use. It may destroy applications and crash
the operating system. The only use for specifying such nonzero base is to create a
flash filesystem for board specific memory (e.g. SRAM).
You must format and erase a devf-ram partition before you can mount the flash
filesystem. e.g.

June 22, 2010 Utilities 265


devf-ram © 2010, QNX Software Systems GmbH & Co. KG.

devf-ram -s0,16m
flashctl -p /dev/fs0p0 -e -f -m

If there’s insufficient RAM, when you try to create an nM size partition with -s0
option, the devf-ram driver returns without an error message. The partition isn’t
created.

See also:
deflate, devf-generic, flashctl, inflator, mkefs
“Flash filesystems” in the Working With Filesystems chapter of the User’s Guide

266 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-ati_rage128.so
Graphics driver for ATI RAGE 128/128 Pro chipsets

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
x86, PowerPC, MIPS

Options:
For the io-display options that you can use with this driver, see io-display.

Description:
The devg-ati_rage128.so driver provides accelerated 2D support for the specified
graphics chipsets.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Supported chipsets
• ATI RAGE 128 GL

• ATI RAGE 128 VR

• ATI RAGE 128 Pro GL

• ATI RAGE 128 Pro VR

• ATI RAGE Mobility M3

• ATI RAGE Mobility M4

Acceleration features
Feature Provision
Solid fills Yes
Pattern fills Yes
Onscreen blitting Yes

continued. . .

June 22, 2010 Utilities 267


devg-ati_rage128.so © 2010, QNX Software Systems GmbH & Co. KG.

Feature Provision
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Full
Bitmaps No

Video Overlay/Scaler support


Feature Provision
YUV formats Yes (packed)
RGB formats Yes (RGB 565, 555, 8888)
Up scaling Yes
Down scaling Yes

Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes

Resolution and refresh support


Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60, 70, 75, 85 8, 15, 16, 32
800x600 60, 70, 75, 85 8, 15, 16, 32
1024x768 60, 70, 75, 85 8, 15, 16, 32
1152x864 60, 70, 75, 85 8, 15, 16, 32
1280x800 60, 70, 75, 85 8, 15, 16, 32
1280x1024 60, 70, 75, 85 8, 15, 16, 32
1440x900 60, 70, 75, 85 8, 15, 16, 32

continued. . .

268 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-ati_rage128.so

Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
1600x1200 60, 70, 75, 85 8, 15, 16, 32

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

See also:
io-display

June 22, 2010 Utilities 269


devg-carmine.so © 2010, QNX Software Systems GmbH & Co. KG.
Graphics driver for Fujitsu Carmine chipsets

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
SHLE, x86, PowerPC

Options:
For the general io-display options that you can use with this driver, see
io-display.
You can set configuration options that are specific to this driver by using the
modeopts setting in display.conf:

modeopts=config-file
The full path to the configuration file for the driver. For example,
carmine.conf is located in /usr/photon/config so that
modeopts=/usr/photon/config/carmine.conf.

Description:
The devg-carmine.so driver provides accelerated 2D and 3D support for the
Fujitsu Carmine graphics controller.
You can edit the configuration file to enable devg-carmine.so to run on your board.
Follow the editing instructions in the sample file,
/usr/photon/config/carmine.conf, to specify the correct configuration for the
required display mode. (For a more detailed explanation of the display settings, see the
appropriate Fujitsu documentation.)
If you use a configuration file for this driver, you must use the modeopts setting in
your display.conf configuration file to specify its location.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

270 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-carmine.so

Supported chipsets

• Fujitsu MB86297 Carmine

2D Acceleration features
Feature Provision
Solid fills Yes
Bresenham lines Yes
Pattern fills No
Polygons Yes
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending Yes
Raster OP’s 16
Bitmaps Yes

Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture Yes
DPMS (power saving) Yes
Layers supported 8

June 22, 2010 Utilities 271


devg-carmine.so © 2010, QNX Software Systems GmbH & Co. KG.

Resolution and refresh support


Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60 15, 32
800x600 60 15, 32
1024x768 60 15, 32

Restrictions:

• You can use the configuration file to specify other resolutions and refresh rates.

The carmine.conf file


The carmine.conf file provides additional control over the driver, including
dual-head support. This file is also required for providing additional configuration for
panel displays. The file (by default located in /usr/photon/config/) contains a
description of each option, and several preconfigured command lines for various
Carmine device and display combinations.
The Carmine chipset supports two display controllers. In carmine.conf,
display-related settings may be specified independently for each display controller.
Additionally, you can use the configuration file to configure:

• memory controller initialization sequence

• layer per-pixel blending mode: inline alpha vs. separate alpha layers

• LVDS reset sequence, using the output of the GV pin

See the comments in the sample configuration file for more details.

Alpha layer support


The alpha layers work in one of two modes on the Carmine:

• In the default mode, there is a single layer supporting per-pixel alpha (compared to
four alpha layers in the second mode). The alpha values are inlined with the RGB
values in this mode, as opposed to being on a separate alpha layer. However, this
inline alpha mode is supported only on one layer, which is GF layer index 2. This
mode provides flexibility: you can, for example, use the alpha values generated by
OpenGL ES to do some interesting effects.

• In the second mode, there are 4 special-purpose alpha layers, which are in addition
to the 8 color layers.
In the GF API, the gf_alpha_t alpha map is configured for blending with an
RGB layer as follows:
gf_alpha_t alpha;

memset(&alpha, 0, sizeof(alpha));

272 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-carmine.so

alpha.mode = GF_ALPHA_M1_MAP | GF_BLEND_SRC_M1 |


GF_BLEND_DST_1mM1;
alpha.map = asurf;

gf_layer_set_blending(fglayer, &alpha);
In the above example, the driver internally picks one of the four alpha layers (if
there is still one available) and uses it.

The two modes of alpha layer operation are mutually exclusive, and must be selected
via the carmine.conf configuration file. The mode of operation can’t be changed at
runtime. By default, the inline alpha mode is used. To use the other mode, specify this
option in the configuration file:

alphamap=1

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

See also:
io-display
/usr/photon/config/carmine.conf

June 22, 2010 Utilities 273


devg-chips.so © 2010, QNX Software Systems GmbH & Co. KG.
Graphics driver for Chips and Technologies graphics chipsets

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
MIPSLE, PowerPC, SHLE, x86, ARMLE

Options:
For the general io-display options that you can use with this driver, see
io-display.
You can set configuration options that are specific to this driver by using the
modeopts setting in display.conf:

modeopts=config-file
The full path to the configuration file for the driver. For example chips.conf
is located in /usr/photon/config by default so that
modeopts=/usr/photon/config/chips.conf.

Description:
The devg-chips.so driver provides accelerated 2D support for Chips and
Technologies graphics chipsets.
You can edit the configuration file to enable devg-chips.so to run on your board.
For more information on the options available, see the sample configuration file,
/usr/photon/config/chips.conf.
If you use a configuration file for this driver, you must use the modeopts setting in
your display.conf to specify its location.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Supported chipsets
• 65550

• 65554

• 65555

274 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-chips.so

• 69000
• 69030

Acceleration features

Feature Provision
Solid fills Yes
Bresenham lines No
Pattern fills Yes
Polygons No
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Full
Bitmaps No

Video Overlay/Scaler support


Feature Provision
YUV formats Yes
RGB formats Yes
Up scaling Yes

Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes

Resolution and refresh support

June 22, 2010 Utilities 275


devg-chips.so © 2010, QNX Software Systems GmbH & Co. KG.

Display size (pixels): Refresh rate(Hz): Color depth (bits per pixel):
640x480 60, 72, 75, 85 8, 15, 16, 24
800x600 60, 70, 75, 85 8, 15, 16, 24
1024x768 60, 70, 75, 85 8, 15, 16, 24
1152x864 60, 70, 75, 85 8, 15, 16, 24
1280x800 60, 72, 75, 85 8, 15, 16, 24
1280x1024 60, 72, 75, 85 8, 15, 16, 24
1440x900 60, 72, 75, 85 8, 15, 16, 24
1600x1200 60, 72, 75, 85 8, 15, 16, 24

Restrictions:

• These values are typical; the actual ones may depend on your BIOS and monitor
(x86 only).

• Higher resolution and color depths may require more video RAM.

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

See also:
io-display
/usr/photon/config/chips.conf

276 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-coral.so
Graphics driver for Fujitsu Coral chipsets

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
ARMLE, PowerPC, SHLE, x86

Options:
For the general io-display options that you can use with this driver, see
io-display.
You can set configuration options that are specific to this driver by using the
modeopts setting in display.conf:

modeopts=config-file
The full path to the configuration file for the driver. For example, coral.conf
is located in /usr/photon/config so that
modeopts=/usr/photon/config/coral.conf.

Description:
The devg-coral.so driver provides accelerated 2D support for the Fujitsu Coral
graphics controller.
You can edit the configuration file to enable devg-coral.so to run on your board.
Follow the editing instructions in the sample file,
/usr/photon/config/coral.conf, to specify the correct configuration for the
required display mode. (For a more detailed explanation of the display settings, see the
appropriate Fujitsu documentation.)
If you use a configuration file for this driver, you must use the modeopts setting in
your display.conf to specify its location.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

June 22, 2010 Utilities 277


devg-coral.so © 2010, QNX Software Systems GmbH & Co. KG.

Supported chipsets

• Fujitsu MB86294 Coral B

• Fujitsu MB86295 Coral P

• Fujitsu MB86296 Coral PA

Acceleration features
Feature Provision
Solid fills Yes
Bresenham lines Yes
Pattern fills No
Polygons Yes
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending Yes
Raster OPs Full
Bitmaps Yes

Video Overlay/Scaler support


Feature Provision
YUV formats Yes
RGB formats Yes
Up scaling No

278 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-coral.so

Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture Yes
DPMS (power saving) Yes
Layers supported 6

Resolution and refresh support


Display size (pixels): Refresh rate(Hz): Color depth (bits per pixel):
640x480 60 8, 15
800x600 60 8, 15a
1024x768 60 8, 15a

a Requires a driver configuration file.

Restrictions:

• You can use the driver-configuration file to specify other resolutions and refresh
rates.

The coral.conf file and dual-head


The coral.conf file provides additional control over the driver, including dual-head
support (dual-head display is supported by Coral-PA-based devices only). This file is
also required for providing additional configuration for panel displays. The file (by
default located in /usr/photon/config/) contains a description of each option,
and several pre-configured command-lines for various Coral device and display
combinations.
For dual-head configurations, both displays will run at the same resolution/refresh rate
- independent control is not available.

• The Coral-PA reference card does not support dual-display on its own, a special
adapter card is necessary.

• The maximum supported resolution for dual-display is 800x480 at 66 MHz.

In coral.conf there are three parameters of note:

• dlayers — SC0en & SC1en fields for Multi-Display Control register

June 22, 2010 Utilities 279


devg-coral.so © 2010, QNX Software Systems GmbH & Co. KG.

• dmode — Dual Display mode (0 = single display, 1 = dual parallel mode, 2 = dual
multiplexed mode)
• dcm — Display Clock. This needs to be configured to twice the value as would be
required single display. For example, to run two 640x480 displays, change
dcm=0x700 to dcm=0x300

In the Coral-PA Documentation (section 7.10 Dual Display), you’ll see that the
SC0-en field of the Multi-Display Control register defines which layers and cursors are
included in screen 0, and the SC1-en field defines which layers and cursors are
included in screen 1. A layer or cursor can be included in one or both screens.
SC0en and SC1en are 8-bit values. The dlayers parameter is 16-bit with SC1 being the
top 8-bits. A 1 indicates the layer is included in the display.
The bit layout for the dlayers parameter is as follows:

bit description
0 L0 is included in screen 0
1 L1 is included in screen 0
2 L2 is included in screen 0
3 L3 is included in screen 0
4 L4 is included in screen 0
5 L5 is included in screen 0
6 Cursor0 is included in screen 0
7 Cursor1 is included in screen 0
8 L0 is included in screen 1
9 L1 is included in screen 1
10 L2 is included in screen 1
11 L3 is included in screen 1
12 L4 is included in screen 1
13 L5 is included in screen 1
14 Cursor 0 is included in screen 1
15 Cursor 1 is included in screen 1

To include all layers and cursors on both displays, set dlayers=0xFFFF (This is the
default). The driver default for dmode is 0 for single display.
There are two modes to output two screens. In parallel mode, one screen is output at
digital RGB while another is output at analog RGB. In multiplex mode, two screens

280 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-coral.so

are multiplexed and output at digital RGB. Which version is used will depend on
hardware and requirements.
For example, to run in parallel mode with Layers 0, 1 and Cursor 0 on screen 0 and the
rest of the layers on screen 1 you would set:

dlayers=0xBC83
dmode=1

The application code needs to then connect and draw to the proper layers.

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

See also:
io-display
/usr/photon/config/coral.conf

June 22, 2010 Utilities 281


devg-extreme2.so © 2010, QNX Software Systems GmbH & Co. KG.
Graphics driver for Intel Extreme2 chipsets

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
x86

Options:
For the general io-display options that you can use with this driver, see
io-display.

Description:
The devg-extreme2.so driver provides 2D and 3D support for the specified
graphics chipsets.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Supported chipsets
• Intel 82852

• Intel 82854

• Intel 82855

• Intel 82865

2D Acceleration features
Feature Provision
Solid fills Yes
Bresenham lines Yes
Pattern fills Yes
Polygons No

continued. . .

282 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-extreme2.so

Feature Provision
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending Yes
Raster OP’s Full
Bitmaps No
Scaled blitting Yes

Video Overlay/Scaler support


None

Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes
Layers 4a

a Layer 1 is YUV format only.

Resolution and refresh support


Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60, 70, 75, 85 8, 15, 16, 32
800x600 60, 70, 75, 85 8, 15, 16, 32
1024x768 60, 70, 75, 85 8, 15, 16, 32
1152x864 60, 70, 75, 85 8, 15, 16, 32
1280x1024 60, 70, 75, 85 8, 15, 16, 32
1600X1200 60, 70, 75, 85 8, 15, 16, 32

Restrictions:

• BIOS capability determines which of these resolutions and color depths are
available on your system.

June 22, 2010 Utilities 283


devg-extreme2.so © 2010, QNX Software Systems GmbH & Co. KG.

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

See also:
io-display

284 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-flat.so
Graphics driver for unaccelerated flat frame buffers

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
x86, PowerPC, ARMLE, MIPS, SHLE

Options:
For the general io-display options that you can use with this driver, see
io-display.
You can set configuration options that are specific to this driver by using the memopts
setting in display.conf:

memopts=config-file
The full path to the configuration file for the driver. For example, flat.conf is
located in /usr/photon/config and describes the supported options.

Description:
The devg-flat.so driver provides unaccelerated flat support for frame buffers.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

See also:
io-display

June 22, 2010 Utilities 285


devg-geode.so © 2010, QNX Software Systems GmbH & Co. KG.
Graphics driver for AMD Geode and Media GX chipsets

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
x86

Options:
For the general io-display options that you can use with this driver, see
io-display.

Description:
The devg-geode.so driver provides accelerated 2D support for the specified
graphics chipsets.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Supported chipsets
• Media GX

• Geode GX1

• Geode GXLV

• SC1200

Acceleration features

Feature Provision
Solid fills Yes
Pattern fills Yes
Onscreen blitting Yes

continued. . .

286 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-geode.so

Feature Provision
Offscreen blitting Yes
Chroma-keyed blitting No
Alpha blending No
Raster OPs No
Bitmaps Yes

Video Overlay/Scaler support

Feature Provision
YUV formats Yes (packed)
RGB formats Yes (RGB 565)
Up scaling Yes
Down scaling No

Other features

Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes

Resolution and refresh support

Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60 8, 15, 16
800x600 60 8, 15, 16
1024x768 60 8, 15, 16
1280x1024 60 8

Restrictions:

• These are typical values; the actual ones may depend on your video BIOS.

June 22, 2010 Utilities 287


devg-geode.so © 2010, QNX Software Systems GmbH & Co. KG.

• Higher resolution and color depths may require more video RAM.

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

See also:
io-display

288 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-gma9xx.so
Graphics driver for Intel 945GX and 945GMx chipsets

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
x86

Options:
For the general io-display options that you can use with this driver, see
io-display.

Description:
The devg-gma9xx.so driver provides 2D and 3D support for the specified graphics
chipsets.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Supported chipsets
• Intel 915G

• Intel 915GM

• Intel 945G

• Intel 915GM

2D Acceleration features
Feature Provision
Solid fills Yes
Bresenham lines Yes
Pattern fills Yes
Polygons No
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes

continued. . .

June 22, 2010 Utilities 289


devg-gma9xx.so © 2010, QNX Software Systems GmbH & Co. KG.

Feature Provision
Alpha blending Yes
Raster OP’s Full
Bitmaps No
Scaled blitting Yes

Video Overlay/Scaler support


None

Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes
Layers 4a

a Layer 1 is YUV format only.

Resolution and refresh support


Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60, 70, 75, 85 8, 15, 16, 32
800x600 60, 70, 75, 85 8, 15, 16, 32
1024x768 60, 70, 75, 85 8, 15, 16, 32
1152x864 60, 70, 75, 85 8, 15, 16, 32
1280x1024 60, 70, 75, 85 8, 15, 16, 32
1600X1200 60, 70, 75, 85 8, 15, 16, 32

Restrictions:
• BIOS capability determines which of these resolutions and color depths are
available on your system.

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

290 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-gma9xx.so

See also:
io-display

June 22, 2010 Utilities 291


devg-i810.so © 2010, QNX Software Systems GmbH & Co. KG.
Graphics driver for Intel I810 and I815 chipsets

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
x86

Options:
For the general io-display options that you can use with this driver, see
io-display.

Description:
The devg-i810.so driver provides accelerated 2D support for the specified graphics
chipsets.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Supported chipsets
• Intel 82810

• Intel 82810 DC100

• Intel 82810E

• Intel 82815

Acceleration features

Feature Provision
Solid fills Yes
Pattern fills Yes
Onscreen blitting Yes

continued. . .

292 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-i810.so

Feature Provision
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Full
Bitmaps No

Video Overlay/Scaler support

Feature Provision
YUV formats Yes (packed)
RGB formats Yes (RGB 555, 565)
Up scaling Yes
Down scaling Yes

Other features

Feature Provision
Hardware Cursor Yes
TV Out Yes (PAL and NTSC)
Video capture No
DPMS (power saving) Yes

Restrictions:

• TV Out requires a Chrontel CH7007 chip

Resolution and refresh support

Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60, 70, 75, 85 8, 15, 16, 24
800x600 60, 70, 75, 85 8, 15, 16, 24
1024x768 60, 70, 75, 85 8, 15, 16, 24

continued. . .

June 22, 2010 Utilities 293


devg-i810.so © 2010, QNX Software Systems GmbH & Co. KG.

Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
1152x864 60, 70, 75, 85 8, 15, 16, 24
1280x800 60, 70, 75, 85 8, 15, 16, 24
1280x1024 60, 70, 75, 85 8, 15, 16, 24
1440x900 60, 70, 75, 85 8, 15, 16, 24
1600x1200 60, 70, 75, 85 8, 15, 16, 24

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

See also:
io-display

294 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-i830.so
Graphics driver for Intel chipsets

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
x86

Options:
For the general io-display options that you can use with this driver, see
io-display.

Description:
The devg-i830.so driver provides accelerated 2D support for graphics chips.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Supported chipsets
• Intel 830

• Intel 845

• Intel 852

• Intel 855

• Intel 865

• Intel 915

• Intel 945

• Intel 965 chipset with integrated graphics

Acceleration features

June 22, 2010 Utilities 295


devg-i830.so © 2010, QNX Software Systems GmbH & Co. KG.

Feature Provision
Solid fills Yes
Bresenham lines No
Pattern fills Yes
Polygons No
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Full
Bitmaps No

Video Overlay/Scaler support

Feature Provision
YUV formats Yes
RGB formats No
Up scaling Yes
Down scaling Yes

Other features

Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes

Resolution and refresh support

296 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-i830.so

Display size (pixels): Refresh rate(Hz): Color depth (bits per pixel):
640x480 60, 72, 75, 85 8, 15, 16, 32
800x600 60, 70, 75, 85 8, 15, 16, 32
1024x768 60, 70, 75, 85 8, 15, 16, 32
1152x864 60, 70, 75, 85 8, 15, 16, 32
1280x800 60, 72, 75, 85 8, 15, 16, 32
1280x1024 60, 72, 75, 85 8, 15, 16, 32
1440x900 60, 72, 75, 85 8, 15, 16, 32
1600x1200 60, 72, 75, 85 8, 15, 16, 32

Restrictions:

• These values are typical; the actual ones may depend on your BIOS and monitor.

• Higher resolutions and color depths may require more video RAM.

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

See also:
io-display

June 22, 2010 Utilities 297


devg-intelhd.so © 2010, QNX Software Systems GmbH & Co. KG.
Graphics driver for Intel GMA HD graphics

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
x86

Options:
For the general io-display options that you can use with this driver, see
io-display.

Description:
The devg-intelhd.so driver provides accelerated 2D support for Intel Graphics
Media Accelerator (GMA) High Definition (HD) chips.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Supported chipsets
• Intel Core i3, i5, and i7

Acceleration features

Feature Provision
Solid fills Yes
Bresenham lines No
Pattern fills Yes
Polygons No
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes

continued. . .

298 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-intelhd.so

Feature Provision
Alpha blending No
Raster OPs Full
Bitmaps No

Video Overlay/Scaler support

Feature Provision
YUV formats No
RGB formats No
Up scaling No
Down scaling No

Other features

Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) No

Resolution and refresh support

Display size (pixels): Refresh rate(Hz): Color depth (bits per pixel):
640x480 60, 72, 75, 85 16, 32
800x600 60, 70, 75, 85 16, 32
1024x768 60, 70, 75, 85 16, 32
1152x864 60, 70, 75, 85 16, 32
1280x1024 60, 72, 75, 85 16, 32
1600x1200 60, 72, 75, 85 16, 32

Restrictions:

• These values are typical; the actual ones may depend on your BIOS and monitor.

June 22, 2010 Utilities 299


devg-intelhd.so © 2010, QNX Software Systems GmbH & Co. KG.

• Higher resolutions and color depths may require more video RAM.

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

See also:
io-display

300 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-matroxg.so
Graphics driver for Matrox Millennium G-series chipsets

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
x86

Options:
For the io-display options that you can use with this driver, see io-display.

Description:
The devg-matroxg.so driver provides accelerated 2D support for the specified
graphics chipsets.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Supported chipsets
• Millennium G550 (dual-head output supported on dual-headed cards)

• Millennium G450 (dual-head output supported on dual-headed cards)

• Millennium G400 (single-output only)

• Millennium G200 (single-output only)

Multiple displays are currently unsupported on quad-output cards.

Acceleration features
Feature Provision
Solid fills Yes
Pattern fills Yes
Onscreen blitting Yes

continued. . .

June 22, 2010 Utilities 301


devg-matroxg.so © 2010, QNX Software Systems GmbH & Co. KG.

Feature Provision
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Partial
Bitmaps No

Video Overlay/Scaler support


Feature Provision
YUV formats Yes (packed)
RGB formats Yes (RGB 555, 565, 8888)
Up scaling Yes
Down scaling No

Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes

Resolution and refresh support


Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60, 70, 75, 85 8, 15, 16, 32
800x600 60, 70, 75, 85 8, 15, 16, 32
1024x768 60, 70, 75, 85 8, 15, 16, 32
1152x864 60, 70, 75, 85 8, 15, 16, 32
1280x800 60, 70, 75, 85 8, 15, 16, 32
1280x1024 60, 70, 75, 85 8, 15, 16, 32
1440x900 60, 70, 75, 85 8, 15, 16, 32

continued. . .

302 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-matroxg.so

Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
1600x1200 60, 70, 75, 85 8, 15, 16, 32

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

See also:
io-display

June 22, 2010 Utilities 303


devg-poulsbo.so © 2010, QNX Software Systems GmbH & Co. KG.
Graphics driver for Intel Poulsbo chipsets

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
x86

Options:
For the general io-display options that you can use with this driver, see
io-display.
You can set configuration options that are specific to this driver by using the
modeopts setting in display.conf:

modeopts=config-file
The full path to the configuration file for the driver. For example,
poulsbo.conf is located in /usr/photon/config so that
modeopts=/usr/photon/config/poulsbo.conf.

Description:
The devg-poulsbo.so driver provides accelerated 2D and 3D support. You can edit
the configuration file to enable devg-poulsbo.so to run on your board.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Supported chipsets
• Intel Poulsbo System Controller Hub (SCH)

Acceleration features

Feature Provision
Solid fills Yes

continued. . .

304 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-poulsbo.so

Feature Provision
Bresenham lines Yes
Pattern fills Yes
Polygons Yes
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending Yes
Raster OP’s Full
Bitmaps No
Scaled blitting Yes

Video Overlay/Scaler support


None

Other features
Feature Provision
Hardware Cursor Yes
TV Out yes
Video capture No
DPMS (power saving) Yes
Layers 4a

Resolution and refresh support

Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
800 x 600 60 15, 16, 32
1024 x 768 60 15, 16, 32
1280 x 1024 60 15, 16, 32

Restrictions:

• These are typical values; the actual ones may depend on your video BIOS.

• Higher resolution and color depths may require more video RAM.

June 22, 2010 Utilities 305


devg-poulsbo.so © 2010, QNX Software Systems GmbH & Co. KG.

• Other resolutions and refresh rates may be available, but may require you to modify
poulsbo.conf.

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

See also:
io-display

306 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-radeon.so
Graphics driver for ATI RADEON chipsets

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
x86, PowerPC

Options:
For the general io-display options that you can use with this driver, see
io-display.

Description:
The devg-radeon.so driver provides accelerated 2D support for the specified
graphics chipsets.
The DVI (digital video interface) is enabled by default, so you can connect LCD
panels to your Radeon cards. The only requirement is that you connect the LCD to the
DVI connector at boot time so the video BIOS can set up the digital output.
Dual-headed display is supported on cards with dual outputs (x86 only). The video
BIOS initializes both outputs at boot time. Ensure that both outputs are connected.

• If you use devg-radeon.so with two cards that have the same vendor and device
IDs, the driver fails.

• Graphics drivers run at a higher priority than applications, but they shouldn’t run at
a higher priority than the audio, or else breaks in the audio occur. You can use the
on command to adjust the priorities of the audio and graphics drivers.

Supported chipsets
• RADEON

• RADEON VE

• RADEON 7500

• RADEON 8500

• RADEON 9000

• RADEON 9200

June 22, 2010 Utilities 307


devg-radeon.so © 2010, QNX Software Systems GmbH & Co. KG.

• RADEON 9500
• RADEON 9600

• RADEON 9700

• RADEON 9800

• RADEON x300

• RADEON x600

• RADEON MOBILITY M6

• RADEON MOBILITY M7

• RADEON MOBILITY M9

Acceleration features
Feature Provision
Solid fills Yes
Pattern fills Yes
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Full
Bitmaps No

Video Overlay/Scaler support


Feature Provision
YUV formats Yes (packed and planar)
RGB formats Yes (RGB 555, 565, 8888)
Up scaling Yes
Down scaling Yes

Other features
Feature Provision
Hardware Cursor Yes

continued. . .

308 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-radeon.so

Feature Provision
TV Out No
Video capture No
DPMS (power saving) Yes

Resolution and refresh support


Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60, 70, 75, 85 8, 15, 16, 32
800x600 60, 70, 75, 85 8, 15, 16, 32
1024x768 60, 70, 75, 85 8, 15, 16, 32
1152x864 60, 70, 75, 85 8, 15, 16, 32
1280x800 60, 70, 75, 85 8, 15, 16, 32
1280x1024 60, 70, 75, 85 8, 15, 16, 32
1440x900 60, 70, 75, 85 8, 15, 16, 32
1600x1200 60, 70, 75, 85 8, 15, 16, 32

Restrictions:

• On RADEON MOBILITY chipsets, resolutions and refresh rates are limited by


LCD.

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

See also:
io-display

June 22, 2010 Utilities 309


devg-rage.so © 2010, QNX Software Systems GmbH & Co. KG.
Graphics driver for ATI RAGE chipsets

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
x86

Options:
For the general io-display options that you can use with this driver, see
io-display.

Description:
The devg-rage.so driver provides accelerated 2D support for the specified graphics
chipsets.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Supported chipsets
• Mach 64 GT

• 3D RAGE

• 3D RAGE II

• 3D RAGE II+

• 3D RAGE PRO

• 3D RAGE PRO LT

• 3D RAGE MOBILITY M/M1/P

• RAGE XL

• RAGE XC

• RAGE IIC

310 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-rage.so

Acceleration features

Feature Provision
Solid fills Yes
Pattern fills Yes
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Partial
Bitmaps Yes

Video Overlay/Scaler support

Feature Provision
YUV formats Yes (packed and planar)
RGB formats Yes (RGB 555, 565, 8888)
Up scaling Yes
Down scaling Yes

Other features

Feature Provision
Hardware Cursor Yes
TV Out Yes (PAL and NTSC)
Video capture No
DPMS (power saving) Yes

Restrictions:

• TV Out provision depends on BIOS capability.

June 22, 2010 Utilities 311


devg-rage.so © 2010, QNX Software Systems GmbH & Co. KG.

Resolution and refresh support

Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60, 72, 75, 85 8, 15, 16, 24, 32
800x600 60, 72, 75, 85 8, 15, 16, 24, 32
1024x768 60, 70, 75, 85 8, 15, 16, 24, 32
1280x1024 60, 70, 75, 85 8, 15, 16, 24, 32

Restrictions:

• These are typical values; the actual ones may depend on your video BIOS.

• Higher resolution and color depths may require more video RAM.

Files:
This driver needs the following at runtime:

libffb.so Software rasterization library

See also:
io-display

312 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-s3_savage.so
Graphics driver for S3 Savage chipsets

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
x86

Options:
For the general io-display options that you can use with this driver, see
io-display.

Description:
The devg-s3_savage.so driver provides accelerated 2D support for the specified
graphics chipsets.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Supported chipsets
• S3 Savage4

• Integrated S3 Savage 2000

• VIA Twister T

Acceleration features
Feature Provision
Solid fills Yes
Pattern fills No
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes

continued. . .

June 22, 2010 Utilities 313


devg-s3_savage.so © 2010, QNX Software Systems GmbH & Co. KG.

Feature Provision
Alpha blending No
Raster OPs Partial
Bitmaps No

Video Overlay/Scaler support


Feature Provision
YUV formats Yes (packed)
RGB formats Yes (RGB 565, 8888)
Up scaling Yes
Down scaling No

Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes

Resolution and refresh support


Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60, 70, 75, 85 8, 15, 16, 32
800x600 60, 70, 75, 85 8, 15, 16, 32
1024x768 60, 70, 75, 85 8, 15, 16, 32
1152x864 60, 70, 75, 85 8, 15, 16, 32
1280x800 60, 70, 75, 85 8, 15, 16, 32
1280x1024 60, 70, 75, 85 8, 15, 16, 32
1440x900 60, 70, 75, 85 8, 15, 16, 32,
1600x1200 60, 70, 75, 85 8, 15, 16, 32

314 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-s3_savage.so

Files:
This driver needs the following at runtime:

libffb.so Software rasterization library

See also:
io-display

June 22, 2010 Utilities 315


devg-sis630.so © 2010, QNX Software Systems GmbH & Co. KG.
Graphics driver for SIS graphics chipsets

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
x86

Options:
For the general io-display options that you can use with this driver, see
io-display.
You can set configuration options that are specific to this driver by using the
modeopts setting in display.conf as follows:

modeopts=BIOS
Use video BIOS to detect and set the graphics mode.

Description:
The devg-sis630.so driver provides accelerated 2D support for graphics chips.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Supported chipsets
• SiS 300

• SiS 630

Acceleration features
Feature Provision
Solid fills Yes
Bresenham lines Yes
Pattern fills Yes

continued. . .

316 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-sis630.so

Feature Provision
Polygons No
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Full
Bitmaps Yes

Video Overlay/Scaler support


Feature Provision
YUV formats No
RGB formats No

Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes

Resolution and refresh support


Display size (pixels): Refresh rate(Hz): Color depth (bits per pixel):
640x480 60, 72, 75, 85 8, 15, 16, 32
800x600 60, 70, 75, 85 8, 15, 16, 32
1024x768 60, 70, 75, 85 8, 15, 16, 32
1152x864 60, 70, 75, 85 8, 15, 16, 32
1280x800 60, 72, 75, 85 8, 15, 16, 32
1280x1024 60, 72, 75, 85 8, 15, 16, 32
1440x900 60, 72, 75, 85 8, 15, 16, 32

continued. . .

June 22, 2010 Utilities 317


devg-sis630.so © 2010, QNX Software Systems GmbH & Co. KG.

Display size (pixels): Refresh rate(Hz): Color depth (bits per pixel):
1600x1200 60, 72, 75, 85 8, 15, 16, 32

Restrictions:

• These values are typical; the actual ones may depend on your BIOS and monitor.

• Higher resolutions and color depths may require more video RAM.

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

See also:
io-display

318 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-smi5xx.so
Graphics driver for Silicon Motion SM501 chipset

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
ARMLE, MIPSLE, PowerPC, SHLE, x86

Options:
For the general io-display options that you can use with this driver, see
io-display.
You can set configuration options that are specific to this driver by using the
modeopts setting in display.conf:

modeopts=config-file
The full path to the configuration file for the driver. For example smi5xx.conf
is located in /usr/photon/config by default so that
modeopts=/usr/photon/config/smi5xx.conf.

Description:
The devg-smi5xx.so driver provides accelerated 2D support for the Silicon Motion
SM501 graphics chip.
You can edit the configuration file to enable devg-smi5xx.so to run on your board.
Follow the editing instructions in the sample file,
/usr/photon/config/smi5xx.conf, to specify the correct configuration for the
required display mode. (For a more detailed explanation of the display settings, see the
appropriate Silicon Motion documentation.)
If you use a configuration file for this driver, you must use the modeopts setting in
your display.conf to specify its location.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

June 22, 2010 Utilities 319


devg-smi5xx.so © 2010, QNX Software Systems GmbH & Co. KG.

Supported chipsets

• Silicon Motion SM501 (Voyager GX)

Acceleration features
Feature Provision
Solid fills Yes
Bresenham lines Yes
Pattern fills Yes
Polygons No
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Full
Bitmaps Yes

Video Overlay/Scaler support


Feature Provision
YUV formats Yes
RGB formats Yes
Up scaling Yes
Down scaling Yes

Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes
Layers supported 4

continued. . .

320 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-smi5xx.so

Feature Provision
Dual display Yes

Resolution and refresh support


Display size (pixels): Refresh rate(Hz): Color depth (bits
640x480 60 8, 16, 32
800x600 60 8, 16, 32a
1024x768 60 8, 16, 32a

a Requires a driver configuration file.

You can use the driver configuration file to configure other resolutions and refresh
rates.

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

See also:
io-display
/usr/photon/config/smi5xx.conf

June 22, 2010 Utilities 321


devg-smi7xx.so © 2010, QNX Software Systems GmbH & Co. KG.
Graphics driver for Silicon Motion Lynx chipset

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
ARMLE, MIPS, PowerPC, x86, SH4

Options:
For the general io-display options that you can use with this driver, see
io-display.
You can set configuration options that are specific to this driver by using the
modeopts setting in display.conf:

modeopts=config-file
The full path to the configuration file for this driver. For example smi7xx.conf
is located in /usr/photon/config by default so that
modeopts=/usr/photon/config/smi7xx.conf.

Description:
The devg-smi7xx.so driver provides accelerated 2D support for the specified
graphics chipset.
You can edit the configuration file to enable devg-smi7xx.so to run on your board.
Follow the editing instructions in the sample file,
/usr/photon/config/smi7xx.conf, to specify the correct configuration for the
required display mode. (For a more detailed explanation of the display settings, see the
appropriate Silicon Motion documentation.)
If you use a configuration file for this driver, you must use the modeopts option in
your display.conf to specify its location.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

322 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-smi7xx.so

Supported chipsets

• Lynx3DM+ (SM721/SM722)

Acceleration features
Feature Provision
Solid fills Yes
Pattern fills No
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Full

Video Overlay/Scaler support


Feature Provision
YUV formats Yes
RGB formats Yes
Up scaling Yes
Down scaling No

Other features
Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) Yes
Layer Support 3 layers
Dual display No

June 22, 2010 Utilities 323


devg-smi7xx.so © 2010, QNX Software Systems GmbH & Co. KG.

Resolution and refresh support

Display size (pixels) Refresh rate(Hz) Color depth (bits per pixel)
640x480 60 8, 15, 16, 24
800x600 60 8, 15, 16, 24a
1024x768 60 8, 15, 16, 24a

a Requires a driver configuration file for non-x86 systems.

Restrictions:

• These are typical values; the actual ones may depend on your BIOS (x86) and
monitor. You can use the configuration file to set up other resolutions and refresh
rates.

• LCD output isn’t supported by default on non-x86 platforms.

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

See also:
io-display
/usr/photon/config/smi7xx.conf

324 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-soft3d.so
Software 3D graphics module

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
PowerPC, SHLE, x86

Options:
For the general io-display options that can be used with this driver, see
io-display.

Description:
The devg-soft3d.so module provides 3D support in software. It is used
automatically by io-display when it loads graphics drivers that don’t have 3D
accelleration in hardware. For example, it is used for the devg-vmware.so and
devg-vesabios.so drivers.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Supported chipsets
• all chipsets that don’t have 3D accelleration support

Acceleration features
None

See also:
io-display

June 22, 2010 Utilities 325


devg-soft3d-fixed.so © 2010, QNX Software Systems GmbH & Co. KG.
Software 3D graphics module

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
ARMLE

Options:
For the general io-display options that can be used with this driver, see
io-display.

Description:
The devg-soft3d-fixed.so module provides 3D support in software using
fixed-point math.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Supported chipsets
• all chipsets that don’t have 3D accelleration support

Acceleration features
None

See also:
io-display

326 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-svga.so
Generic graphics driver (SVGA)

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
x86

Options:
For the general io-display options that you can use with this driver, see
io-display.

Description:
The devg-svga.so driver provides support for the specified graphics chipsets.

• This is a “safe”, generic graphics driver. However, it can negatively impact the
timing of a system and affect realtime operations. We recommended you use an
accelerated driver instead, if at all possible.

• Graphics drivers run at a higher priority than applications, but they shouldn’t run at
a higher priority than the audio, or else breaks in the audio occur. You can use the
on command to adjust the priorities of the audio and graphics drivers.

Supported chipsets
• Super VGA chipsets compliant with Vesa 1.2 (or greater)

Acceleration features
None

Video Overlay/Scaler support


None

Other features

June 22, 2010 Utilities 327


devg-svga.so © 2010, QNX Software Systems GmbH & Co. KG.

Feature Provision
Hardware Cursor No
TV Out Yes (PAL and NTSC)
Video capture No
DPMS (power saving) Yes

Restrictions:

• TV Out provision depends on BIOS capability.

Resolution and refresh support

Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60 8, 15, 16
800x600 60 8, 15, 16
1024x768 60 8, 15, 16
1152x864 60 8, 15, 16
1280x1024 60 8, 15, 16
1600X1200 60 8, 15, 16

Restrictions:

• BIOS capability determines which of these resolutions and color depths are
available on your system.

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

See also:
io-display

328 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-tnt.so
Graphics driver for NVIDIA chipsets

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
x86

Options:
For the general io-display options that you can use with this driver, see
io-display.

Description:
The devg-tnt.so driver provides accelerated 2D support for the specified graphics
chipsets.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

Supported chipsets
• Riva 128

• Riva TNT

• Riva TNT 2

• GeForce

• GeForce2

• GeForce2 GO

Acceleration features

Feature Provision
Solid fills Yes

continued. . .

June 22, 2010 Utilities 329


devg-tnt.so © 2010, QNX Software Systems GmbH & Co. KG.

Feature Provision
Pattern fills Yes
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting No
Alpha blending No
Raster OPs Full
Bitmaps No

Video Overlay/Scaler support

Feature Provision
YUV formats Yes (packed)
RGB formats No
Up scaling Yes
Down scaling Yes

Restrictions:

• Video overlay is supported only on GeForce and GeForce2 chipsets (not including
GeForce2 GO).

Other features

Feature Provision
Hardware Cursor Yes
TV Out No
Video capture No
DPMS (power saving) No

Resolution and refresh support

330 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-tnt.so

Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60, 70, 75, 85 8, 15, 16, 32
800x600 60, 70, 75, 85 8, 15, 16, 32
1024x768 60, 70, 75, 85 8, 15, 16, 32
1152x864 60, 70, 75, 85 8, 15, 16, 32
1280x800 60, 70, 75, 85 8, 15, 16, 32
1280x1024 60, 70, 75, 85 8, 15, 16, 32
1440x900 60, 70, 75, 85 8, 15, 16, 32
1600X1200 60, 70, 75, 85 8, 15, 16, 32

Restrictions:

• For Riva 128, 16 bits-per-pixel is not supported.

• For flat panel support with GeForce2 GO, make sure the refresh rate is 60 Hz (the
default). The video BIOS capability determines which of these resolutions and
color depths are available on your system.

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

See also:
io-display

June 22, 2010 Utilities 331


devg-tvia.so © 2010, QNX Software Systems GmbH & Co. KG.
Graphics driver for TVIA CyberPro chipsets

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
MIPSLE, SHLE, x86

Options:
For the general io-display options that you can use with this driver, see
io-display.
You can set configuration options that are specific to this driver by using the modeopts
setting in display.conf:

modeopts=config-file
The full path to the configuration file for the driver. For example, tvia.conf is
located in /usr/photon/config by default so that the sample file is
/usr/photon/config/tvia.conf.

Description:
The devg-tvia.so driver provides accelerated 2D support for TVIA graphics
chipset.
On non-x86 systems, install jumper JP3 on the reference adapter.
You can edit the configuration file to enable devg-tvia.so to run on your board. For
more information on the options available, see the sample configuration file,
/usr/photon/config/tvia.conf.
If you use a configuration file for this driver, you must use the modeopts in your
display.conf to specify its location.

Graphics drivers run at a higher priority than applications, but they shouldn’t run at a
higher priority than the audio, or else breaks in the audio occur. You can use the on
command to adjust the priorities of the audio and graphics drivers.

332 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-tvia.so

Supported chipsets
• CyberPro 5200
• CyberPro 5250

• CyberPro 5300

• CyberPro 5305

• CyberPro 5350

• CyberPro 5355

Acceleration features

Feature Provision
Solid fills Yes
Bresenham lines No
Pattern fills Yes
Polygons No
Onscreen blitting Yes
Offscreen blitting Yes
Chroma-keyed blitting Yes
Alpha blending No
Raster OPs Full
Bitmaps Yes

Video Overlay/Scaler support

Feature Provision
YUV formats Yes (Packed)
RGB formats Yes (RGB 555, 565, 888, 8888)
Up scaling Yes
Down scaling No

Other features

June 22, 2010 Utilities 333


devg-tvia.so © 2010, QNX Software Systems GmbH & Co. KG.

Feature Provision
Hardware Cursor Yes
TV Out (PAL and NTSC) Yes
Video capture No
DPMS (power saving) Yes

Resolution and refresh support

Display size (pixels): Refresh rate(Hz): Color depth (bits per pixel):
640x480 60, 72, 75, 85 8, 15, 16, 24, 32
800x600 60, 70, 75, 85 8, 15, 16, 24, 32
1024x768 60, 70, 75, 85 8, 15, 16, 24, 32
1152x864 60, 70, 75, 85 8, 15, 16, 24, 32
1280x800 60, 72, 75, 85 8, 15, 16, 24, 32
1280x1024 60, 72, 75, 85 8, 15, 16, 24, 32
1440x900 60, 72, 75, 85 8, 15, 16, 24, 32
1600x1200 60, 72, 75, 85 8, 15, 16, 24, 32

Restrictions:

• Higher resolution and color depths may require more video RAM.

• When using TV OUT, refresh rates are not available.

• Resolutions above 1024x768 might not display data correctly because of an issue
with memory bandwidth.

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

See also:
io-display
/usr/photon/config/tvia.conf

334 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-vesabios.so
Generic graphics driver (VESA 2.0)

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
x86

Options:
For the general io-display options that you can use with this driver, see
io-display.

Description:
The devg-vesabios.so driver provides 2D support for the specified graphics
chipsets.

• This is a “safe”, generic graphics driver. However, it can negatively impact the
timing of a system and affect realtime operations. We recommended you use an
accelerated driver instead, if at all possible.

• Graphics drivers run at a higher priority than applications, but they shouldn’t run at
a higher priority than the audio, or else breaks in the audio occur. You can use the
on command to adjust the priorities of the audio and graphics drivers.

Supported chipsets
• Any video adapter compliant with VESA 2.0 (or greater)

Acceleration features
None

Video Overlay/Scaler support


None

Other features

June 22, 2010 Utilities 335


devg-vesabios.so © 2010, QNX Software Systems GmbH & Co. KG.

Feature Provision
Hardware Cursor No
TV Out Yes (see below)
Video capture No
DPMS (power saving) Yes

Restrictions:

• TV Out provision depends on BIOS capability.

Resolution and refresh support

Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60 8, 15, 16, 24, 32
800x600 60 8, 15, 16, 24, 32
1024x768 60 8, 15, 16, 24, 32
1152x864 60 8, 15, 16, 24, 32
1280x1024 60 8, 15, 16, 24, 32
1600X1200 60 8, 15, 16, 24, 32

Restrictions:

• BIOS capability determines which of these resolutions and color depths are
available on your system.

• Other refresh rates may be available if the BIOS is VESA 3.0.

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

See also:
io-display

336 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devg-vmware.so
Graphics driver for VMWare virtual machines

Syntax:
io-display [-vf]
-d vid=[0x]vendor_id,did=[0x]device_id[,deviceindex=index]
[-c config_file] [-p priority]

Runs on:
Neutrino

Targets:
x86

Options:
For the general io-display options that you can use with this driver, see
io-display.

Description:
The devg-vmware.so driver provides 2D support for machines running QNX
Neutrino on a VMware virtual machine.

• VirtualPC and VMWare require a Windows session that’s operating with 32-bit
graphics.

• Graphics drivers run at a higher priority than applications, but they shouldn’t run at
a higher priority than the audio, or else breaks in the audio occur. You can use the
on command to adjust the priorities of the audio and graphics drivers.

Supported chipsets
• VMware 5.0

Acceleration features
None

Video Overlay/Scaler support


None

Other features

June 22, 2010 Utilities 337


devg-vmware.so © 2010, QNX Software Systems GmbH & Co. KG.

Feature Provision
Hardware Cursor No
TV Out No
Video capture No
DPMS (power saving) Yes

Resolution and refresh support

Display size (pixels): Refresh rate (Hz): Color depth (bits per pixel):
640x480 60 16, 24, 32
800x600 60 16, 24, 32
1024x768 60 16, 24, 32
1280x1024 60 16, 24, 32
1600X1200 60 16, 24, 32

Restrictions:

• BIOS capability determines which of these resolutions and color depths are
available on your system.

Files:
This driver needs the following at run time:

libffb.so Software rasterization library.

Caveats:
VMWare sessions default to resolution 1024x768 with color depth argb8888. This
setting is forced in the enumerator file located in the following folder:
/etc/system/enum/devices/graphics
To change the host’s default resolution setting, you can modify the value in the
enumerator file.

See also:
io-display

338 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devh-egalax.so
Driver for USB Egalax touch devices

Syntax:
io-hid -d egalax [option[,option ...]] ... &

Runs on:
Neutrino

Options:
Use commas, not spaces, to separate the options.

device=0xXXXX Pass in an alternative device ID.

info Gather more information on the controller. This is only for


general information purposes and simply sends the information
to slogger.

noinit Don’t initialize the controller.

Don’t use this option unless you’re certain that the default protocol your controller is
using is the Egalax protocol.

upath=path The USB stack path; the default is /dev/io-usb/io-usb.

vendor=0xXXXX Pass in an alternative vendor ID.

verbose=level Be verbose and specify the level of debug information (range


1-5).

wait=num The number of seconds to wait for the USB stack to come up.

Description:
The Egalax touchscreens aren’t HID-compliant, so the devh-egalax.so DLL
converts Egalax native controller packets into generic HID packets, which devi-hid
then handles.

If you’re using this driver with the USB (devh-usb.so) module, you must specify
the igndev option to devh-usb.so, specifying the Egalax vendor and device IDs.

Examples:
Start io-hid using the Egalax driver, and then start devi-hid:

io-hid -d egalax &


devi-hid touch

June 22, 2010 Utilities 339


devh-egalax.so © 2010, QNX Software Systems GmbH & Co. KG.

Start io-hid using the Egalax driver at high verbosity and with a new stack path:

io-hid -d egalax verbose=5,upath=/dev/payton-usb/ &

Files:
devh-egalax.so
The devh-egalax.so DLL is normally found in /lib/dll.

See also:
devh-*, devh-usb.so, devi-hid, diskboot, io-hid

340 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devh-microtouch.so
Driver for Microtouch EXII USB touch devices

Syntax:
io-hid -d microtouch [option[,option ...]] ... &

Runs on:
Neutrino

Options:
Use commas, not spaces, to separate the options.

did=0xXXXX The device ID.

noscaling Disable coordinate scaling. The coordinates are normally scaled


down to 14-bit values, due to an issue with the upper layers of the
input driver sharing a data type from Photon that uses signed
short values.
Since the touchscreen has a resolution of 16 bits, a short isn’t
big enough to handle the data correctly. If the client is the
resource manager interface (composition manager) and not the
Advanced Graphics or Photon system, then you can specify the
noscaling option as it bypasses the short values.

upath=path The USB stack path; the default is /dev/io-usb/io-usb.

verbose=level Be verbose and specify the level of debug information (range 1-5).

vid=0xXXXX The vendor ID.

wait=num The number of seconds to wait for the USB stack to come up.

Description:
The devh-microtouch.so DLL converts Microtouch EXII packets into generic
HID packets, which devi-hid then handles.

Examples:
Start io-hid using the Microtouch driver, and then start devi-hid:
io-hid -d microtouch &
devi-hid touch

Start io-hid using the Microtouch driver at high verbosity and with a new stack path
and a new device ID:
io-hid -d microtouch did=0x1234,verbose=5,upath=/dev/huxley-usb/ &

June 22, 2010 Utilities 341


devh-microtouch.so © 2010, QNX Software Systems GmbH & Co. KG.

Files:
devh-microtouch.so
The devh-microtouch.so DLL is normally found in /lib/dll.

See also:
devh-*, devh-usb.so, devi-hid, diskboot, io-hid

342 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devh-ps2ser.so
Driver for serial and PS2 human interface devices (HID)

Syntax:
io-hid -d ps2ser
protocol_module[,options]:device_module[,options]
[:protocol_module[,options]:device_module[,options]]...
[opts=v[v...]]

Runs on:
Neutrino

Options:
Colons (:) separate modules; commas (,) separate module options.

opts=v[v...] Increment verbosity. The default is zero verbosity.

protocol_module[,options]
The input protocol module. You can specify multiple
protocol/device module pairs.
The protocol_module variable may be any one of the following
modules:

ps2mouse Regular PS/2 mouse. There are no options.


msoft[,options]... Mouse compatible with Microsoft/IntelliMouse
protocol (serial). Options:
• b=baud — Baud rate for serial device
(default 1200)
• 3 — Microsoft 3 button mouse
• R — Don’t reset mouse (the default is to
reset the mouse)
• i — IntelliMouse protocol (wheel mice)
msys[,options]... Mouse compatible with Mouse Systems mouse
protocol (used by Logitech). Options:
• b=baud — Baud rate for serial device
(default 1200)
• R — Don’t reset mouse (default reset mouse)
kbd[,options]... Scan codes for primary keyboard. Options:
• k=(rate[,delay]) — Keyboard rate (Hz),
delay (ms). If you continually depress a key,
after delay milliseconds, it will input data
rate times a second. The default is 30Hz
after 500ms. This only works in conjunction
with the kbddev device module.

June 22, 2010 Utilities 343


devh-ps2ser.so © 2010, QNX Software Systems GmbH & Co. KG.

• R — Don’t reset the device while doing a


protocol reset
• r — Reset the device while doing a protocol
reset
• s — The device driver should supply valid
symbols

device_module[,options]
Device modules. The device_module variable depends on the
protocol_module specified. The following device modules are
supported:

fd[,options]... Opens a device via the open() function.


Options:
• d=device — The device to open fd() on
(default /dev/ser1)
• s — Specifies that the input interface is
serial (this allows the module to use some
devctl commands that are specific to a
serial port)
• P — The processing priority for this input
event
uart[,options]... Enables direct access to 8250, 16450, and
16550 uarts. Options:
• i=irq — IRQ number for the serial device
(default 4)
• p=ioport — The port of the serial device
(default 3f8)
• 1 — Use COM1
• 2 — Use COM2
• P — The processing priority for this input
event
kbddev[,options]... For PS2 keyboard. Options:
• f=filename — Create the named file and
collect all data passed to the protocol level
(debug only)
• i=irq — IRQ number (default 1)
• p=(ioport,add) — Port address (default
0x60), and a value to add to get the status
port address (default 4: 0x60 + 4 = 0x64)
• r — Reset the device on initiation
• P priority — The processing priority for
keyboard events

344 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devh-ps2ser.so

mousedev[,options]...
For PS2 mouse. Options:
• f=filename — Create the named file and
collect all data passed to the protocol level
(debug only)
• i=irq — IRQ number (default 12)
• p=(ioport,add) — Port address (default
0x60), and a value to add to get the status
port address (default 4: 0x60 + 4 = 0x64)
• r — Reset the device on initiation
• P priority — The processing priority for
mouse events

Description:
The devh-ps2ser.so DLL provides io-hid with HID information. The DLL
collects raw data from a variety of legacy devices (e.g. PS2 keyboards, and PS2 and
serial mice), transforms it to unified USB HID report format, and then sends the data
to io-hid. The io-hid manager forwards the data to devi-hid.
The devh-ps2ser.so DLL is usually started by io-hid in the system startup
procedure (see diskboot).

• The devh-ps2ser.so DLL is the low-level part of the input channel. You have to
start devh-usb.so to provide any top-level services required.

• If you press several keys at once on some Microsoft keyboards, the keyboard
doesn’t produce any indication when you release the keys. As a result, the input
driver thinks you’re still holding the keys down. For more information, see
http://support.microsoft.com/kb/909528/en-us.

Examples:
Start a regular PS/2 mouse, a Microsoft/IntelliMouse serial mouse on COM1, and a
PS/2 keyboard:

io-hid -d ps2ser ps2mouse:mousedev:msoft:uart,1:kbd:kbddev

Files:
devh-ps2ser.so
The devh-ps2ser.so Dll is normally found in /lib/dll.

June 22, 2010 Utilities 345


devh-ps2ser.so © 2010, QNX Software Systems GmbH & Co. KG.

Errors:
If an error occurs in devh-ps2ser.so, the keyboard will not work in text mode. If
you specify at least one v option, details of driver activity will be reported on the
console screen and will be appended to the system log; for more detail, increase the
verbosity level.

See also:
devh-*, devi-hid, devh-usb.so, diskboot, io-hid.

346 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devh-touchintl.so
Driver for USB Touch International touch devices

Syntax:
io-hid -d touchintl [option[,option ...]] ... &

Runs on:
Neutrino

Options:
Use commas, not spaces, to separate the options.

did=0xXXXX The device ID.


noinit Don’t initialize the controller.
rate=rate The coordinate output rate, in the range 1–7:
• 1 — kiosk mode; data is sent only on a touch, not on a drag.
• 2 — 30 pps (points per second)
• 3 — 50 pps
• 4 — 80 pps (the default value)
• 5 — 100 pps
• 6 — 130 pps
• 7 — 150 pps
upath=path The USB stack path; the default is /dev/io-usb/io-usb.
verbose=level Be verbose and specify the level of debug information (range 1-5).
vid=0xXXXX The vendor ID.
wait=num The number of seconds to wait for the USB stack to come up.

Description:
The Touch International touchscreens aren’t HID-compliant, so the
devh-touchintl.so DLL converts touchintl native controller packets into generic
HID packets, which devi-hid then handles.

Examples:
Start io-hid using the Touch International driver, and then start devi-hid:
io-hid -d touchintl &
devi-hid touch
Start io-hid using the Touch International driver at high verbosity and with a new
stack path and a new device ID, at a data rate of 100 packets per second:
io-hid -d egalax did=0x1234,rate=4,verbose=5,upath=/dev/payton-usb/ &

June 22, 2010 Utilities 347


devh-touchintl.so © 2010, QNX Software Systems GmbH & Co. KG.

Files:
devh-touchintl.so
The devh-touchintl.so DLL is normally found in /lib/dll.

See also:
devh-*, devi-hid, devh-usb.so, diskboot, io-hid

348 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devh-usb.so
Driver for USB-compliant human interface devices (HID)

Syntax:
io-hid -d usb [option[,option ...]] ... &

io-hid -d usb [option[,option ...]] ...

Runs on:
Neutrino

Options:
igndev=vid[:did]
Don’t attach to the HID device matching the given vendor and device
IDs. The vid and did must be hexadecimal vendor and product IDs
(e.g. igndev=0x1234:0x5678), as reported by the usb utility.
You can use the igndev option to ignore specific USB HID devices.
This allows another USB driver to attach and manage the device. You
can specify multiple igndev options.
The did also supports pattern matching to let you specify a range for
device IDs for a particular vendor; see the examples below.

upath The USB stack path. The default is /dev/io-usb/io-usb

verbose Be verbose.

wait=num The number of seconds to wait for the USB stack to come up.

Description:
The devh-usb.so is a DLL which is used with the io-hid manager. It connects to
the USB stack to give HID clients access to USB-compliant human interface devices.

Run the USB stack first. Please refer to io-usb for further information.

Examples:
Start io-hid using the USB HID driver and manage all USB HID devices:
io-hid -d usb &

or:
io-hid &
mount -Tio-hid devh-usb.so

Ignore all devices for a specific vendor:


io-hid -dusb igndev=0x1234

June 22, 2010 Utilities 349


devh-usb.so © 2010, QNX Software Systems GmbH & Co. KG.

Ignore a specific device for a specific vendor:

io-hid -dusb igndev=0x1234:0x5678

Ignore a range of devices for a specific vendor:

io-hid -dusb igndev=0x1234:0x5???

See also:
devh-ps2ser.so. devh-*, hidview, io-hid, io-usb, usb

350 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devi-dyna
Dyna input manager for Photon

Syntax:
devi-dyna [general_opts]
protocol* [protocol_opts]*
device* [device_opts]*
filter* [filter_opts]*

Runs on:
Neutrino

Options:
When you use a devi-* driver for a touchscreen device, you need a calibration file.
The calibration file is generated from the output produced by the calib utility:

calib > calib_file.txt

For more information, see the calib utility in the Utilities Reference, and
Touchscreens in the Neutrino User’s Guide.

General options:

-b Prevent the use of the Ctrl-Alt-Shift-Backspace keychord to exit


Photon (permitted by default).

-d device Device (default: /dev/photon or $PHOTON).

-g input_group Input group (default: 1).

-l List the internal modules. Modules are listed in the following


format where class is one of: D — Device, P — Protocol, or F
— Filter:
module name | date compiled | revision | class

-t factor The throttle factor in ms (default 0).

-v[v]... Verbose output. More v characters cause more verbosity.

The protocol and protocol_opts are:

dyna [dyna_opts] [fd fd_opts]|[uart uart_opts]


The protocol modules and their options are:

• dyna — Dyna SC3 protocol

-b baud Baud rate (default 2400)

June 22, 2010 Utilities 351


devi-dyna © 2010, QNX Software Systems GmbH & Co. KG.

The device modules and their options are:

• fd — open a device via open().

-d device The device to open fd on (default /dev/ser1).

• uart — access the 8250/16450/16550 UART directly.

-i irq The IRQ for the serial device (default 4).


-p ioport The port of the serial device (default 3f8).

The filter modules and their options are:

• abs — transform and compress absolute coordinate “touch” events.

-b Touching the screen is a right mouse button (default left).


-c Calibrate mode; don’t transform coordinates.
-f filename The calibration filename.
-o x,y The origin of the display region (default: the origin of the graphics
region).
-s x,y The coordinates of the lower right corner of the display region
(default: the width and height of the graphics region).

Description:
The devi-dyna command starts the Dyna input manager for Photon.

Examples:
Connect the Dyna controller to the first serial port:

devi-dyna dyna fd -d/dev/ser1 abs -b

See also:
devi-*, inputtrap

352 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devi-elo
Elographics input manager for Photon

Syntax:
devi-elo [general_opts]
protocol* [protocol_opts]*
device* [device_opts]*
filter* [filter_opts]*

Runs on:
Neutrino

Options:
When you use a devi-* driver for a touchscreen device, you need a calibration file.
The calibration file is generated from the output produced by the calib utility:

calib > calib_file.txt

For more information, see the calib utility in the Utilities Reference, and
Touchscreens in the Neutrino User’s Guide.

General options:

-b Prevent the use of the Ctrl-Alt-Shift-Backspace keychord to exit


Photon (permitted by default).

-d device Device (default: /dev/photon or $PHOTON).

-G A graphics driver isn’t requires when starting a touchscreen


driver. This option is useful when you’re debugging.

-g input_group Input group (default: 1).

-l List the internal modules. Modules are listed in the following


format where class is one of: D — Device, P — Protocol, or F
— Filter:

module name | date compiled | revision | class

-v[v]... Verbose output. More v characters cause more verbosity.

The protocol and protocol_opts are:

smartset [smartset_opts] [fd fd_opts]|[uart uart_opts]

The protocol modules and their options are:

• smartset — Elographics smartset protocol

June 22, 2010 Utilities 353


devi-elo © 2010, QNX Software Systems GmbH & Co. KG.

-b baud Baud rate (default 9600)


-R Don’t reset the device (default: reset it).

The device modules and their options are:

• fd — open a device via open().

-d device The device to open fd on (default /dev/ser1).


-s The input interface is serial (i.e. the module can use devctl()
commands that are specific to a serial port).

• uart — access the 8250/16450/16550 UART directly.

-1 Use COM1.
-2 Use COM2.
-i irq The IRQ for the serial device (default 4).
-p ioport The port of the serial device (default 3f8).

The filter modules and their options are:

• abs — transform and compress absolute coordinate “touch” events.

-b Touching the screen is a right mouse button (default left).


-c Calibrate mode; don’t transform coordinates.
-f filename The calibration filename.
-o x,y The origin of the display region (default: the origin of the graphics
region).
-s x,y The coordinates of the lower right corner of the display region
(default: the width and height of the graphics region).
-x Reverse the x coordinates.
-y Reverse the y coordinates.

Description:
The devi-elo command starts the Elographics input manager for Photon.

Examples:
Connect the Smartset controller to the first serial port. Use the serial manager to get
input data. Touching the screen emulates a right mouse button press:

devi-elo smartset fd -d/dev/ser1 abs -b

354 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devi-elo

See also:
devi-*, inputtrap

June 22, 2010 Utilities 355


devi-hid © 2010, QNX Software Systems GmbH & Co. KG.
Universal Photon input manager for keyboards and mice

Syntax:
devi-hid [general_opts]
protocol* [protocol_opts]*
filter* [filter_opts]*

Runs on:
Neutrino

Targets:
Any supported platform that has io-hid running.

Options:
General options:

-b Prevent the use of the Ctrl-Alt-Shift-Backspace keychord to exit


Photon (permitted by default).

-d device Device (default: /dev/photon or the $PHOTON environment


variable).

-g input_group Input group (default: 1).

-l List the internal modules. Modules are listed in the following


format where class may be P (protocol) or F (filter):
module name | date last compiled | revision | class

-P Disable Photon interface. The default is to start the Photon


interface.

-r Start resource manager interface (only use if not using Photon).

-v[v]... Verbose output. More v characters cause more verbosity.

The protocol modules and their options are:

• kbd — keyboard scan codes (connected to primary keyboard)

-k rate[,delay] Keyboard rate (Hz),delay (ms). If you continually depress a key,


after delay milliseconds, it will input data rate times a second.
The default is 150Hz after 500ms.
-u device Optional, USB device number.

• mouse — common mouse protocol (no options)

356 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devi-hid

The filter modules and their options are:

• keyboard — translate scan codes to UNICODE

-k kbd_file The file to use to map the keyboard to support international


languages or alternate layouts, such as Dvorak. The default location
for these files is /usr/photon/keyboard; to create a keyboard
mapping, use mkkbd.

• rel — filters and compresses relative coordinates of mouse events

-a Wheel acceleration parameter (default 10); the higher this value,


the faster the mouse wheel acceleration.
-G gain Motion multiplier (default 1).
-l Swap right and left buttons.
-T threshold Speed-doubling threshold in mickeys/second. If the mouse speed
exceeds this threshold, the cursor will move twice as far as it
normally does per mickey. (A mickey is the smallest amount of
motion the mouse can detect.) The default threshold is 100.
-x Reverse X.
-y Reverse Y.

Description:
This manager is a universal Photon input daemon for keyboards and mice. It is a client
of io-hid, the HID server.
Usually, inputtrap starts devi-hid during the Photon startup procedure; for test
and other purposes, you may also start this manager in text mode as a resource
manager.

The io-hid resource manager must be running before devi-hid can start.

This manager doesn’t need information about the physical interfaces of real devices: it
relies on service from the io-hid resource manager and supplementary input
modules. The devi-hid daemon takes data in the form of HID reports, transforms
the data into Photon events, and then emits these events to Photon. It provides
multi-language support for keyboard input.
If you specify the verbosity option, activity messages are sent to the console screen
and to the system log. Data is normally sent to Photon, alternatively, in resource
manager mode (-r option), data can be sent to devices (by default,
/dev/devi/keyboard0 and /dev/devi/mouse0).

June 22, 2010 Utilities 357


devi-hid © 2010, QNX Software Systems GmbH & Co. KG.

Examples:
Typical command line to start the keyboard and mouse manager:

devi-hid kbd mouse

Files:
devi-hid Normally in /usr/photon/bin.

libhiddi.so Used by devi-hid

Errors:
If an error occurs in starting devi-hid, the keyboard or mouse will not work in
Photon and Photon won’t be able to start. If you specify at least one v option, activity
details will be reported on the console screen and will be appended to the system log;
for more detail, increase the verbosity level.

See also:
inputtrap, mkkbd.

358 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devi-hirun
Photon “high-runner” input manager

Syntax:
devi-hirun [-bdglPr] [-v[v]...]
protocol [protocol_opts...]
[protocol [protocol_opts...]]...
[device [device_opts...]]...
[filter [filter_opts...]]...

Runs on:
Neutrino

Options:
When you use a devi-* driver for a touchscreen, you need a calibration file. The
calibration file is generated from the output produced by the calib utility:

calib > calib_file.txt

For more information, see the calib utility in the Utilities Reference, and
Touchscreens in the Neutrino User’s Guide.

-b Prevent the use of the Ctrl-Alt-Shift-Backspace keychord to exit


Photon (permitted by default).

-d device Device (default: /dev/photon or $PHOTON).

-g input_group Input group (default: 1).

-l List the internal modules. Modules are listed in the following


format:
module name | date last compiled | revision | class

where class is one of: D — Device, P — Protocol, or F — Filter:

-P Disable the Photon interface (by default, start Photon).

-r Start the resource manager interface. Use this option only if


you’re not using Photon.

-v[v]... Verbose output. More v characters cause more verbosity.

protocol [protocol_opts...]
The protocols and their options are:

kbd [options] Keyboard scan codes (connected to primary keyboard).


Options:

June 22, 2010 Utilities 359


devi-hirun © 2010, QNX Software Systems GmbH & Co. KG.

-f filename Create the given file and collect all data passed to
the filter level (for debug only).
-k rate[,delay] Keyboard rate (Hz), delay (ms). The default is
30Hz, 500ms).

The -k option works only in conjunction with the kbddev device module.

-p filename Create and open the given FIFO file and duplicate
all data passed to the filter level (for debug only)
-R Don’t reset the device while resetting the protocol.
-r Reset the keyboard (the default).
-s The device driver should supply valid symbols.

Devices supported: fd, kbddev


msoft [-3] [-b baud] [-i][-R]
Microsoft-compatible mouse protocol (serial).
Options:

-3 Microsoft 3-button mouse.


-b baud Baud rate for serial device (default: 1200).
-i Intellimouse mice with wheels.
-R Don’t reset mouse (default: reset mouse).

Devices supported: fd, uart

msys [-b baud] [-R]


Mouse Systems mouse protocol (used by Logitech).
Options:

-b baud Baud rate for serial device (default: 1200).


-R Don’t reset the mouse (default: reset it).

Devices supported: fd, uart

ps2 IBM PS/2 mouse protocol.


Devices supported: mousedev

All serial devices use 8 data bits, 1 stop bit, and no parity.

360 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devi-hirun

device [device_opts...]
The devices and their options are:

fd [-d device] [-s] Opens a device via open().


Options:

-d device The device to open fd on (default: /dev/ser1).


-P The processing priority of the input event.
-s The input interface is serial (i.e. the module can use
devctl() commands that are specific to a serial port).

kbddev [options] PS2 keyboard.


Options:

-i irq IRQ (default: 1).


-f filename Create the given file and collect all data passed
to the protocol level (for debug only).
-P The processing priority of the keyboard event.
-p ioport,add The port (default: 0x60) and a value to add to
get the status (default: 4).
-r Reset the keyboard port. This is useful on
hardware with no BIOS (e.g. PowerPC, MIPS).

mousedev [options] PS2 mouse.


Options:

-f filename Create the given file and collect all data passed
to the protocol level (for debug only).
-i irq IRQ (default: 12).
-P The processing priority of the mouse event.
-p ioport,add The port (default: 0x60) and a value to add to
get the status (default: 4).
-r Reset the mouse port. This is useful on
hardware with no BIOS (e.g. PowerPC, MIPS).

If you specify both kbddev and mousedev options in the command line, and you use
non-standard port numbers, you must define the same port number values for each
module.
uart [options] Accesses 8250/16450/16550 UART directly.
Options:

-1 Use COM1.

June 22, 2010 Utilities 361


devi-hirun © 2010, QNX Software Systems GmbH & Co. KG.

-2 Use COM2.
-i irq IRQ for serial device (default: 4).
-P The processing priority of the input event.
-p ioport Port of serial device (default: 3f8).

filter [filter_opts...]
The filters and their options are:

keyboard [-k kbd_file]


Translate scan codes to Unicode.
Options:

-k kbd_file The file to use to map the keyboard to support


international languages or alternate layouts, such as
Dvorak. The default location for these files is
/usr/photon/keyboard; to create a keyboard
mapping, use mkkbd.

rel [options] Filter and compress relative coordinate “mouse” events.


Options:

-a value The wheel-acceleration parameter (default 10); the


higher this value, the faster the mouse wheel
acceleration.
-G gain Motion multiplier (default: 1).
-l (“el”) Swap the right and left buttons.
-T threshold Speed-doubling threshold in mickeys (100).
-x Reverse X.
-y Reverse Y.

Description:
The devi-hirun driver serves as the “high-runner” (i.e. the most likely) input driver
for Photon. The inputtrap utility detects drivers and starts devi-hirun.
The devi-hirun driver is responsible for taking data from an input device such as a
mouse, or keyboard, interpreting the data, and then “doing” something with it. The
default behavior is to package the data as an event and inject it into the Photon event
space.
The devi-hirun driver uses a layered approach to driver design:

• filter layer

• protocol layer

362 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devi-hirun

• device layer

At each layer, data is interpreted/modified and passed up to the next layer until it’s
injected as an event into the Photon event space.
For each device devi-hirun talks to, there’s a separate path through the three layers
called an event bus line. An event bus line consists of modules, one representing each
layer, linked together by a software bus. As data is passed up the layers via the bus, the
data is manipulated by each module into a format recognizable by the next layer’s
module and so on.
It’s important to note that you can run as many instances of devi-hirun as you want,
one for each device. Or you can run one devi-hirun for all the devices. Choosing
which scenario to use is mostly a matter of convenience.

Examples:
If inputtrap detects a serial Microsoft mouse and a keyboard interfaced through the
file descriptor provided by opening /dev/kbd, it invokes devi-hirun like this:

devi-hirun kbd fd -d/dev/kbd msoft fd &

If inputtrap detects a PS/2 mouse interfaced through the auxiliary port on the
keyboard controller (mousedev) and a keyboard interfaced through the primary
keyboard port on the keyboard controller (kbddev), it invokes devi-hirun like this:

devi-hirun kbd kbddev ps2 mousedev &

See also:
devi-*, inputtrap
Connecting Hardware in the Neutrino User’s Guide

June 22, 2010 Utilities 363


devi-microtouch © 2010, QNX Software Systems GmbH & Co. KG.
Microtouch input manager for Photon

Syntax:
devi-microtouch [general_opts]
protocol* [protocol_opts]*
device* [device_opts]*
filter* [filter_opts]*

Runs on:
Neutrino

Options:
When you use a devi-* driver for a touchscreen device, you need a calibration file.
The calibration file is generated from the output produced by the calib utility:

calib > calib_file.txt

For more information, see the calib utility in the Utilities Reference, and
Touchscreens in the Neutrino User’s Guide.

General options:

-b Prevent the use of the Ctrl-Alt-Shift-Backspace keychord to exit


Photon (permitted by default).

-d device Device (default: /dev/photon or $PHOTON).

-G Specify that a graphics driver isn’t required when starting a


touchscreen driver. This option is useful when you’re debugging.

-g input_group Input group (default: 1).

-l List the internal modules. Modules are listed in the following


format where class is one of: D — Device, P — Protocol, or F
— Filter:

module name | date compiled | revision | class

-P Disable the Photon interface (it’s started by default).

-r Start the resource manager interface (use this option only if you
aren’t using Photon).

-v[v]... Verbose output. More v characters cause more verbosity.

The protocol and protocol_opts are:

364 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devi-microtouch

microtouch [microtouch_opts] [fd fd_opts]


|[uart uart_opts]|[touchdev touchdev_opts]
[touchusb touchusb_opts]_

The protocol modules and their options are:

• microtouch — Microtouch (uses Tablet Format)

-b baud Baud rate (default 9600)


-R Don’t reset the device (default: reset it).

The device modules and their options are:

• fd — open a device via open().

-d device The device to open fd on (default /dev/ser1).


-s The input interface is serial (i.e. the module can use devctl()
commands that are specific to a serial port).

• uart — access the 8250/16450/16550 UART directly.

-1 Use COM1.
-2 Use COM2.
-i irq The IRQ for the serial device (default 4).
-p ioport The port of the serial device (default 3f8).

• touchdev — communicate with device via the PS2 port.

-f Work with a finger.


-i irq The IRQ for the serial device (default 1).
-l logical port The port is 0 if the device is connected to the PS2 keyboard
port; the port is 1 if the device is connected to the PS2 mouse
port (default).

If you want to specify the -l parameter in the touchdev module, you must place it
before any other parameter.
-n Work with a pen (the default).
-p ioport,add The port of the serial device (default 0x60), and a value to add
to get the status.

• touchusb — communicate with device via the USB controller.

-f Work with a finger.


-n Work with a pen (the default).
-s Use the SC protocol (SC400, SC500 & SC800 controllers).
-u device Specify the USB device number.

June 22, 2010 Utilities 365


devi-microtouch © 2010, QNX Software Systems GmbH & Co. KG.

If you use the touchdev module, you must disable the standard mouse/keyboard
driver devi-hirun PS2 mouse module.
You can do this by creating a /etc/config/trap/input[.hostname] file with one
of the following strings:
- If you use a serial mouse, use:
kbd kbddev msoft fd -d /dev/serN

- If you don’t use a mouse, use:


kbd kbddev

The filter modules and their options are:

• abs — transform and compress absolute coordinate “touch” events.

-b Touching the screen is a right mouse button (default left).


-c Calibrate mode; don’t transform coordinates.
-f filename The calibration filename.
-o x,y The origin of the display region (default: the origin of the graphics
region).
-s x,y The coordinates of the lower right corner of the display region
(default: the width and height of the graphics region).
-x Reverse the x coordinates.
-y Reverse the y coordinates.

Description:
The devi-microtouch command starts the Microtouch input manager for Photon.

Examples:
Connect a Microtouch controller to first serial port:

devi-microtouch microtouch fd -d/dev/ser1 abs -b

See also:
devi-*, inputtrap

366 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devi-semtech
Semtech input manager for Photon

Syntax:
devi-semtech [general_opts]
protocol* [protocol_opts]*
device* [device_opts]*
filter* [filter_opts]*

Runs on:
Neutrino

Options:
When you use a devi-* driver for a touchscreen device, you need a calibration file.
The calibration file is generated from the output produced by the calib utility:

calib > calib_file.txt

For more information, see the calib utility in the Utilities Reference, and
Touchscreens in the Neutrino User’s Guide.

General options:

-b Prevent the use of the Ctrl-Alt-Shift-Backspace keychord to exit


Photon (permitted by default).

-d device Device (default: /dev/photon or $PHOTON).

-G Don’t require the presence of a graphics driver when starting up a


touchscreen driver; useful in debug mode.

-g input_group Input group (default: 1).

-l List the internal modules. Modules are listed in the following


format, where class is one of: D — Device, P — Protocol, or F
— Filter:
module name | date compiled | revision | class

-P Disable the Photon interface (it’s started by default).

-r Start the resource manager interface (only use if you aren’t using
Photon).

-v[v]... Verbose output. More v characters cause more verbosity.

The protocol and protocol_opts are:

semtech [semtech_opts] [fd fd_opts]

June 22, 2010 Utilities 367


devi-semtech © 2010, QNX Software Systems GmbH & Co. KG.

The protocol modules and their options are:

• semtech — Semtech protocol

-b baud Baud rate (default 119200)


-R Don’t reset the device (the default is to reset it).

The device modules and their options are:

• fd — open a device via open().

-d device The device to open fd on (default /dev/ser1).


-s The input interface is serial (being aware that the module is able to
use some devctl() commands specific to serial ports).

The filter modules and their options are:

• abs — transform and compress absolute coordinate “touch” events.

-b Touching the screen is a right mouse button (default left).


-c Calibrate mode; don’t transform coordinates.
-f filename The calibration filename.
-o x,y The origin of the display region (default: the origin of the graphics
region).
-s x,y The coordinates of the lower right corner of the display region
(default: the width and height of the graphics region).
-x Reverse X.
-y Reverse Y.

Description:
The devi-semtech command starts the Semtech input manager for Photon.

Examples:
Connect the Semtech controller to the first serial port:

devi-semtech semtech fd -d/dev/ser1 abs -b

See also:
devi-*, inputtrap

368 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devi-zytronic
Zytronic input manager for Photon

Syntax:
devi-zytronic [general_opts]
protocol* [protocol_opts]*
device* [device_opts]*
filter* [filter_opts]*

Runs on:
Neutrino

Options:
When you use a devi-* driver for a touchscreen device, you need a calibration file.
The calibration file is generated from the output produced by the calib utility:

calib > calib_file.txt

For more information, see the calib utility in the Utilities Reference, and
Touchscreens in the Neutrino User’s Guide.

General options:

-b Prevent the use of the Ctrl-Alt-Shift-Backspace keychord to exit


Photon (permitted by default).

-d device Device (default: /dev/photon or $PHOTON).

-G Don’t require the presence of a graphics driver when starting up a


touchscreen driver; useful in debug mode.

-g input_group Input group (default: 1).

-l List the internal modules. Modules are listed in the following


format, where class is one of: D — Device, P — Protocol, or F
— Filter:
module name | date compiled | revision | class

-P Disable the Photon interface (it’s started by default).

-r Start the resource manager interface (only use if you aren’t using
Photon).

-v[v]... Verbose output. More v characters cause more verbosity.

The protocol and protocol_opts are:

zytronic [zytronic_opts] [fd fd_opts]

June 22, 2010 Utilities 369


devi-zytronic © 2010, QNX Software Systems GmbH & Co. KG.

The protocol modules and their options are:

• zytronic — Zytronic protocol

-a averaging The number of frames for x-y averaging, in the range from 0
through 9. The default is 9. This effects the accuracy of each
touch (0 is less accurate, and 9 is more accurate).
-b baud Baud rate (default 9600).
-g thickness The glass thickness (0 = thin, 1 = medium, 2 = thick).
-R Don’t reset the device (the default is to reset it).
-t threshold The touch threshold (sensitivity); the range is from 0 through 44,
where 0 is very sensitive, and 44 is not sensitive. The default is
19.

The device modules and their options are:

• fd — open a device via open().

-d device The device to open fd on (default /dev/ser1).


-s The input interface is serial (being aware that the module is able to
use some devctl() commands specific to serial ports).

The filter modules and their options are:

• abs — transform and compress absolute coordinate “touch” events.

-b Touching the screen is a right mouse button (default left).


-c Calibrate mode; don’t transform coordinates.
-f filename The calibration filename.
-o x,y The origin of the display region (default: the origin of the graphics
region).
-s x,y The coordinates of the lower right corner of the display region
(default: the width and height of the graphics region).
-x Reverse X.
-y Reverse Y.

Description:
The devi-zytronic command starts the Zytronic input manager for Photon.

Examples:
Connect the Zytronic controller to the first serial port:

devi-zytronic zytronic fd -d/dev/ser1 abs -b

370 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devi-zytronic

See also:
devi-*, inputtrap

June 22, 2010 Utilities 371


devn-asix.so © 2010, QNX Software Systems GmbH & Co. KG.
Driver for the ASIX AX88172/AX88178/AX88772 USB Ethernet dongle

Syntax:
io-pkt-variant -d asix [option[,option ...]] ... &

where variant is one of v4, v4-hc, or v6-hc.

Runs on:
Neutrino

Options:
Use commas, not spaces, to separate the options.

busnum=0xXX The USB bus number.

devnum=0xXX The USB device number.

did=0xXXXX The USB device ID.

duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if duplex alone is specified, it is ignored and both
speed and duplex are autonegotiated.

iftype=num The interface type (from <net/if_types.h>). The default is


IFT_ETHER.

lan=num The LAN number. The default is 0.

mac=XXXXXXXXXXXX
The interface address of the controller. The default is
automatically detected on supported hardware.

media=num The media type (from <hw/nicinfo.h>). The default is


NIC_MEDIA_802_3.

mru=num The maximum receive unit. The default is 1514.

mtu=num The maximum transmission unit. The default (1514) is


automatically detected on supported hardware.

nomulticast Disable multicast support. By default, multicast is enabled.

path="name" Connect to the specified USB stack. The default is


/dev/io-usb/io-usb.

phy=num The address of the connected PHY device.

priority=N The priority of the driver’s event thread. The default is 21.

372 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devn-asix.so

promiscuous Enable the driver to pass all data packets received, regardless of
the address. By default, promiscuous mode is disabled.

receive=num The number of Rx descriptors. The default is 5.

speed=10|100 The media data rate in megabits/second.

transmit=num The number of Tx descriptors. The default is 10.

uptype=name The interface name. The default is en.

verbose
verbose=N Be verbose. Specify num for more verbosity (num can be 1-4; the
higher the number, the more detailed the output). The default is
0. The output goes to slogger; invoke sloginfo to view it.

vid=0xXXXX The USB vendor ID.

wait=num The number of seconds to wait for the USB stack. The default is
60 seconds.

Description:
The devn-asix.so driver controls the ASIX AX88172/AX88178/AX88772 USB
Ethernet dongle. This is a legacy io-net driver; its interface names are in the form
enX, where X is an integer.

If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.

Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:

• ip4csum, ip4csum-rx, ip4csum-tx

• tcp4csum, tcp4csum-rx, tcp4csum-tx

• tcp6csum, tcp6csum-rx, tcp6csum-tx

• udp4csum, udp4csum-rx, udp4csum-tx

• udp6csum, udp6csum-rx, udp6csum-tx

You can then use ifconfig to enable or disable whichever of these options your
device supports.

June 22, 2010 Utilities 373


devn-asix.so © 2010, QNX Software Systems GmbH & Co. KG.

Examples:
Start io-pkt-v6-hc using the ASIX driver:

io-pkt-v6-hc -dasix verbose &


ifconfig en0 10.1.0.184

Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.

See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo

374 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devn-crys8900.so
Driver for Crystal 89xx Ethernet adapters

Syntax:
io-pkt-variant -d crys8900 [option[,option ...]] ...

where variant is one of v4, v4-hc, or v6-hc.

Runs on:
Neutrino

Options:
Use commas, not spaces, to separate the options.

connector=0|1|2|3
Network cable connector type:

0 BNC
1 UTP
2 AUI
3 FIBER

dma=num The DMA channel.

duplex=0|1 Half (0) or full (1) duplex mode.

iftype=num Interface type (from <net/if_types.h>). The default is


IFT_ETHER.

iorange=0xXXXXXXXX
I/O base address.

irq=num IRQ of the interface. The default is automatically detected on


supported hardware (but see caution below).

lan=num LAN number. The default is 0.

mac=XXXXXXXXXXXX
MAC address of the controller. The default is automatically
detected on supported hardware.

media=num Media type (from <hw/nicinfo.h>). The default is


NIC_MEDIA_802_3.

mru=num Maximum receive unit. The default is 1514.

mtu=num Maximum transmission unit. The default (1514) is automatically


detected on supported hardware.

June 22, 2010 Utilities 375


devn-crys8900.so © 2010, QNX Software Systems GmbH & Co. KG.

nomulticast Disables the driver from sending or receiving multicast packets.


By default, multicast is enabled.

priority=N Priority of the driver event-thread. The default is 21.

promiscuous Enable promiscuous mode. The default is off.

uptype=name Interface name. The default is “en”.

verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4, the
higher the number, the more detailed the output). The default is 0.
The output goes to slogger, invoke sloginfo to view.

Description:
The devn-crys8900.so driver controls Crystal 89xx Ethernet adapters. This is a
legacy io-net driver; its interface names are in the form enX, where X is an integer.

CAUTION: This driver can’t always detect the correct irq and ioport options,
! especially for ISA devices. To be sure, always specify irq and ioport when using
this driver.

Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:

• ip4csum, ip4csum-rx, ip4csum-tx

• tcp4csum, tcp4csum-rx, tcp4csum-tx

• tcp6csum, tcp6csum-rx, tcp6csum-tx

• udp4csum, udp4csum-rx, udp4csum-tx

• udp6csum, udp6csum-rx, udp6csum-tx

You can then use ifconfig to enable or disable whichever of these options your
device supports.

Examples:
Start io-pkt-v4-hc using the Crystal 89xx driver: stack:

io-pkt-v4-hc -d crys8900
ifconfig en0 10.1.0.184

376 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devn-crys8900.so

Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.

See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo

June 22, 2010 Utilities 377


devn-dm9102.so © 2010, QNX Software Systems GmbH & Co. KG.
Driver for Davicom DM9102 Ethernet adapters

Syntax:
io-pkt-variant -d dm9102 [option[,option ...]] ... &
where variant is one of v4, v4-hc, or v6-hc.

Runs on:
Neutrino

Options:
Use commas, not spaces, to separate the options. These options will override
auto-detected defaults.

did=0xXXXX Device ID.

duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if duplex alone is specified, it is ignored and both
speed and duplex are auto-negotiated.

lan=num The LAN number. The default is 0.

mac=XXXXXXXXXXXX
MAC address of the controller. If no SROM is available, the
MAC will default to 00:00:00:00:00:00

nomulticast Disable multicast support.

pci=0xXXXX PCI index of the controller.

phyaddr=num Override the mii routines and use the specified phy address.

pktque=num Limit the number of packets in the queue. The default is 100.

priority Priority of the driver thread. The default is 21.

promiscuous Enable promiscuous mode.

receive=num Set the number of receive descriptors. The default is 64.

single Configure and run only the first DM9102 card that is found
(single instance).

speed=10|100 Media data rate (10 Mbit or 100 Mbit operation). The default is
automatically detected on supported hardware. If you specify
speed, specify duplex as well; if speed alone is specified, the
specified speed will be correctly set, but duplex will default to
half (0).

threshold=N The amount of packet data that must be in the TX FIFO before
transmission is initiated. The range is 0–4. The default is 3.

378 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devn-dm9102.so

transmit=num Set the number of transmit descriptors. The default is 128.

verbose Be verbose.

vid=0xXXXX PCI vendor ID.

Description:
The devn-dm9102 driver controls Davicom DM9102 Ethernet adapters. This is a
legacy io-net driver; its interface names are in the form enX, where X is an integer.

If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.

Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:

• ip4csum, ip4csum-rx, ip4csum-tx

• tcp4csum, tcp4csum-rx, tcp4csum-tx

• tcp6csum, tcp6csum-rx, tcp6csum-tx

• udp4csum, udp4csum-rx, udp4csum-tx

• udp6csum, udp6csum-rx, udp6csum-tx

You can then use ifconfig to enable or disable whichever of these options your
device supports.

Examples:
Start io-pkt-v4-hc using the DM9102 driver:

io-pkt-v4-hc -d dm9102
ifconfig en0 10.0.0.184

Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.

See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo

June 22, 2010 Utilities 379


devn-el509.so © 2010, QNX Software Systems GmbH & Co. KG.
Driver for 3Com 509 ISA Ethernet adapters

Syntax:
io-pkt-variant -d el509 [option[,option ...]] ... &
where variant is one of v4, v4-hc, or v6-hc.

Runs on:
Neutrino

Options:
Use commas, not spaces, to separate the options.

connector=type Network cable connector type:

0 BNC
1 UTP
2 AUI
3 FIBER

The default is automatically detected on supported hardware.


ioport=port The I/O port of the interface. The port parameter must be a hex
address (e.g. 0x320). The default is automatically detected on
supported hardware (but see caution below).
irq=req The IRQ of the interface. The default is automatically detected
on supported hardware (but see caution below).
lan=num The LAN number. The default is 0.

mac=XXXXXXXXXXXX
MAC address of controller. The default is automatically
detected on supported hardware.
mtu=X Maximum transmission unit. The default is automatically
detected on supported hardware.
nomulticast Disables the driver from sending or receiving multicast
packets. By default, multicast is enabled.
pcmcia Flag to indicate a PCMCIA device to the driver.
promiscuous Enable promiscuous mode. The default is off.

verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4,
the higher the number, the more detailed the output). The
output goes to slogger, invoke sloginfo to view.

380 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devn-el509.so

Description:
The devn-el509.so driver controls 3Com 509 ISA Ethernet adapters.

CAUTION: This driver can’t always detect the correct irq and ioport options,
! especially for ISA devices. To be sure, always specify irq and ioport when using
this driver.

You can use ifconfig to enable hardware checksums if supported.

Examples:
Start io-pkt-v6-hc using the 509 ISA Ethernet adapter driver:

io-pkt-v6-hc -d el509 ioport=0x320,irq=11

Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.

See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo

June 22, 2010 Utilities 381


devn-el900.so © 2010, QNX Software Systems GmbH & Co. KG.
Driver for 3Com 90x Network Interface Cards

Syntax:
io-pkt-variant -d el900 [option[,option ...]] ... &
where variant is one of v4, v4-hc, or v6-hc.

Runs on:
Neutrino

Options:
Use commas, not spaces, to separate the options.

connector=0|1|2|3
Network cable connector type:

0 BNC
1 UTP
2 AUI
3 FIBER

The default is automatically detected on supported hardware.

did=0xXXXX PCI device ID. The default is automatically detected on


supported hardware.

duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if duplex alone is specified, it is ignored and both
speed and duplex are auto-negotiated.

lan=num The LAN number. The default is 0.

mac=XXXXXXXXXXXX
MAC address of controller. The default is automatically detected
on supported hardware.

mru=num Maximum receive unit. The default is 1514.

mtu=num Maximum transmission unit. The default (1514) is automatically


detected on supported hardware.

nomulticast Disables the driver from sending or receiving multicast packets.


By default, multicast is enabled.

promiscuous Enable promiscuous mode. The default is off.

receive=num Set the number of receive descriptors. The default is 64.

382 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devn-el900.so

transmit=num Set the number of transmit descriptors. The default is 128.

verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4, the
higher the number, the more detailed the output). The output
goes to slogger; invoke sloginfo to view it.

vid=0xXXXX PCI vendor ID. The default is automatically detected on


supported hardware.

Description:
The devn-el900.so driver controls 3Com 90x Network Interface Cards (NICs). The
IRQ of the interface is automatically detected on supported hardware. This is a legacy
io-net driver; its interface names are in the form enX, where X is an integer.

If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.

Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:

• ip4csum, ip4csum-rx, ip4csum-tx

• tcp4csum, tcp4csum-rx, tcp4csum-tx

• tcp6csum, tcp6csum-rx, tcp6csum-tx

• udp4csum, udp4csum-rx, udp4csum-tx

• udp6csum, udp6csum-rx, udp6csum-tx

You can then use ifconfig to enable or disable whichever of these options your
device supports.

Examples:
Start io-pkt-v6-hc using the 90x NIC driver:
io-pkt-v6-hc -d el900 verbose
ifconfig en0 10.1.0.184

Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.

June 22, 2010 Utilities 383


devn-el900.so © 2010, QNX Software Systems GmbH & Co. KG.

See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo

384 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devn-epic.so
Driver for SMC 9432 (EPIC) Ethernet adapters

Syntax:
io-pkt-variant -d epic [option[,option ...]] ... &
where variant is one of v4, v4-hc, or v6-hc.

Runs on:
Neutrino

Options:
Use commas, not spaces, to separate the options.

connector=0|1|3
Network cable connector type:

0 BNC
1 UTP
3 FIBER

did=0xXXXX Device ID. The default is automatically detected on supported


hardware.

duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if duplex alone is specified, it is ignored and
both speed and duplex are auto-negotiated.

lan=num The LAN number. The default is 0.

mac=XXXXXXXXXXXX
MAC address of controller. The default is automatically
detected on supported hardware.

mmap Use memory mapped registers. The default is IO mapped.

mru=X Maximum receive unit. The default is 1514.

mtu=X Maximum transmission unit. The default (1514) is automatically


detected on supported hardware.

nomulticast Disables the driver from sending or receiving multicast packets.


By default, multicast is enabled.

pci=0xXXXX PCI index of the controller. The default is automatically


detected on supported hardware.

priority Priority of the driver thread. The default is 21.

June 22, 2010 Utilities 385


devn-epic.so © 2010, QNX Software Systems GmbH & Co. KG.

promiscuous Enable promiscuous mode. The default is off.

receive=num Set the number of receive descriptors. The default is 64.

single Use this option if you have multiple Epic cards in your system
and want to configure them differently. The single option tells
the driver to stop after configuring the first Epic card it finds.
The order of the search can’t be determined because it depends
on the PCI server and PCI BIOS used. After the first card has
been configured, when the driver is invoked again, it will find
and configure the next card in order, and so on until all Epic
cards have been configured. The default is to enable all Epic
cards found.

speed=10|100 Media data rate (10Mbit or 100Mbit operation). The default is


automatically detected on supported hardware. If you specify
speed, specify duplex as well; if speed alone is specified, the
specified speed will be correctly set, but duplex will default to
half (0).

transmit=num Set the number of transmit descriptors. The default is 128.

verbose Be verbose. The output goes to slogger; invoke sloginfo to


view it.

vid=0xXXXX Vendor ID of the controller. The default is automatically


detected on supported hardware.

Description:
The devn-epic.so driver controls SMC 9432 (EPIC) Ethernet adapters. This is a
legacy io-net driver; its interface names are in the form enX, where X is an integer.

If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.

Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:

• ip4csum, ip4csum-rx, ip4csum-tx

• tcp4csum, tcp4csum-rx, tcp4csum-tx

• tcp6csum, tcp6csum-rx, tcp6csum-tx

• udp4csum, udp4csum-rx, udp4csum-tx

• udp6csum, udp6csum-rx, udp6csum-tx

386 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devn-epic.so

You can then use ifconfig to enable or disable whichever of these options your
device supports.

Examples:
Start io-pkt-v6-hc using the EPIC driver:

io-pkt-v6-hc -d epic verbose,speed=10,duplex=0


ifconfig en0 10.1.0.184

Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.

See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo

June 22, 2010 Utilities 387


devn-fd.so © 2010, QNX Software Systems GmbH & Co. KG.
File descriptor interface driver

Syntax:
io-pkt-variant -d fd fd=device[,option[,option ...]] ... &

where variant is one of v4, v4-hc, or v6-hc.

Runs on:
Neutrino

Options:
Use commas, not spaces, to separate the options.

ahdlc Read or write packet data in AHDLC frame format.

fd=device The device on which to open the file descriptor to read or write
packet data. You must specify this option.

lan=num The LAN number. The default is 0.

mac=XXXXXXXXXXXX
The MAC address of the controller. There is no default.

mru=num Maximum receive unit. The default is 1514.

mtu=num Maximum transmission unit. The default (1514) is automatically


detected on supported hardware.

nomulticast Disable multicast support.

priority=N Priority of the driver event-thread. The default is 21.

promiscuous Enable promiscuous mode. The default is off.

verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4, the
higher the number, the more detailed the output). The default is 0.
The output goes to slogger, invoke sloginfo to view.

Description:
The devn-fd.so driver uses file-descriptor based I/O (i.e. open(), read(), write(), and
so on) to receive and transmit packets. It provides the Network Manager (io-pkt*)
with reliable data transfer over any media supported by a file-descriptor-based server
process.

388 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devn-fd.so

The devn-fd.so driver does not support multicast addresses.

For example, you could use devn-fd.so to connect two machines with a null-modem
RS-232 serial cable. By using file-descriptor I/O to the serial devices, devn-fd.so
would implicitly use a serial driver and set up a logical network link.
This is a legacy io-net driver; its interface names are in the form enX, where X is an
integer.

Examples:
Start io-pkt-v4-hc using the FD driver:

io-pkt-v4-hc -d fd fd=/dev/ser1,mac=0023456789AB,ahdlc
ifconfig en0 10.0.184

Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.

Caveats:
You must specify the fd option when using this driver.

See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo

June 22, 2010 Utilities 389


devn-i82544.so © 2010, QNX Software Systems GmbH & Co. KG.
Driver for Intel Gigabit Ethernet LAN adapters and I/O Controller Hubs

Syntax:
io-pkt-variant -d /lib/dll/devn-i82544.so
[option[,option ...]] ... &
where variant is one of v4, v4-hc, or v6-hc.

If you don’t specify the full path to devn-i82544.so, io=pkt* starts


devnp-i82544.so.

Runs on:
Neutrino

Options:
Use commas, not spaces, to separate the options.

did=0xXXXX Detect only devices with the given PCI device ID. The default is
automatically detected on supported hardware.

duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if you specify duplex alone, it’s ignored, and
both speed and duplex are auto-negotiated.
flowcontrol=0|1
Disable (0) or enable (1) hardware flow control.

irq=N IRQ of the interface. The default is automatically detected on


supported hardware.

lan=num The LAN number. The default is 0.

mac=XXXXXXXXXXXX
MAC address of controller. The default is automatically
detected on supported hardware.

mtu=X Maximum transmission unit. The default (1514) is


automatically detected on supported hardware.

nomulticast Disable the driver from sending or receiving multicast packets.


By default, multicast is enabled.

pauseignore Ignore pause frames with respect to full duplex flow control.

pausesuppress Suppress pause frames with respect to full duplex flow control.

pci=0xXXXX Detect devices only at this specific PCI index.

390 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devn-i82544.so

priority=X Priority of the driver’s event-handler thread. The default is 21.


promiscuous Enable promiscuous mode. The default is off.
receive=num Set the number of receive descriptors. The default is 64 on PPC,
and 128 on other platforms.
speed=10|100|1000
Media data rate (10Mbit, 100Mbit, or Gigabit operation). The
default is automatically detected on supported hardware. If you
specify speed, specify duplex as well; if you specify speed
alone, the specified speed is correctly set, but duplex defaults to
half (0).
transmit=num Set the number of transmit descriptors. The default is 64 on
PPC, and 512 on other platforms.
verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4;
the higher the number, the more detailed the output). The output
goes to slogger; invoke sloginfo to view it.
vid=0xXXXX Detect only devices with this specific PCI vendor ID.

Description:
The devn-i82544.so driver manages the Intel 82540, 82541, 82542, 82543, 82544,
82545, 82546, 82547, 82571, 82572, and 82573 Gigabit Ethernet LAN adapters, and
the ICH8 and ICH9 I/O Controller Hubs. This is a legacy io-net driver; its interface
names are in the form enX, where X is an integer.

If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.

Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:
• ip4csum, ip4csum-rx, ip4csum-tx
• tcp4csum, tcp4csum-rx, tcp4csum-tx
• tcp6csum, tcp6csum-rx, tcp6csum-tx
• udp4csum, udp4csum-rx, udp4csum-tx
• udp6csum, udp6csum-rx, udp6csum-tx
You can then use ifconfig to enable or disable whichever of these options your
device supports.

June 22, 2010 Utilities 391


devn-i82544.so © 2010, QNX Software Systems GmbH & Co. KG.

Examples:
Start io-pkt-v4-hc using the devn-i82544.so driver:

io-pkt-v4-hc -d /lib/dll/devn-i82544.so
ifconfig en0 10.1.0.184

Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for io-pkt*

See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo

392 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devn-micrel8841.so
Driver for Micrel 8841 (1 port) or 8842 (2 port) Ethernet controllers

Syntax:
io-pkt-variant -d micrel8841 [option[,option ...]] ... &

where variant is one of v4, v4-hc, or v6-hc.

Runs on:
Neutrino

Options:
Use commas, not spaces, to separate the options.

did=0xXXXX The PCI device ID.

duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if duplex alone is specified, it is ignored and both
speed and duplex are autonegotiated.

lan=num The LAN number of port 0 (8841 or 8842).

lan2=num The LAN number of port 1 (8842).

multicast Enable the receipt of all multicast packets, all ports. By default,
the receipt of multicast packets is disabled.

pci=0xXXXX The PCI index of the controller.

port0=num 1 means power down port 0 PHY (the default is 0, power on).

port1=num 1 means power down port 1 PHY (the default is 0, power on) on
the 8842 (2 port).

priority=N The priority of the driver’s event thread. The default is 21.

promiscuous Allow the driver to pass all data packets received, regardless of
the address. By default, promiscuous mode is disabled.

receive=num The number of Rx descriptors (and 2 KB npkts) to allocate. The


default is 256.

speed=10|100 Set the link speed (specified in Mbits/second: 10 or 100).

switch Enable switch mode on the 2-port 8842.

June 22, 2010 Utilities 393


devn-micrel8841.so © 2010, QNX Software Systems GmbH & Co. KG.

This is very dangerous if you loop the network because of the resulting packet storms.

transmit=num The number of Tx descriptors to allocate (the default is 256).

verbose
verbose=N Be verbose. Specify num for more verbosity (num can be 1-4; the
higher the number, the more detailed the output). The default is
0. The output goes to slogger; invoke sloginfo to view it.

vid=0xXXXX The PCI vendor ID.

Description:
The devn-micrel8841.so driver controls Micrel 8841 (1 port) or 8842 (2 port)
Ethernet controllers. This is a legacy io-net driver; its interface names are in the
form enX, where X is an integer.

This driver supports only PCI versions of the Micrel 8841 (1 port) and 8842 (2 port)
Ethernet controllers.

This driver supports hardware checksum calculations for both Tx and Rx of IP and
TCP packets (UDP isn’t supported). To enable hardware checksumming, use
ifconfig like this, after starting the driver:

ifconfig enX ip4csum tcp4csum

Examples:
Start io-pkt-v6-hc using the devn-micrel8841.so driver and Qnet with 1024
transmit descriptors, and 1024 receive descriptors to avoid packet loss due to
scheduling latency on slow processors:

io-pkt-v6-hc -d micrel8841 transmit=1024,receive=1024 -p qnet

Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.

See also:
devn-*, devnp-*, ifconfig, io-pkt*, nicinfo

394 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devn-ne2000.so
Driver for NE-2000-compatible Ethernet adapters

Syntax:
io-pkt-variant -d ne2000 [option[,option ...]] ...

where variant is one of v4, v4-hc, or v6-hc.

Runs on:
Neutrino

Options:
Use commas, not spaces, to separate the options.

did=0xXXXX PCI device ID. The default is automatically detected on supported


hardware.

ioport=num I/O port of the interface. The port parameter must be a hex
address (e.g. 0x320). The default is automatically detected on
supported hardware (but see caution below).

irq=num IRQ of the interface. The default is automatically detected on


supported hardware (but see caution below).

lan=num The LAN number. The default is 0.

mac=XXXXXXXXXXXX
MAC address of the controller. The default is automatically
detected on supported hardware.

nomulticast Disables the driver from sending or receiving multicast packets.


By default, multicast is enabled.

pci=0xXXXX PCI index of the controller. The default is automatically detected


on the supported hardware.

promiscuous Enable promiscuous mode. The default is off.

tmem=name Name for typed memory.

verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4, the
higher the number, the more detailed the output). The output goes
to slogger, invoke sloginfo to view.

vid=0xXXXX The PCI vendor ID of the controller. The default is automatically


detected on the supported hardware.

width=8|16 I/O access width (8 or 16 bits). The default is automatically


detected on supported hardware.

June 22, 2010 Utilities 395


devn-ne2000.so © 2010, QNX Software Systems GmbH & Co. KG.

Description:
The devn-ne2000.so driver controls NE-2000-compatible Ethernet adapters.

CAUTION: This driver can’t always detect the correct irq and ioport options,
! especially for ISA devices. To be sure, always specify irq and ioport when using
this driver.

This is a legacy io-net driver; its interface names are in the form enX, where X is an
integer.

If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.

Some devices support hardware checksums, although some might do so in only one
direction; to determine if your device does, type:
ifconfig enX
and look for the following in the list of supported options:

• ip4csum, ip4csum-rx, ip4csum-tx

• tcp4csum, tcp4csum-rx, tcp4csum-tx

• tcp6csum, tcp6csum-rx, tcp6csum-tx

• udp4csum, udp4csum-rx, udp4csum-tx

• udp6csum, udp6csum-rx, udp6csum-tx

You can then use ifconfig to enable or disable whichever of these options your
device supports.

Examples:
Start io-pkt-v4-hc using the NE-2000 driver:

io-pkt-v4-hc -d ne2000 ioport=0x320,irq=11


ifconfig en0 10.1.0.184

Files:
/dev/io-net The directory where, by default, drivers and protocol modules add
entries. For more information, see the documentation for
io-pkt*.

396 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devn-ne2000.so

Caveats:
If you’re running a PCMCIA NE2000-compatible adapter, you may need to specify
the -w8 command-line option of devp-pccard.

See also:
devn-*, devnp-*, devp-pccard, ifconfig, io-pkt*, nicinfo

June 22, 2010 Utilities 397


devn-pcnet.so © 2010, QNX Software Systems GmbH & Co. KG.
Driver for AMD PCNET (AMD-79c97x) compatible Ethernet adapters

Syntax:
io-pkt-variant -d pcnet [option[,option ...]] ...

where variant is one of v4, v4-hc, or v6-hc.

Runs on:
Neutrino

Options:
Use commas, not spaces, to separate the options.

connector=0|1|2|3
Network cable connector type:

0 BNC
1 UTP
2 AUI
3 FIBER

deviceindex=0xXXXX
Only attach to device with this PCI index.

did=0xXXXX PCI device ID. The default is automatically detected on


supported hardware.

dma=num The DMA channel.

duplex=0|1 Half (0) or full (1) duplex mode. The default is automatically
detected on supported hardware. If you specify duplex, specify
speed as well; if duplex alone is specified, it is ignored and
both speed and duplex are auto-negotiated.

hpna Use HPNA phy.

iftype=num Interface type (from <net/if_types.h>). The default is


IFT_ETHER.

iorange=0xXXXXXXXX
The I/O base address.

irq=num IRQ of the interface.

lan=num LAN number. The default is 0.

398 Utilities June 22, 2010


© 2010, QNX Software Systems GmbH & Co. KG. devn-pcnet.so

mac=XXXXXXXXXXXX
MAC address of the controller. The default is automatically
detected on supported hardware.
media=num Media type (from <hw/nicinfo.h>). The default is
NIC_MEDIA_802_3.
memrange=0xXXXXXXXX
Register base physical memory address.
mmap Use memory-mapped registers. The default is IO mapped.
mru=num Maximum receive unit. The default is 1514.
mtu=num Maximum transmission unit. The default (1514) is
automatically detected on supported hardware.
nomulticast Disables the driver from sending or receiving multicast packets.
By default, multicast is enabled.
pci=0xXXXX PCI index of the controller. The default is automatically
detected on supported hardware.
phy=num Address of the connected PHY device.
priority=N Priority of the driver event-thread. The default is 21.
probe_phy=0|1 Select whether or not to probe the PHY at regular intervals. For
the default value of 0, the PHY is polled only at regular
intervals when the interface is down or doesn’t receive any
packets over the polling interval. If you specify 1, the PHY is
always probed at regular intervals to see if the duplex and/or
speed of the connection has changed.
promiscuous Enable promiscuous mode. The default is off.
receive=num Set the number of receive descriptors/buffers. The default is 64.
speed=10|100 Media data rate (10Mbit or 100Mbit operation). The default is
automatically detected on supported hardware. If you specify
speed, specify duplex as well; if speed alone is specified, the
specified speed will be correctly set, but duplex will default to
half (0).
transmit=num Number of transmit descriptors/buffers. The default is 128.
uptype=name Interface name. The default is “en”.

verbose
verbose=num Be verbose. Specify num for more verbosity (num can be 1-4,
the higher the number, the more detailed the output). The
default is 0. The output goes to slogger; invoke sloginfo to
view it.

June 22, 2010 Utilities 399


devn-pcnet.so © 2010, QNX Software Systems GmbH & Co. KG.

vid=0xXXXX PCI vendor ID of the controller. The default is automatically


detected on supported hardware.

Description:
The devn-pcnet.so driver controls AMD PCNET (AMD-79c97x) compatible
Ethernet adapters. This is a legacy io-net driver; its interface names are in the form
enX, where X is an integer.

• If the device enumerators (see enum-devices) don’t recognize your device, try
explicitly specifying the device ID with the did option when you start the driver.