Pci Device Driver Qnx
Typically drivers use this function to attach themselves to a PCI device, so that other drivers can t attach to the same device. If you specify the PCI_SHARE flag.
PCI Drivers Download Utility at Drivers.com - Update PCI Drivers for your PC - Free Drivers Scan Automatic Updates.
Pci_find_device Find the PCI device with a given device ID and vendor ID. Synopsis: include hw/pci.h int pci_find_device unsigned device, unsigned.
QNX realtime RTOS - Operating systems, Detach a driver from a PCI device. Synopsis: include hw/pci.h int pci_detach_device void handle ; Arguments: handle.
Connecting Hardware
This chapter includes:
Introduction
When you boot a Neutrino desktop system, it starts a
device enumerator,
a manager that detects most hardware devices.
The enumerator loads a set of configuration files from
/etc/system/enum/devices that
define what your system should do e.g. start a specific driver
when you add or remove hardware.
You can edit the enumerator s configuration files, if necessary.
For more information, see
Controlling How Neutrino Starts
in this guide, and
enum-devices
in the Utilities Reference.
An embedded Neutrino system typically has specific hardware, so when the
system boots, it s likely to explicitly start the appropriate drivers.
You can find a list of currently supported hardware in the
Developer Support Center area of our website,
The website lists the chipsets and hardware that we ve tested with Neutrino.
However, many times there are slight variants of chipsets that
will work with the drivers even if they aren t listed.
It s often worth trying these chipsets to see if the driver
will work with your hardware, but note that the hardware might not
behave as expected.
Neutrino doesn t currently support tapes.
You ll use the information in this chapter if the enumerator can t detect
your system s devices, or if you want to manually configure static devices
in an embedded system.
You need to be logged in as root to start any drivers.
Make sure that PnP-aware OS is disabled in the BIOS before you
run Neutrino.
PCI/AGP devices
If you don t know what type of controller you re using, you can
use the
pci
utility to identify it:
pci -vvv less
The output from this command looks something like this:
Class Mass Storage IDE
Vendor ID 8086h, Intel Corporation
Device ID 7111h, 82371AB/EB PIIX4 IDE Controller
PCI index 0h
Class Codes 010180h
Revision ID 1h
Bus number 0
Device number 4
Function num 1
Status Reg 280h
Command Reg 5h
I/O space access enabled
Memory space access disabled
Bus Master enabled
Special Cycle operations ignored
Memory Write and Invalidate disabled
Palette Snooping disabled
Parity Checking disabled
Data/Address stepping disabled
SERR driver disabled
Fast back-to-back transactions to different agents disabled
Header type 0h Single-function
BIST 0h Build-in-self-test not supported
Latency Timer 20h
Cache Line Size 0h
PCI IO Address d800h length 16 enabled
Max Lat 0ns
Min Gnt 0ns
PCI Int Pin NC
Interrupt line 0
Device Dependent Registers:
0x40: 07 c0 03 80 00 00 00 00 05 00 02 02 00 00 00 00
0x50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xA0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xB0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xC0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xD0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xE0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0xF0: 00 00 00 00 00 00 00 00 30 0f 00 00 00 00 00 00
Find the entry for the device you want to locate and it ll give
you the details on the manufacturer/vendor ID and device ID. You
may need to search for keywords e.g. Audio in order to identify
your device.
You can search the manufacturer s website for information, or
use the vendor and device IDs to cross-reference with /usr/include/hw/pci_devices.h.
You
can also search
CD-ROMs
You usually attach CD drives to a SCSI or EIDE ATA bus; which driver
you use depends on the bus.
Ensure that the hardware is set up correctly and that the BIOS
detects the hardware properly.
If you attached the CD drive to an EIDE bus, simply use the
devb-eide
driver.
If the drive is on a SCSI bus, you need to determine the proper driver for your
SCSI interface; see
Hard disks,
below.
The cam-cdrom.so shared
object provides a common access method for CD-ROM devices.
The drivers load the
cam-cdrom.so
and
fs-cd.so
shared objects by default.
CD-ROM devices support the ISO-9660 filesystem, and appear in
the /dev directory as /dev/cdx,
where x is the number of the drive, starting at 0.
Simply mount the drive using the
mount
utility, specifying cd as the type of filesystem:
mount -tcd /dev/cd1 /fs/cdrom
You don t need to remount the drive when you change CDs.
For information about specific options e.g. disabling audio extensions,
disabling multisession support, see
DVDs
Neutrino supports DVD ROMs and RAMs:
DVD ROM
You can treat DVD drives like CD-ROM drives. However,
Neutrino currently doesn t support UDF format DVD disks. You can use
DVD drives to read CDs, and the setup for a DVD ROM is the same
as for a CD-ROM. For more details, see
CD-ROMs,
above.
DVD RAM
You can treat DVD RAM drives like hard disks.
They appear in the /dev directory
as a CD, but you can mount and treat them just like a hard disk -- see
below.
Floppy disks
The driver for a floppy drive is
devb-fdc.
In order to use a floppy disk, you need to ensure that the
floppy controller is enabled in the BIOS, and that the BIOS is configured
to recognize the correct type of floppy drive e.g. 1.44MB/2.88MB.
The driver uses these locations as default:
I/O port 0x3f0
IRQ 6
DMA 2
If your controller is located at a different address, you can
change these locations in the driver s options.
The default cache size specified by
io-blk.so
is 15 of system memory, which is excessive for devb-fdc.
You ll probably want to reduce it to something more reasonable:
devb-fdc blk cache 128K
The driver creates a
/dev/fdx entry,
where x is the number of the floppy drive, starting at 0.
If no entry appears, the BIOS settings might be incorrect, or there
could be a problem with the controller.
Check the output from
sloginfo
for clues.
Once you have an entry in the /dev directory,
you need to mount the floppy disk.
The
command
detects the type of filesystem you re using e.g. DOS, QNX 4,
but you can also specify it on the command line.
To mount a DOS-formatted floppy disk, type:
mount -tdos /dev/fd0 /fs/dos_floppy
Use
mkdosfs
to format DOS floppy disks and DOS hard drives.
This utility supports FAT 12/16/32.
To mount a QNX 4-formatted floppy disk, type:
mount -tqnx4 /dev/fd0 /fs/qnx_floppy
You don t need to remount the drive when you change floppy disks.
Don t remove a floppy while the driver is still reading or writing data;
floppies are quite a bit slower than hard disks, so it can take a while.
Make sure the drive light is off.
Hard disks
A self-hosted system, by default, detects the disk controller that s installed
on the system, and then starts the appropriate driver for it.
On a self-hosted system, the
diskboot
utility in the OS image starts the block I/O drivers.
If you want to change the way that the driver is started, you ll
need to change the startup image and the options to diskboot.
For example:
diskboot -o devb-eide,blk cache 30m
Controlling How Neutrino Starts,
EIDE
EIDE interfaces use the
driver, which by default automatically detects the
interface and devices attached to it.
This driver includes support for UDMA Ultra Direct Memory Access modes, along
with the generic PIO Programmed Input/Output modes.
The supported hardware list includes adapters
and their supported features;
see the
introduction
to this chapter.
You can start the devb-eide driver without any options and,
by default, it
automatically detects the EIDE controller on the system:
devb-eide
When the driver starts, it detects all EIDE devices attached to the chain.
For each device, the driver creates an entry in the /dev
directory e.g. a hard drive appears as hdx,
where x is the number of the drive, starting from 0.
For example, suppose a system has two hard drives installed.
The driver creates the following
entries in the /dev directory:
/dev/hd0
Usually the primary master.
/dev/hd1
Usually the primary slave, or the next drive on the system the secondary
master.
If the system has one hard drive and a CD-ROM, the entries are:
The primary master.
/dev/cd0
The CD-ROM drive.
A slave drive must have a master drive.
When the driver starts, it displays on the
console the type of detected hardware, along
with other debugging information that gets sent to the system logger,
slogger.
To view the system log, run
sloginfo.
When you view the output from sloginfo, there will likely be a
number of ASC_MEDIA_NOT_PRESENT entries.
The driver logs these messages if there isn t a CD in the CD-ROM drive.
You can generally ignore them.
Troubleshooting for devb-eide
If the driver doesn t detect the interface or drives attached to it:
Check the supported-hardware part of our website to see if the interface
is supported; see the
introduction
to this chapter.
Even if your interface isn t listed as being supported, the EIDE controller
can work
in a generic mode that uses programmed input/output PIO modes, which is
slower, but works in almost all cases.
Ensure that the interface is correctly set up in the BIOS, and that the
BIOS can see the drives correctly.
Check that the drives are set up correctly; each slave drive must have a corresponding
master as per the ATAPI specs. A single chain can t have two master drives or two slave drives.
Ensure that the power connection is functioning correctly.
Pass the device ID and vendor ID to the driver.
Pass the I/O port and IRQ to devb-eide.
Here are some other problems that you might encounter and what you should
try:
If the driver hangs, disable busmastering e.g.
devb-eide eide nobmstr.
If you see sloginfo entries of:
eide_transfer_downgrade: UDMA CRC error downgrading to MDMA,
reduce the transfer mode and check the cables.
eide_timer: timeout path XX, device XX,
verify that the driver is using the correct interrupt, reduce the
transfer mode, and check the cables.
If a PCMCIA disk doesn t work when configured in contiguous I/O
mapped addressing, i.e. 0x320 not 0x1f0,
0x170,
specify the interface control block address.
The control block address is offset 12 from the base.
If a PCMCIA interface is located at I/O port 0x320 and IRQ 7,
specify:
devb-eide eide ioport 0x320:0x32c,irq 7,noslave
If your devices support UDMA 4 or higher, but sloginfo reports
that the driver is using a lower mode, make sure you re using
an 80-conductor cable.
If you have an 80-conductor cable and your devices support UDMA 4 or
higher,
but sloginfo reports that the driver is using a lower mode,
the device firmware might be out-of-date.
The driver relies on the device firmware to detect the cable type.
You can check to see if the device manufacturer has
a firmware upgrade or you can use the udma xxx
command-line option to override the mode.
For example:
devb-eide eide vid 0x8086,did 0x2411,pci 0,chnl 1,master udma 4
If the drives are detected, but they re running slowly:
sloginfo
to examine the devb- driver output in the system log.
It will tell you the current speed of the driver e.g.
max udma 5, cur udma 3.
Neutrino automatically uses the maximum UDMA mode, unless you ve specified
a maximum in the BIOS.
The following table shows the maximum mode and rate for each disk
specification.
The PIO, MDMA, and lower UDMA modes use a 40-pin cable;
higher UDMA modes require an 80-pin cable:
Specification
PIO
MDMA
UDMA 40-pin
UDMA 80-pin
Maximum rate
ATA
0
N/A
4 M/s
ATA 2
4
2
16 M/s
ATA 3
ATA 4
33 M/s
ATA 5
66 M/s
ATA 6
5
100 M/s
ATA 7
6
133 M/s
The maximum rate is the maximum theoretical burst interface throughput.
Sustained throughput depends on many factors, such as the drive cache size,
drive rotation speed, PCI bus, and filesystem.
Don t expect a UDMA-6 drive to have a sustained throughput of 100M/s.
Check to make sure that the device you re attempting to connect
can operate at the expected UDMA modes.
Correct the assignment of primary/secondary and master/slave interfaces.
For example, putting two hard drives as primary/secondary rather
than master/slave on the primary may allow driver parallelism.
SCSI devices
A SCSI Small Computer Systems Interface bus
is simply another bus that you can
attach multiple peripherals to.
Neutrino supports many brands and varieties of SCSI
adapters; see
Block-oriented drivers devb-
in the Summary chapter of the Utilities Reference.
When the SCSI driver starts up, it scans the bus for attached devices.
When the driver finds a supported device, it creates an entry in
the /dev directory e.g. a hard drive is
hdx, where x is the
number of the drive, starting from 0.
If the driver doesn t find any devices, it might not
know the device ID of the adapter.
Passing the device ID and vendor ID to the driver often corrects
this
problem.
On a self-hosted system, you can pass these options to the driver via
diskboot;
see
Controlling How Neutrino Starts.
In the following example, the driver automatically scans for SCSI devices on the chain and
adds them into the /dev directory as they re found.
For example, if the system has four hard drives in it, the entries in the
/dev directory are as follows:
/dev/hd0 -- lowest SCSI ID first
/dev/hd2
/dev/hd3 -- the last SCSI hard drive detected
When the driver starts, it sends debugging information to the system log,
which you can view using
This information is often very helpful when you re trying to
debug a problem with a SCSI adapter or device.
If the driver doesn t correctly detect a device, check the following:
Is the SCSI chain terminated correctly.
This is frequently the problem when a device doesn t
show up correctly, shows up and then disappears, or doesn t show up at all.
Is the SCSI adapter supported.
Even if an adapter claims to
be compatible with a supported adapter, that doesn t mean that the driver will
work with it correctly. Compatible doesn t mean identical.
To be certain, look for the device ID on our website; see
the
Does the SCSI BIOS see all the devices correctly.
If it does, then all the devices are set up correctly, and don t have any
conflicting SCSI IDs.
You can also check this by using another operating system;
if it detects the devices correctly and doesn t display any problems,
the setup is correct.
Remember that if a SCSI chain isn t terminated correctly, a device
may appear on the chain, but will likely have problems after some use. Each device on a
SCSI chain needs to have a unique ID number between 1 and the maximum value supported by the
adapter check the user manual for the adapter. If two devices have the same ID, one or
both may malfunction or not be recognized by the computer.
Is there a PCI-bridging problem. Try moving the SCSI card to another PCI slot.
Sometimes a PCI-bridging problem can prevent Neutrino from properly attaching to the card.
This can happen because Neutrino doesn t support bridges of type
other.
Is the BIOS set up for a PnP-aware OS. Neutrino isn t a PnP-aware OS.
Does the adapter or chain need an external power source.
If so, even if the device has power, it can t communicate
with your computer if the SCSI adapter doesn t have power.
Check the type of SCSI cable.
There are several types, and
the type of adapter you re using determines the type of cable you need.
Also check to make sure that there
are no bent pins on the cable. If you re using an adapter to convert between
SCSI 2 and SCSI 3, for example, make sure you re using an adapter that s
recommended for
your hardware. Not all adapters convert the connections correctly.
Under QNX 4, the SCSI drivers didn t support any device that had an ID
greater than 6.
This isn t a problem under Neutrino.
The maximum rate given for a SCSI device is the maximum theoretical burst
interface throughput.
Sustained throughput depends on many factors.
SCSI RAID
Currently, Neutrino supports only hardware RAID
Redundant Arrays of Independent Disks
devices.
There are many third-party solutions for SCSI RAID available for Neutrino;
search for them on the Internet.
LS-120
LS-120 is a SuperDisk drive that uses
new technology to greatly improve head alignment, enabling a
much greater storage capacity 120 MB than conventional 3.5-inch
disks.
Neutrino treats an LS-120 drive like an EIDE drive.
ORB
An ORB drive is a fast, large-capacity,
removable storage disk drive that uses 3.5 storage media and
attaches to the EIDE ATA chain. Ensure that the hardware is set
up correctly and that the BIOS detects the hardware properly. An
ORB drive is simple to set up, and appears in the /dev directory
as a hard disk. For example:
The hard disk as a primary master appears as /dev/hd0.
The ORB drive set up as a primary slave appears as /dev/hd1.
To mount an ORB drive:
mount /dev/hd1 /fs/orb_drive
You don t need to remount the drive when you change disks.
Zip and Jaz disks
Zip and Jaz
disks are large-capacity removable storage disks, used for backing
up hard disks and for transporting large files.
These disks attach to the EIDE ATA chain.
Before you attempt to use them, ensure that the hardware
is set up correctly and that the BIOS detects the hardware properly.
These drives are simple to set up, and they appear in the /dev
directory
as a hard disk. For example:
The hard disk set up as a primary master appears as
/dev/hd0.
The Zip disk set up as a primary slave appears as /dev/hd1.
To mount the drive, type:
mount /dev/hd1 /fs/zip_drive
Magnetic optical drives
Magnetic
optical MO drives are usually attached to a SCSI or EIDE ATA bus. Before
you attempt to use the drive, ensure that the hardware is set up correctly
and that the BIOS detects the hardware properly.
The driver that you need depends on whether the drive is attached to a
SCSI or EIDE interface.
If it s SCSI, you ll need to determine the proper
driver for your SCSI interface. If it s EIDE, simply use the
above.
The MO drive should appear in your /dev directory as
/dev/mox, where x is the number of the
drive, starting at 0.
mount /dev/mo0 /fs/mo_drive
Input devices
The devi- set of drivers handles input under Photon.
The type of input device attached to your system determines which driver
you need to use.
Photon input can consist of a single mouse,
a mouse and a keyboard, or many mice at the same time
provided you have the space.
inputtrap
utility automatically detects
basic input devices non-USB keyboards and mice.
The Photon startup script invokes this utility after starting the
graphics adapters.
You can override the automatic detection by creating an input trap file,
/etc/system/trap/input.hostname.
This is the default location; you can change it if you want to.
Each line of this file invokes a driver:
For
devi-hirun,
the line should contain only the arguments that you want to pass to it.
For example, this file starts a PS/2 keyboard and a PS/2 mouse:
kbd fd -d/dev/kbd ps2 mousedev
For other input drivers, specify the name of the driver as well as
the arguments.
Mice and keyboards
Mice and keyboards both use the
devi-hirun
driver.
The type of mouse attached to your system determines which options you need
to use.
For a serial mouse, you need to specify the correct protocol
e.g. the Microsoft Mouse protocol.
Keyboards are detected on these interfaces:
AT-style adapters appear as /dev/kbddev.
PS/2 keyboards appear as /dev/kbd.
If
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 kbddev ps2 mousedev
Once the mouse has been started, you can change the
behavior of the mouse by using the Photon Input
configuration utility.
You can start it by typing
input-cfg
on the command line, by selecting
Mouse in the shelf, or by choosing
Launch-- Configure-- Mouse.
Currently, there s no support for USB keyboards in text mode, but
Intel machines can use BIOS emulation to support them.
Photon supports USB mice and keyboards;
for more information, see
USB devices
later in this chapter.
Touchscreens
Neutrino supports various touchscreens;
check the list of supported hardware on our website to determine which
driver to use for yours.
See also
Input drivers devi-
Determine which options are
appropriate for your setup, and then start the driver.
For example, here s how to start the driver for a Dynapro SC4 touchscreen:
devi-dyna dyna -4 fd -d/dev/ser1
This command starts the driver,
devi-dyna,
using the SC4 protocol -4, and a file descriptor that s
attached to serial port 1 fd -d/dev/ser1.
When you start the driver for the first time,
it returns an error stating that it can t read the calibration file.
To calibrate the touch screen, use the
calib
utility, while running Photon.
Audio cards
By default, the operating system detects your audio card. The enumerators
identify the card and use
io-audio
to start it. Audio
drivers in Neutrino are very simple to initialize. When you use io-audio,
you can use the -d option to pass the driver:
io-audio -vv -d audiopc
To see what other options you can use, see the documentation for
in the Utilities Reference and for your specific card.
If the operating system doesn t detect your card properly, you
can manually start the driver. In order to do this, you need to
identify the card.
You can find a list of supported hardware on our website; see
the
ISA cards
ISA cards are either Plug-and-Play or not.
You typically have to manually set up non-PnP ISA devices.
In order to identify your device, you need to have the manual for your
device or have a way to contact your device s manufacturer e.g. via
their website.
There isn t currently a Neutrino utility that lists the ISA devices that
are installed on a system.
Non-PnP-based
With non-PnP cards, you can manually start the driver and specify
the I/O port, IRQ, and DMA channel.
For example, this command starts the Sound Blaster driver:
io-audio -dsb ioport port,irq req,dma ch,dma1 ch
To find out what to set the I/O port and IRQ to, manually
open the system and look at the card. Then, start the driver using
the configuration settings that the card is set to.
Ensure that the I/O port and IRQ are reserved in the BIOS for non-PCI devices.
you re using a Sound Blaster card, check the following:
If the driver rejects the card, make sure that the I/O port doesn t
conflict
with another piece of hardware. Try changing the I/O port to see if
that helps.
If you hear a bit of sound and then nothing, make sure that the IRQ isn t
conflicting with another device and is reserved in the BIOS. You
can also try changing the IRQ as well.
If the driver starts correctly, but there s no sound,
check the DMA settings on the card and try changing them, if possible.
PnP-based
The device enumerator should configure and start ISA PnP cards.
If it doesn t,
you might need to obtain a copy of isapnp, which is
used to initialize ISA PnP cards. Neutrino doesn t supply this utility,
but it s freely available on the Internet and has been ported
to Neutrino.
PCI Cards
The device enumerator should start PCI cards correctly.
If your PCI card doesn t work, swap PCI slots. Sometimes the
IRQ that s assigned to the particular slot doesn t work well with
the card.
For additional information about the card, use the
utility.
For a list of supported hardware, see our website, as described in
PCCARD and PCMCIA cards
Neutrino supports PCMCIA 1.0/2.0 and CardBUS type cards.
By default, the driver detects the
ISA/PCI based controller. If an adapter isn t detected, check the
supported hardware page to ensure that your PC Card
adapter s chipset is supported.
Currently the driver doesn t let you specify the adapter s I/O port
and IRQ, but you can specify the card s I/O port and IRQ.
If the driver fails to start:
Ensure that the
devp-pccard
server has a free memory window at 0xD4000.
Check the BIOS on the PC or Laptop to see that this memory
isn t cached or used by another device.
Check that the PC Card controller in the BIOS is set to CardBus/16bit,
not PCIC mode.
If the chipset is set up in PCIC compatible mode, the chip works
like an Intel 82365-compatible PCMCIA controller and
isn t visible in the PCI space. If the chipset
is set to CardBus/16bit, the chip is visible in the PCI
space and operates as a PC Card adapter.
To display PC Card information, use the
pin
The output that appears on your screen should look like this:
pin
Sock Func Type Flags PID Base Size IRQ
1 Empty -----MF------ None
2 0 Network C---I- ------ None 0x300 32 7
2 Empty ----MF--------- None
Each socket has two entries because the driver devp-pccard
supports combination cards that give room for two functions in each slot.
The categories displayed in the output example above are:
Sock
The slot where the PC Card is attached. In the example
above, the Network card appears in slot 2.
Func
Used when the card is a multifunction PC Card.
Type
A label for the PC Card s function. If the card is a
Network card, the Type column displays Network.
Flags
Flags that aren t set are marked as -.
The following table lists possible set flags:
This flag:
Has a set value of:
C
Card in
B
Battery low
R
Scheduled to be configured
N
Not enough resources to configure card
I or M
I/O card or memory card
F
Not configured
Window is part of previous configuration
U
Window is an unlockable window
T
Window is a temporary window
Machine booted from this device
X or W
Locked exclusive / locked read/write
Locked read-only
L
Level-mode IRQs
S
Shared IRQs
A
Attribute memory
W
Wide 16-bit memory access
PID
The process ID of the process attached to the PC Card driver
devp-pccard.
Base
The base address of the PC Card. This information is
useful for starting device drivers.
Size
The number of bytes in the I/O port range.
IRQ
The PC Card s IRQ. This information is useful when starting
the driver manually.
USB devices
A Universal Serial Bus USB provides a hot-swappable, common interface for
e.g network, input, character I/O, audio, and hubs.
For more information on USB, USB specifications, and a list of frequently
asked questions, see
www.usb.org.
If you don t know what kind of USB device you re using, you can use the
usb
usb -vvv less
The output from this command looks like this:
Device Address : 1
Vendor : 0x05c7 QTRONIX
Product : 0x2011 USB Keyboard and Mouse
Device Release : r1.12
USB Spec Release : v1.00
Serial Number : N/A
Class : 0x00 Independent per interface
Max PacketSize0 : 8
Languages : 0x0409 English
Current Frame : 511 1024 bytes
Configurations : 1
Configuration : 1
Attributes : 0xa0 Bus-powered, Remote-wakeup
Max Power : 50 mA
Interfaces : 2
Interface : 0 / 0
Class : 0x03 HID
Subclass : 0x01 Boot interface
Protocol : 0x01 Keyboard
Endpoints : Control 1
Endpoint : 0
Attributes : Control
Max Packet Size: 8
Endpoint : 1
Attributes : Interrupt/IN
Interval : 20 ms
Interface : 1 / 0
Protocol : 0x02 Mouse
Max Packet Size: 8
The vendor and product fields indicate the type of device, and possibly what
chipset it uses.
The common types of USB controllers are:
UHCI
Universal Host Controller Interface.
EHCI
Enhanced Host Controller Interface.
OHCI
Open Host Controller Interface made by others.
The EHCI controller supports high speed signalling only.
Either a OHCI or UHCI controller s should be present to
support low- or full-speed devices.
If your system doesn t have an EHCI controller, the
device will work at the slower speed.
The operating system needs to run the stack in order to know
how to interact with USB devices and controllers.
You need to:
Identify your controller.
The documentation for the hardware should describe the type
of controller OHCI, UHCI, or EHCI.
If you don t know what type of controller you re
using, you can identify it using:
pci -vvv
Find the entry for the USB controller to determine
the manufacturer/vendor ID and device ID. You can either find
the information on the manufacturer s website
www.usb.org,
or use the vendor and device IDs to cross-reference it at
The class codes that appear in the output from pci -vvv are:
Class Code
Controller Type
0c0300
0c0310
0c0320
There might be multiple chips and therefore multiple drivers that you need
to load.
You can also try running just one of the USB stacks;
if it fails, try running another stack.
Log in as root and start the
io-usb
stack with the appropriate module:
This should create an entry in /dev called
/dev/io-usb/io-usb.
If you re starting the USB stack
and a driver in your startup scripts,
make sure that you use the
waitfor
command to make sure that /dev/io-usb/io-usb has appeared
before you start the driver.
io-usb -dohci
waitfor /dev/io-usb/io-usb
devu-prn
When the stack is running, start the device drivers, as described
USB hubs don t need a driver; the stack itself supports them.
Printers
For a USB printer, start the USB stack, and then
devu-prn.
Photon supports USB Human-Interface Devices HID such as keyboards and mice.
To connect USB HIDs:
Start the USB stack, as described above.
Start
io-hid,
loading the
devh-usb.so
module:
io-hid -dusb
If your system also uses serial or PS/2 input devices, you can load the
devh-ps2ser.so
module as well.
After starting Photon, start
devi-hid
for the USB HID devices as follows:
devi-hid kbd -u USB_device_number mouse
You can start io-hid in your rc.local file,
but not devi-hid,
because Photon hasn t started when your system runs rc.local.
Instead, add the devi-hid command to the input trap file; see
In Photon, once the devices are running, you can use the
utility
to configure the mouse.
From the shelf, click
You can use the
hidview
utility to get information about the human-interface devices.
For USB touchscreens, start the USB stack, then
io-hid,
loading the
devh-usb.so
Then, start
devi-microtouch:
devi-microtouch microtouch touchusb
Ethernet adapters
For Ethernet adapters, start the USB stack, then
io-net,
loading the appropriate driver.
For example, to start the driver for a Kawasaki-based USB Ethernet adapter,
do the following:
io-net -dklsi options
Mass-storage devices
devb-umass
driver supports devices that follow the
Mass Storage Class Specification.
You can determine that the device is suitable by looking for the following
information in the output from usb -vv:
Mass Storage Class 08h
SubClass Code Command Block Specification
01h Reduced Block Command RBC
02h SFF-8020i, MMC-2 ATAPI
04h UFI
05h SFF-8070i
06h SCSI transparent
Protocol Code Protocol Implementation
00h Control/Bulk/Interrupt
with command completion interrupt
01h Control/Bulk/Interrupt
with no command completion interrupt
50h Bulk-Only Transport
To use a USB mass-storage device on a Neutrino system, start
io-usb
as described above, then the devb-umass driver.
By default, this driver creates an entry for disk-based devices
in /dev in the form
/dev/hdn, where n is the drive number.
Once you ve started the driver, you can treat the device like a disk.
For example, for a mass-storage device that uses the UHCI controller, type:
io-usb -d uhci
devb-umass cam pnp
Troubleshooting
No device is created in /dev.
The device might not conform to the Mass Storage Class Specification.
Check the output from usb -vv.
No fdn device was created in
/dev for a floppy drive.
The default name is /dev/hdn.
You can use the name command-line option to
cam-disk.so
to override the prefix.
Character devices
General serial adapters
By default, a serial port driver automatically detects the I/O port and IRQ.
A standard PC system uses the
devc-ser8250
driver; the BSP documentation
indicates the drivers specific to your target hardware.
If the driver doesn t detect all the serial ports, ensure that the ports are
enabled in the BIOS.
If the ports are enabled, try specifying the I/O port and
IRQ of the ports when you start the driver.
Use a comma to separate the I/O port and the IRQ; use a space to separate
each port-IRQ pair in the command.
devc-ser8250 3f8,4 2f8,3
If you start a serial driver for a UART or modem when another serial driver
is already running, you need to use the -u option to give the
new driver a number to append to the device name so that it doesn t
conflict with any existing /dev/ser entry.
The standard devc-ser8250 driver supports only the
RS-232 protocol.
The Character Driver Development Kit DDK includes
the source to devc-ser8250,
which you can use to implement any additional protocols or features.
The serial drivers support software and hardware flow control:
To enable software flow control, start the serial driver with the
-s option, or use
stty
after starting the driver:
stty osflow isflow /dev/ser1
To disable software flow control, start the driver with the
-S option, or use:
stty -osflow -isflow /dev/ser1
To enable hardware flow control, start the driver with the
-f option, or use:
stty ohflow ihflow /dev/ser1
To disable hardware flow control, start the driver with the
-F option, or use:
stty -ohflow -ihflow /dev/ser1
In edited mode -e, flow control is disabled.
Don t enable software and hardware flow control at the same time.
Heavy serial port usage can be very taxing on some systems;
by default, the serial adapter triggers an interrupt for each character
transmitted or received.
You can use these options to reduce the number of interrupts:
-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.
A receive timeout guarantees that the characters won t remain buffered too
long.
For example, imagine that the device receives:
This sentence is coming across the serial port.
By default, the system has to service 47 interrupts to receive this sentence.
If you set the receive trigger level to 14,
the number of interrupts is reduced to four.
This helps the overall system performance, but you re trading off reliability;
the higher the receive trigger -t, the higher the possibility
of losing data.
Multiport serial adapters
For multiple serial adapters, you may need to specify the I/O port
and IRQs manually in the driver for each port see
General serial adapters
for examples. By default, the driver should detect the ports and IRQs,
but with some multiport adapters,
the enumerators don t detect the ports correctly.
You can edit the
enumerators to detect your multiport card and have it set up each
port for you. You need to edit the
/etc/system/enum/devices/overrides file;
chapter in this guide,
Parallel ports
On a standard PC and some x86 systems, parallel ports use the
devc-par
driver; see the BSP documentation for the driver for your target hardware.
By default, the driver detects the parallel port. If you need
to, you can use the -p option to specify the location
of the parallel port.
If the driver fails to detect your parallel port, ensure that
the port is enabled in the BIOS. If that fails, try specifying
the I/O port when you start the driver.
Terminals
On a standard PC and some x86 systems, the
devc-con
driver controls the physical console, which consists of the
display adapter, the screen, and the system keyboard.
By default, the driver is configured for up to four virtual
consoles, /dev/con1 /dev/con4.
The devc-con driver is also the keyboard driver for
non-USB keyboards in text mode. You can start the driver with this
command:
devc-con
I/O attributes
To set or display the I/O attributes for a character device tty, use the
stty
For more information about setting up your terminal, see
Terminal support
in Using the Command Line.
Network adapters
The main steps in setting up a network adapter are:
identifying your Network Interface Card NIC
starting the driver
making sure the driver and hardware communicate
Identify your NIC
The documentation for the hardware should describe the type of
chipset used.
If you don t know what type of chipset you re using, you can
identify it using pci -vvv.
Find the entry for the Network controller and it ll give you
details on the manufacturer/vendor ID and device ID. Either find
the information on the manufacturer s website, or use the vendor
ID and device ID to cross-reference it with this online site:
With the information you get from that site, you can visit the
QNX supported hardware site; see
In the Network section, locate your chipset and its
associated driver.
Start the driver
Once you ve located the correct driver for your hardware, use
io-net
to start the driver. You can either
start the driver as an option to io-net, or you can
mount the driver into an already running copy of io-net.
For example, to start io-net with the
devn-el900.so
3Com 905 module, type:
io-net -d el900 -t tcpip
To mount the module, type:
io-net -t tcpip
mount -T io-net devn-el900.so
The driver automatically detects similar network adapters
for multiple networks. You can use the mount utility to mount different
adapters.
Make sure the driver is communicating properly with the hardware
Use the
nicinfo
utility to check if you re receiving
and sending packets. If you aren t receiving packets on a high-traffic
network, the driver and the hardware might not be communicating.
Here s some typical output from this command:
Physical Node ID 000102 C510D4
Current Physical Node ID. 000102 C510D4
Current Operation Rate 100.00 Mb/s full-duplex
Active Interface Type. MII
Active PHY Address. 3
Power Management State Active
Maximum Transmittable data Unit 1514
Maximum Receivable data Unit 1514
Receive Checksumming Enabled TCPv6
Transmit Checksumming Enabled. . TCPv6
Hardware Interrupt. 0x5
DMA Channel. . 0
I/O Aperture. 0xd400 - 0xd47f
ROM Aperture. 0
Memory Aperture. 0xe6000000 - 0xe6000FFF
Promiscuous Mode Off
Multicast Support. . Enabled
Packets Transmitted OK 104
Bytes Transmitted OK. . 10067
Broadcast Packets Transmitted OK. . 6
Multicast Packets Transmitted OK. . 1
Memory Allocation Failures on Transmit. . 0
Packets Received OK 1443
Bytes Received OK. . 168393
Broadcast Packets Received OK. . 427970
Multicast Packets Received OK. . 37596
Memory Allocation Failures on Receive 0
Single Collisions on Transmit. . 0
Multiple Collisions on Transmit 0
Deferred Transmits. 0
Late Collision on Transmit errors. 0
Transmits aborted excessive collisions 0
Transmits aborted excessive deferrals . 0
Transmit Underruns. 0
No Carrier on Transmit 0
Jabber detected. 0
Receive Alignment errors. 0
Received packets with CRC errors. . 0
Packets Dropped on receive. . 0
Ethernet Headers out of range. . 0
Oversized Packets received. . 0
Frames with Dribble Bits. 0
Total Frames experiencing Collision s . . 0
The output from nicinfo depends on what the driver supports;
not all fields are included for all drivers.
However, the output always includes information about the bytes and
packets that were transmitted and received.
The categories shown in the above example are described below.
When dealing with a network problem, start with these:
Physical Node ID
The physical node ID is also known as the Media Access Control
MAC address. This value is unique to every network card, although
some models do let you assign your own address. However, this
is rare and generally found only on embedded systems.
If the value represented is
FFFFFF FFFFFF
or
000000 000000,
there s likely something wrong with the setup of the hardware,
or you need to assign a MAC address to the card. Check
the hardware manual to see whether or not this is the case.
If the hardware didn t get set up correctly, the MAC address
may not always appear as shown above.
The first six digits of the MAC address are the vendor ID.
Check the entries against the list at
to
see if the vendor ID is valid. Then check the card ID the last 6 digits.
The card ID should be something semi-random. A display similar to
444444 is likely incorrect.
Current Physical Node ID
The current physical node ID is shown if a card has been set
up to spoof the ID of another card. Basically, a
parameter is passed to the driver telling it that the node s ID
is actually the value that appears. Depending on the card, some
drivers will accept this. What spoofing does on a higher software
level, is filter out the packets that were meant for this node ID.
This method is considerably slower than if you let the card filter
out the packets on a hardware level. Because the card is set in promiscuous
mode, it has to accept all packets that come in and use a software
mode to sort them.
Another way of thinking about this is to compare
it to a postal system, where if we wanted to pretend to
be someone else, we would accept all mail from the Post Office.
However, we would then have to sort all the mail. This would take
a much longer time compared with the amount of time the Post Office
would take to presort the mail, and give us only the mail addressed
to us.
Promiscuous Mode,
Current Operation Rate
The media rate is the speed at which the network card operates.
On most cards, it s either 10Mb/s or 100 Mb/s. This display
also shows what form of duplex the card uses. Most cards run at
half or full-duplex transmission:
Full-duplex transmission means that data can be transmitted
in both directions simultaneously.
Half-duplex data transmission means that data can be transmitted in
both directions, but not at the same time.
The easiest way to illustrate this is to think of a road.
If the road has two lanes, it s full-duplex, because cars can drive in both
directions at the same time without obstructing the other lane. If the road
has only a single lane, it s half-duplex, because there can be only one car on
the road at a time.
When you examine the media rate, check the speed, the form of duplex, and
what the hub supports.
Not all hubs support full-duplex.
Active Interface Type
This is the type of interface used on the Ethernet adapter.
This is usually UTP unshielded twisted pair, STP shielded
twisted pair, Fiber, AUI Attachment Unit Interface, MII, or BNC
coaxial.
Active PHY Address
This is an identifier that tells you which of the physical
PHYs were used to interface to the network. The numbers
range from 0 - 31 and change, depending on
whether or not you specified a specific PHY or if you let the
driver select the default which varies from card to card.
Power Management State
This value tells you the NIC s current power status:
Off, Standby, Idle, or Active.
If you can t send or receive packets, make sure the status
is Active; if it isn t, there may
be a problem with power management on your system.
Maximum Transmittable data Unit
The Maximum Transmittable data Unit MTU is the size of the largest
frame length that can be sent on a physical media. This isn t
commonly used for debugging; however, it may be useful for optimizing
a network application. A value of 0 is invalid and is a
good indicator that the card isn t set up correctly.
The default value is 1514.
Maximum Receivable data Unit
This is the MTU s complement; it affects the largest frame length
that can be received. The default value is 1514.
Receive Checksumming Enabled, Transmit Checksumming Enabled
Not all cards support these options.
If your adapter supports them, they tell your card which
check-summing method to use: IPv4, TCPv4, UDPv4, TCPv6, or UDPv6.
Hardware Interrupt
The hardware interrupt is the network card s interrupt request
line IRQ. How an IRQ is assigned depends on whether the card
is a PCI or an ISA card. In the case of a PCI card,
pci-bios
assigns
the IRQ; for an ISA card, the IRQ is hard-wired.
Two ISA devices can t share the same IRQ, but two PCI devices can.
DMA Channel
This is the DMA channel used for the card.
This varies, depending on the card and on the channels it has available.
I/O Aperture
The I/O aperture is a hexadecimal value that shows the address in I/O space
where the card resides.
The I/O aperture uses the I/O address between the given values
to locate and map the I/O ports.
The range depends on the platform.
Memory Aperture
The memory aperture is a hexadecimal value that shows the address in
memory where the card s memory is located.
The memory aperture uses the memory address between the given values to
locate and map memory.
ROM Aperture
The ROM aperture is a hexadecimal range that shows the address of the
card s ROM.
The ROM aperture uses the memory address between the displayed values
to locate and map memory.
Promiscuous Mode
When a card is placed in promiscuous mode,
the card accepts every Ethernet packet sent on
the network. This is quite taxing on the system but is a common
practice for debugging purposes.
Also, when a card is placed in
promiscuous mode, a network MAC address can be spoofed,
i.e. the card accepts all packets whether they re addressed
to it or not. Then on a higher software level, you can accept packets
addressed to whomever you please. Promiscuous mode is disabled by
default.
Multicast Support
When you enable multicast mode, you can mark a packet with a
special destination, so that multiple nodes on the network may receive
it. Multicast packets are also accepted.
Packets Transmitted OK
Before you look at this value, determine that some form of network transfer
ping,
telnet,
file transfer was attempted.
If a card isn t set up properly, the number of sent packets shown
here is either very small or zero. If the card
isn t displaying any sent packets, the cause is probably a driver
problem. Check all the options you re passing to the driver; one
or more may be incorrect.
Bytes Transmitted OK
This is the number of bytes of data sent on the network.
This value increases with the number of packets transmitted on the
network.
Total Packets Transmitted Bad
You can use this statistic to determine if you have faulty hardware.
If all the sent packets are reported as bad,
there s likely a hardware problem, but you might be using the wrong driver.
Check the
hardware for compatibility. If it looks as if it s hardware-related,
try switching the hardware to see if the problem disappears.
Broadcast Packets Transmitted OK
This is the number of broadcast packets transmitted from the NIC.
Multicast Packets Transmitted OK
This is the number of multicast packets transmitted from the NIC.
Memory Allocation Failures on Transmit
Before transmitting data, the driver reserves system memory for
a buffer to hold the data to be transmitted. Once the
card is ready, the buffer is sent to it.
When a memory-allocation error occurs, the system is likely very low on memory.
Make sure that there s sufficient memory on the system; if
you continuously get this error, consider adding
more memory. Another thing to check for is memory leaks on the
system, which may be slowly consuming system memory.
Packets Received OK
This value states how many packets were successfully received
from the network card. If a card is having problems receiving data,
check the cables and the hub connection. Problems receiving data
might be related to the driver.
It s possible the driver can be properly
set up and able to send data, but may not be able to receive. Usually
when data is received but doesn t get sent, the driver is the cause.
Check the driver s setup to make sure it s initialized correctly.
to check the system log for clues.
Bytes Received OK
This is the number of bytes of data received from the network.
This value increases with the number of packets received.
Single Collisions on Transmit
This is the number of collisions that were encountered while
trying to transmit frames.
The NIC checks
for a carrier sense when it knows that the network hasn t been used
for a while, and then starts to transmit a frame of data.
The problem occurs when two network cards check for the
carrier sense and start to transmit data at the same time.
This error is more common on busy networks.
When the NICs detect a collision, they stop transmitting and
wait for a random period of time.
The time periods are different for each NIC, so in theory, when the wait time
has expired, the other NIC will have already transmitted or will
be still waiting for its time to expire, thus avoiding
further collisions.
You can reduce this type of problem by introducing a full-duplex network.
Multiple Collisions on Transmit
This error is due to a attempted transmission that has had
several collisions, despite backing off several times.
This occurs more frequently on busy half-duplex networks.
If there are a lot of these errors, try switching to a full-duplex network,
or if the network is TCP/IP based, try introducing a few switches
instead of hubs.
Deferred Transmits
Commonly found on half-duplex networks, this value doesn t mean that there
are problems.
It means that the card tried to
send data on the network cable, but the network
was busy with other data on the cable. So, it simply
waited for a random amount of time. This number can get high if
the network is very busy.
Late Collision on Transmit errors
Late-collision errors that occur when a card has
transmitted enough of a frame that the rest of the network should
be aware that the network is currently in use, yet another system
on the network still started to transfer a frame onto the line.
They re the same as regular collision errors, but were
just detected too late.
Depending on the protocol, these types of errors can be
detrimental to the protocol s overall throughput. For example, a
1 packet loss on the NFS protocol using the default
retransmission timers is enough to slow the speed down by approximately 90.
If you experience low throughput with your networking,
check to make sure that you aren t getting these types of errors.
Typically, Ethernet adapters don t retransmit frames that have been
lost to a late collision.
These errors are a sign that the time to propagate the signal
across the network is longer than the time it takes for a network
card to place an entire packet on the network.
Thus, the offending
system doesn t know that the network is currently in use, and it
proceeds to place a new frame on the network.
The nodes that are
trying to use the network at the same time detect the error
after the first slot time of 64 bytes. This means that the NIC detects
late collisions only when transmitting frames that are longer than 64 bytes.
The problem with this is that, with
frames smaller than 64 bytes, the NIC can t detect the error.
Generally, if you experience late collisions with large frames on
your network, you re very likely also experiencing late
collisions with small frames.
These types of errors are generally caused by Ethernet cables that are
longer than that allowed by the IEEE 802.3 specification, or are
the maximum size permitted by the particular type of cable, or
by an excessive amount of repeaters on the network between
the two nodes.
Another thing to note is that these errors may actually be caused
by a node on the network that has faulty hardware and is sending
damaged frames that look like collision fragments.
These damaged frames can sometimes appear to a network card to be
a late collision.
Transmits aborted excessive collisions
This error occurs if there are excessive collisions on the
network. The network card gives up on transmitting the frame
after 16 collisions. This generally means that the network is
jammed and is too busy.
Routers also give up on transmitting a frame if they experience
excessive collisions, but instead of alerting the original
transmitter, routers simply discard the frame.
If these sort of errors are being experienced, see if the
network can be reduced, or introduce a strategically placed switch
into the network to help eliminate the number of packets that are
being placed on the entire network.
Switching to a full-duplex network also resolves these problems.
Transmits aborted excessive deferrals
Aborted transmissions due to excessive deferrals mean that the NIC
gave up trying to send the frame, due to an extremely busy
You can resolve this type of problem by switching to a full-duplex network.
Transmit Underruns
Chips with a DMA engine may see this error. The DMA engine copies
packet data into a FIFO, from which the transmitter puts the
data on the wire. On lower-grade hardware, the DMA might not be
able to fill the FIFO as fast as the data is going on the wire, so
an underrun occurs, and the transmit is aborted.
No Carrier on Transmit
When the NIC is about to transfer a frame, it checks first to
make sure that it has carrier sense much like before you dial the
phone, you check to make sure you have a dial tone. While the NIC
is transmitting the frame, it listens for possible collisions
or any errors. These errors occur when a NIC is transmitting a
frame on the network, and it notices that it doesn t see its own
carrier wave much like when you are dialing a number on the phone
and you can hear the dial tones being pressed.
These errors are caused by plugging and unplugging cables on the
network and by poor optical power supplied to the
Fiber Optic Transceiver FOT.
Jabber detected
You typically see this error only on a 10Mbit network.
It means that a network card is continuing to transmit after a packet
has been sent. This error shouldn t occur on faster networks, because
they allow a larger frame size.
Receive Alignment errors
A receive-alignment error means that the card has received a
damaged frame from the network. When one of these errors occurs,
it also triggers an FCS Frame Check Sequence error.
These errors occur if the received frame size isn t a
multiple of eight bits one byte.
These errors are commonly due to faulty wiring, cable runs that
are out of the IEEE 802.3 specification, a faulty NIC, or
possibly a faulty hub or switch. To narrow down this problem, do a
binary division of the network to help eliminate the source.
Received packets with CRC errors
An entry in this field indicates the number of times, on a hardware
level, the card received corrupt data.
This corruption could be caused by a faulty hub, cable, or network card.
The best way to try to solve Cyclic Redundancy Check CRC
errors is to do a binary division of the
systems on the network to determine which system is sending bad
data. Once you ve done that, you can start replacing the hardware
piece by piece. Because this error is on the receiving end, it s
difficult to determine if the CRC is bad on a sent packet.
Packets Dropped on receive
This usually means you got an overrun while receiving a packet. This
has to do with DMA and the FIFO, like a Transmit Underrun, except
in this case, the DMA engine can t copy the packet into memory as
fast as the data is coming from the network, and the packet gets
dropped.
Like the Transmit Underrun, this is generally due to poor
hardware.
Ethernet Headers out of range
This entry indicates the number of packets whose Ethernet type/length
field isn t valid.
Oversized Packets received
An oversized packet is simply a received packet that was too big
to fit in the driver s Receive buffer.
Frames with Dribble Bits
Dribble bits are extra bits of data that were received after the
Ethernet CRC.
They re commonly caused by faulty hardware
or by Ethernet cabling that doesn t conform to the 802.3
specifications.
Total Frames experiencing Collision s
This is the total number of frames that have experienced a
collision while trying to transmit on the network. This can
sometimes be high, depending on how busy the network is.
A busy network experiences these types of errors more often than
a quiet one.
Modems
You can have any of the following types:
Internal ISA Plug-and-Play or not
PCI-based
External
Cable
Internal modems
Internal modems can be ISA
and are either Plug-and-Play PnP or not.
You have to manually set up non-PnP ISA devices.
In order to identify your device, you need to have the documentation
for the device, or be able to contact the device manufacturer to
have it identified. Currently, there is no utility within Neutrino to
obtain a list of ISA devices installed on your system.
ISA non-PnP
Configure the modem to use an I/O port and IRQ that don t conflict
with anything else in the system.
driver should autodetect the
modem and it should appear in the /dev directory as
serx, where x is an integer.
There may be more than one entry under the name. Assume that
the first two entries represent the comm ports of the system.
Any additional entry is likely the modem.
If in doubt, try all ser entries
with
qtalk.
Testing Modems,
Entries will usually appear in this fashion:
Comm1 is enabled in the BIOS
Comm2 is disabled
Modem is configured to Comm2 s ioport and IRQ
In the /dev directory you ll see:
ser1 -- Comm1
ser2 -- Modem
ISA PnP
If you have an ISA PnP modem that can be manually
assigned an IRQ and I/O port via jumpers, we recommend that you use the manual
method rather than Plug-and-Play.
driver should automatically detect the
modem, which should appear in the /dev directory
as serx, where x is an integer.
There may be more than one entry in /dev under
the name ser.
Assume that the first two represent
the comm ports of the system. Any additional entry is likely
the modem. However, if in doubt, try all ser entries
If the modem isn t detected, seek out the isapnp utility
to configure the modem s I/O port and IRQ, and then specify them when you
start devc-ser8250.
PCI-based modems
If no entry is created, check the output from pci -vvv and
see what I/O port and IRQ are assigned to the modem. Use the correct
I/O port and IRQ from pci -vvv to start devc-ser8250.
When you use the appropriate I/O port and IRQ, the /dev directory
entry gets created for you.
External modems
External modems are easy to set up. Look in the /dev directory
for the serial port that the modem is attached to. You ll attach
this at the back of the system. If you know the modem is attached
to serial port 1, then look in the /dev directory
for ser1.
Cable Modems / ISDN
We assume that your cable modem is attached to your system via
a network card and that the driver for your card has been started and
is running properly.
If this isn t the case, see
Network adapters,
earlier in this chapter.
To set your configuration, use the TCP/IP configuration tool.
phlip
on the command line, by selecting Network from Photon s shelf, or by
choosing
Launch-- Configure-- Network.
Then do the following:
Go to the Devices tab and use these settings:
Choose en0.
Choose DHCP for the connection.
In the Server field, enter the machine ID given by
the cable network operator.
Go to the Network tab and use these settings:
Use the machine ID as the hostname.
Set the domain name to be the domain name of your cable network operator.
Set the gateway to be the IP address of your cable network operator.
The default netmask 0.0.0.0 is filled in automatically.
In the Name Servers field, add any IP addresses
you know there may be more than one.
The first entry should be
the IP address of your cable operator.
Reboot your machine. DHCP will start automatically.
Testing modems
You can use
qtalk
to test your modem:
Make sure the modem is plugged into the phone line.
command to set the modem s baud rate.
For example, to set the speed of the modem on /dev/ser1
to 57600 56K modems use this speed, type:
stty baud 57600 /dev/ser1
Type qtalk -mdevice, where device
is the name of the serial port e.g. /dev/ser1.
Type at.
The modem should reply OK.
Troubleshooting modems
If you followed the instructions above,
but the modem doesn t reply OK, check the following:
Make sure your baud rate settings are correct.
Is the modem plugged in.
Is the modem a software modem.
Neutrino doesn t support Win modems or HSP Host Signal Processor modems
otherwise known as soft modems.
Neutrino works with PnP modems, but
you must specify in the BIOS that you aren t running a PnP-aware OS.
Does the modem conflict with another device at the same I/O port
and IRQ.
If the modem is an internal ISA modem, you may need to reserve an I/O port
range and IRQ in the BIOS so that the PCI doesn t use it.
Have you disabled the comm port in the BIOS if you re using the
same I/O port and IRQ of a comm port. This applies only to internal
modems.
Video cards
Our website includes a list of the video cards Neutrino supports; see
Automatically detecting your card
By default, the operating system uses the
crttrap
utility to detect your video card.
We provide crttrap as a convenience utility;
in a static hardware environment embedded board, you shouldn t need it.
Ensure you have a graphics-modes file or the correct
command line in your startup scripts to start your video card.
Don t run crttrap while you re running Photon.
The crttrap program queries the card to get all of its possible
configurations and creates a file called
/etc/system/config/graphics-modes
that you can edit.
The first line in this file is the one that io-graphics uses.
For information about the different graphics options, see
io-graphics
In an embedded system, you don t need to use crttrap to get
the configuration, because it isn t likely to change.
Instead, you can call io-graphics directly, specifying the
appropriate options.
io-graphics -dl devg-rage.so options.
Neutrino s default setup starts the graphics driver for you via
the ph script located in /usr/bin.
Changing video modes in Photon
To change the video modes of your graphics adapter in Photon,
use the Display Configuration tool.
phgrafx
on the command line, by selecting Graphics from the shelf, or by choosing
Launch-- Configure-- Graphics.
To change the video modes:
Select the configuration that you want to use.
Click Apply.
The screen turns black, and then should go into the new mode.
If the mode you selected didn t work properly, you can wait for 15 seconds,
at which point the display automatically reverts to the previous settings,
or you can press Esc or Enter.
When the mode has changed and seems to be working properly, click Accept.
This utility also lets you change the driver, resolution, refresh rate,
and palette 8-bit color mode only, and disable the hardware cursor.
If you want to edit the command line that s used to start the adapter,
click the Advanced button.
This is the same as editing the
top line in the graphics-modes file.
Manually setting up your video card
Identify your video adapter. The documentation for the hardware
should describe the chipset used on your adapter.
Identify which driver you should be using.
Use the list of supported hardware to determine which driver is
appropriate for your adapter; see
Test the driver by using
io-graphics
to start it manually:
io-graphics -drage
vid 0x1002,did 0x4755,index 0,xres 1024,photon,yres 768,bitpp 16,refresh 80
-pphoton
For information about the options, see
Graphics drivers devg-
in the Utilities Summary in the Utilities Reference, as
well as the entry for
io-graphics.
You ll also need to start Photon and other utilities to ensure
that this is working correctly. The best thing to do is create
a script that starts Photon. See the
ph
script for
ideas and examples.
You can also manually add this command to the graphics-modes
file at
the top line to test it out.
Setting up multiple displays
configuration file to
set up a dual- or multiple-monitor display.
You can configure either
two or more separate cards for multiple displays, or a
single device to support multiple displays. These graphics device
drivers support multiple displays:
devg-radeon.so
Graphics driver for ATI RADEON chipsets
devg-matroxg.so
Graphics driver for Matrox Millenium G-series chipsets
For specific chipsets and the number of displays supported, see the
documentation for
and devg-matroxg.so
For information about the io-graphics configuration
file format and the options you can set, see
The io-graphics configuration file
in the documentation for io-graphics in the
Utilities Reference.
utility or io-graphics command line
to configure only single displays, not multiple displays.
We don t guarantee support for arbitrary combinations of video cards.
Here s a step-by-step example of creating a configuration file
for a Radeon 9700 Pro video card for dual-headed display:
Create the GLOBAL section. This has a single
entry, devices, that lists all the video cards supported.
In this example, there s one device:
GLOBAL devices radeon
For each device, create a DEVICE.name section.
This section configures the hardware-specific settings. In this example,
we set the:
graphics driver DLL, which is typically in the form devg-device_name.so,
or in this case devg-radeon.so
hardware vendor and device ID and the PCI index; see
PCI/AGP devices,
earlier in this chapter
number of displays supported by the device; 2 in this case
plugins, which in this case is the Photon plugin
Photon server, which we leave blank to use the default Photon
server specified by the PHOTON environment variable
/dev/photon by default
DEVICE.radeon
dllpath devg-radeon.so
pci_vendor_id 0x1002
pci_device_id 0x4e44
pci_index 0
displays 2
plugins photon
photon
For each display, create a DEVICE.name.number section.
These sections configure each display. In this example, each display
has the same resolution 1024 768, color depth 16 bit color,
and refresh rate 60 Hz. Notice that the second display Photon
region is offset by 1024, the width of the first display.
DEVICE.radeon.0
xres 1024
yres 768
bitpp 16
refresh 60
DEVICE.radeon.1
region_x 1024
For each plugin, create a PLUGIN.name section.
In this example, we set the Photon plugin DLL:
PLUGIN.photon dllpath gri-photon.so
Save the configuration file, in this case as /usr/photon/config/radeon.conf.
Load the configuration file and start the graphics driver by using the
-c option
of io-graphics:
io-graphics -c/usr/photon/config/radeon.conf
Here s the complete example:
GLOBAL
devices radeon
PLUGIN.photon
dllpath gri-photon.so
Here s a second example that shows how to use two different
devices for two displays:
devices banshee rage128
DEVICE.banshee
dllpath devg-banshee.so
pci_vendor_id 0x121a
pci_device_id 0x5
xres 1280
yres 1024
bitpp 32
DEVICE.rage128
dllpath devg-ati_rage128.so
pci_device_id 0x5050
region_x 1280
Troubleshooting your video card
Here are some things to check if
fails to detect
your video card or has problems:
The display is slightly misaligned on the monitor.
Each monitor behaves differently in certain resolutions and refresh
rates. If Photon seems to be slightly off center, you may need to
use the controls on your monitor to adjust the display to properly
align with the video mode. See your monitor s documentation for more
information.
The refresh rate isn t correct, the display isn t centered, or
in the worst case there s no display at all.
The timings set by drivers might not match the timings required by the
monitor or LCD.
You might have to edit /usr/photon/config/crtc-settings.
This file contains the timing information required by many drivers to set
the standard resolutions and refresh rates.
Many older drivers, as well as the generic drivers, don t use this file,
because they use the video BIOS to set the graphics mode.
If this file isn t present, the timings are calculated using a
generic timing formula GTF.
The GTF isn t completely accurate; you can manually edit the
crtc-settings file to set the exact timing for
the resolution and refresh rate.
At least the following drivers use this file:
devg-ati_rage128.so
devg-banshee.so
devg-chips.so
devg-flat.so
devg-i810.so
devg-i830.so
devg-igs5000.so
devg-mq200.so
devg-s3_savage.so
devg-sis630.so
devg-tnt.so
devg-tvia.so
devg-vmware.so
The modes detected are incorrect.
In some circumstances, a card s modes file doesn t list all the
modes that the documentation for the card says it should. Sometimes
there are variants of cards that are slightly different from what
we have had internally or what the documentation describes. You
can try manually setting up the card see
Manually setting up your video card,
above to see if that helps.
If it still fails, you may need to contact Technical Support.
The video mode changed to a mode that doesn t work.
If you ve changed the video mode to a mode that either your monitor
or graphics card doesn t support and that causes
Photon to be displayed improperly, you can revert to a previous mode, as
follows:
Restart the system and boot into safe mode don t start
Photon.
Clear the modes file. From the command line type: crttrap clear
Restart your system and try to detect your video card again.
The crttrap program hangs.
If crttrap hangs i.e. it doesn t start Photon
and leaves you with a black screen, try the following:
Ensure that your graphics card is supported.
Clear the modes file. From the command line type:
crttrap clear
If this fails, clear the modes file, but don t restart the system.
Then run crttrap manually from
the command line with the verbose option:
crttrap trap -VVVVV
If crttrap hangs again, you should be able to see
where it failed or what the last adapter it tried to detect was.
If you can determine the adapter that it failed to trap,
remove it from the trap list by editing
/etc/system/config/graphics-traplist.
The list that s generated comes from the enumerators, so you might have
to change the enumerators so they no longer detect
the card in your system, e.g. if you have two video cards in your
system.
You can find the enumerators in
/etc/system/enum/devices/graphics.
Once you ve removed the offending device from the traplist,
check to see if crttrap detects the card properly:
If crttrap still hangs, try setting the mode manually by
editing /etc/system/config/graphics-modes.
Create this file it if it doesn t already exist.
Also keep in mind that you can always run
the Vesa generic driver,
devg-vesabios.so.
Your graphics card isn t detected.
If you have a card that you expect to work with one of our accelerated
drivers, but you get only the generic drivers detected by crttrap,
you might have a chipset that s missing from the graphics enumerator.
Try the following:
Look in /etc/system/enum/devices/graphics for the
driver that you think you should run.
For example, if you re using a Radeon card, look for
devg-radeon.so.
Edit /etc/system/enum/devices/overrides and
add an entry for your card.
You need to specify the PCI Vendor and Device ID of the chipset, which
you can find by using the
pci
utility.
Add a line after the last known PCI ID and before
the line:
cfg fname, /etc/system/config/graphics-traplist
Save the file and reboot the system.
If you edited the enumerator correctly, there should be an entry in
/etc/system/config/graphics-traplist with the driver you
hope to run.
Run:
crttrap trap
The driver you want should now have been used and detected.
Sometimes this procedure works, other times it doesn t.
If it doesn t work, use one of the generic drivers or contact us about
adding support for your graphics chipset.
Even if this procedure works, we can t guarantee the driver will work as
expected.
If the device ID wasn t in the graphics enumerator, we haven t tried
that hardware and therefore can t guarantee it will work properly.
pci_attach_device
QNX Developer Support
Download the latest drivers for your PCI Device to keep your Computer up-to-date.
Attach a driver to a PCI device
Synopsis:
include
void pci_attach_device
void handle,
uint32_t flags,
uint16_t idx,
struct pci_dev_info info ;
Arguments:
handle
A handle that identifies the device.
The first time you call this function, set handle to
NULL.
This function returns a handle that you can use in a subsequent call
to allocate resources for the device.
flags
Flags that tell the PCI server how you want it to handle resources, which
resources to scan for, and which resources to allocate; see
Flags,
below.
idx
The index of the device: 0 for the first device, 1 for the second,
and so on.
info
A pointer to a
pci_dev_info
structure see below that specifies the
class code, vendor/device ID, or bus number and device/function number that
you want to scan for.
The function fills in this structure with information about the device.
Library:
libc
Use the -l c option to
qcc
to link against this library.
This library is usually included automatically.
Description:
The pci_attach_device function attaches a driver to a PCI
device.
You must successfully call
pci_attach
before calling any of the other PCI functions.
Typically drivers use this function to attach themselves to a PCI
device, so that other drivers can t attach to the same device.
If you specify the
PCI_SHARE flag see
below, then multiple drivers can attach to the same device.
The server can scan based on a class code, vendor/device ID, or bus number
and device/function number.
To control the server scanning, initialize the
appropriate fields of the info structure and set the
appropriate flags.
When you first attach to an uninitialized device, the PCI server assigns all
the I/O ports, memory and IRQs required for the device.
It also does the IRQ routing for you.
Once this has completed successfully, it fills in all these
values into your pci_dev_info structure to return these values
to your application.
When a driver attaches to a device, the PCI server allocates the
necessary resources for the device from procnto using the
rsrcdbmgr calls.
On X86 BIOS systems, these resources are normally allocated by the BIOS, but on
non-x86 systems, these resources have to be allocated from procnto.
You can detach the device by passing its handle to
pci_detach_device.
If you call
pci_detach,
any resources that pci_attach_device allocates are freed.
pci_dev_info structure
This function fills in a pci_dev_info structure that
describes an occurrence of a device.
The pci_attach_device function doesn t map any of the I/O
or memory regions into the process s address space.
The addresses returned in the pci_dev_info structure are all
physical addresses.
This structure has the following members:
uint16_t DeviceId
The device ID input/output.
For a list of supported device IDs, see.
uint16_t VendorId
The vendor ID input/output.
For a list of supported vendor IDs, see.
uint16_t SubsystemId
The subsystem ID output.
uint16_t SubsystemVendorId
The subsystem vendor ID output.
uint8_t BusNumber
The bus number input/output.
uint8_t DevFunc
The device/function number input/output.
uint8_t Revision
The device revision output.
uint32_t Class
The class code input/output.
For a list of class codes, see.
This field is an ORed combination of a class code and a subclass code e.g.
PCI_CLASS_DISPLAY PCI_SUBCLASS_DISPLAY_XGA.
uint32_t Irq
The interrupt number output.
uint64_t CpuIoTranslation
The CPU-to-PCI translation value
pci_addr cpu_addr - translation.
uint64_t CpuMemTranslation
The CPU-to-PCI memory translation
uint64_t CpuIsaTranslation
The CPU-to-ISA memory translation
uint64_t CpuBmstrTranslation
The translation from the CPU busmaster address to the PCI busmaster
address pci_addr cpu_addr translation.
uint64_t PciBaseAddress 6
The PCI base address array of six uint64_t items.
This function decodes bits 1 and 2 to see whether the register is 32 or
64 bits wide, hence the 64-bit values for the base registers.
uint64_t CpuBaseAddress 6
The CPU base address an array of six uint64_t items.
Some platforms translate addresses across PCI bridges, so that there s
one address on the PCI side of the bridge and another on the CPU side.
Under x86, the PciBaseAddress and CpuBaseAddress are
the same, but under other platforms, these will be different.
In your user application you should always use the CpuBaseAddress.
uint32_t BaseAddressSize 6
The size of the base address aperture into the board
an array of six uint32_t items.
uint64_t PciRom
The PCI ROM address.
uint64_t CpuRom
The CPU ROM address.
uint32_t RomSize
The size of the aperture into the board.
Flags
The flags parameter tells
the PCI server how resources are to be handled, which resources to scan for,
and which resources to allocate.
These bits control how resources are handled:
PCI_SHARE
Allow resources to be shared with other drivers. If this isn t set,
no other driver can attach to the device.
PCI_PERSIST
Resources persist after the device is detached.
The following bits ask the PCI server to scan for a device based on
the fields that you specified in the structure pointed to by info:
PCI_SEARCH_VEND
VendorID
PCI_SEARCH_VENDEV
DeviceId and VendorId
PCI_SEARCH_CLASS
Class
PCI_SEARCH_BUSDEV
BusNumber and DevFunc
These bits specify which members of the structure the server should
initialize:
PCI_INIT_IRQ
Irq
PCI_INIT_ROM
PciRom and CpuRom
PCI_INIT_BASE0 PCI_INIT_BASE5
The specified entries of the PciBaseAddress
and CpuBaseAddress arrays
PCI_INIT_ALL
All members except PciRom and CpuRom
The bits also include:
PCI_MASTER_ENABLE
Enable bus mastering on the device.
If you pass 0 for the flags, the default is PCI_SEARCH_VENDEV.
Testing and converting addresses
To facilitate the testing of addresses returned by the PCI server,
at least the following macros are defined in the header file:
PCI_IS_IO address
Test whether the address is an I/O address.
PCI_IS_MEM address
Test whether the address is a memory address.
PCI_IO_ADDR address
Convert the address returned by the PCI server to an I/O address.
PCI_MEM_ADDR address
Convert the address returned by the PCI server to a memory address.
PCI_ROM_ADDR address
Convert the address returned by the PCI server to a ROM address.
For example:
uint64_t port;
/ Test the address returned by the pci server /
if PCI_IS_IO addr
port PCI_IO_ADDR addr ;
Returns:
A handle to be used for other pci_ calls associated with
a handle, or NULL if an error occurs errno is set.
Errors:
EBUSY
An application has already attached to the device. If it s safe to share
the device, specify PCI_SHARE in the flags field.
EINVAL
The function couldn t attach a resource to the device.
ENODEV
This device wasn t found.
Examples:
Attach to and allocate all resources for the first occurrence of an Adaptec
2940 adapter:
int main void
int pidx;
void hdl;
int phdl;
struct pci_dev_info inf;
/ Connect to the PCI server /
phdl pci_attach 0 ;
if phdl -1
fprintf stderr, Unable to initialize PCI n ;
return EXIT_FAILURE;
/ Initialize the pci_dev_info structure /
memset inf, 0, sizeof inf ;
pidx 0;
inf.VendorId PCI_VENDOR_ID_ADAPTEC;
inf.DeviceId PCI_DEVICE_ID_ADAPTEC_2940F;
hdl pci_attach_device NULL, PCI_INIT_ALL, pidx, inf ;
if hdl NULL
fprintf stderr, Unable to locate adapter n ;
else
/ Do something to the adapter /
pci_detach_device hdl ;
/ Disconnect from the PCI server /
pci_detach phdl ;
return EXIT_SUCCESS;
Attach to the first occurrence of an Adapter 2940 adapter and allocate
resources in a second call:
void retval;
hdl pci_attach_device NULL, 0, pidx, inf ;
retval pci_attach_device hdl, PCI_INIT_ALL, pidx, inf ;
if retval NULL
fprintf stderr, Unable allocate resources n ;
Classification:
QNX Neutrino
Safety:
Cancellation point
Yes
Interrupt handler
No
Signal handler
Thread
See also:
pci_attach,
pci_detach_device,
pci_find_class,
pci_find_device,
pci_present,
pci_read_config,
pci_read_config8,
pci_read_config16,
pci_read_config32,
pci_rescan_bus,
pci_write_config.