Notes on Using QNX Neutrino
Removeable disks
- To mount a dos-formatted floppy, use the following command:
mount -t dos /dev/fd0 /fs/floppy. You must be logged
in as root to run the mount command. -t dos tells the mount
command that the disk is dos-formatted. /dev/fd0 is the
name of the disk's block-device file, although it may differ
according to the setup (e.g. /dev/fd1 for the second
floppy disk if there are two). /fs is the default
directory location for mounted file systems. Any name can be
given to the mounted floopy disk file system, such as a
(for A: drive) or just fd0 (to match the block device
filename). Use umount /fs/floppy to unmount the
disk.
- To format a floppy disk, just login as root and use
fdformat /dev/fd0. There are various options for this
command, but the defaults are usually suitable. Note that you
must then explicictly place a filesystem on it with dinit
/dev/fd0. Again the default options are usually fine. Dinit
may not be in your path, if not, it can be found in
/sbin/ and /x86/sbin/.
- Mounting an Iomega zip disk is easier, and harder. If the
disk is already in the drive at boot time, it will automatically
be mounted, but if it wasn't, the disk can't be read (at least it
doesn't work for me). The mount command works, but any attempt to
access the disk results in a "corrupted file system detected"
error message. This problem seems only to occur with FAT (MS-DOS)
formatted disks. With QNX format, the disk can be mounted and
used with no problems. If anyone knows how to resolve this issue,
please let me know!
Supported Filesystems
- QNX can read and write to FAT and FAT32 file systems. It
seems to ignore the case of all characters of the filename except
the first character. It is not necessary to mount these file
systems (say if you have QNX installed on a partitioned disk)
since the FATx partition will be automatically mounted under
/fs/hd0 (the number will increase for additional
partitions).
Missing commands
The following standard Unix commands seem to be unavailable in
QNX
- adduser (use passwd instead)
- groups
- chsh
- lpq (use lprq instead)
- lprm, cancel (use lprrm instead)
PCI Cards
- The devices found on the PCI bus can be listed using the
pci program, which may not be in your $PATH. It is found
in /usr/sbin/ and /x86/usr/sbin/.
Startup Files
- When QNX boots, the following scripts are run in this order:
/etc/system/sysinit, /etc/rc.d/rc.devices,
/etc/rc.d/rc.sysinit, /etc/rc.d/rc.local
Login via Serial Port
Being able to login via the serial port is a useful feature. It
is especially handy when the keyboard isn't responding, or when the
floppy disk and ethernet hardware aren't recognised and you need to
get a file off the hard disk. You only need to do two things to
activate login over the serial port.
(1) Configure the serial parameters for the port. You can do this
by adding the following
stty command (you may need to change the settings for your
situation) to /etc/rc.d/rc.local (ensure that rc.local is
run at startup, and has executable permissions) :
stty baud=115200 bits=8 stopb=1 par=none
</dev/ser1
(2) Tell the terminal initialisation program
tinit about the serial port. This is achieved by adding the
following line to /etc/config/ttys :
ser1 "/bin/login" qansi-m on
Shell
The default (Korn) shell uses the key sequence ESC ESC for
filename completion. To change this default to match the bash
default (TAB), use the command bind '^I'=complete
Beware: when using the cp and mv commands, if a file exists that
has the same name as the given destination name, by default they
will silently overwrite the existing file.
Vim Editor
Elvis is the default vi editor. That is, the file
/bin/vi is a symbolic link to /bin/elvis. Vim is a
more powerful clone of vi; to make it the default vi editor, change
the symbolic link to point to /usr/bin/vim with the command
ln -fs /usr/bin/vim /bin/vi. You may also want to do this
for the view command.
Compiling Open Sources
od is called by libtool, which itself is called by GNU
configure (for teTeX at least). od on QNX is
actually a link to /usr/bin/hd. hd does not
support the “-x” option, which is actually an
abbreviation for “-A x2” meaning two-byte hex (or just
“-A x” since two bytes is the default for this
format).
Content last updated: 2005-06-20