Main Page | Index

Axis Software User Manual


Notes on Linux Devices

Linux defines three common types of devices:

Internally Linux identifies devices by using two numbers called the major device number and the minor device number. The major device number identifies the device driver to handle the request and the device driver is free to use the minor number as it wants to. As an example the serial driver has a major number of 4 and minor numbers from 64 onwards identifies which serial port.

The Axis device driver uses a major number of 231 and various minor numbers to identify specific hardware elements.

Minor Number Hardware
0
First SRAM Partition
1
Second SRAM Partition
2
Third SRAM Partition
16
Inputs
32
DIP switches
48
Outputs
96
SPI channel 0 (door monitoring PIC)
97
SPI channel 1
98
SPI channel 2
99
SPI channel 3
128
Cryptographic hardware
144
Smart Card interface

To open the Axis device and to request the functionality associated with a specific hardware element the application needs to open a character special file whose major number matches the Axis device major number and whose minor number matches the desired hardware. It is conventional for these special character device files to live in the /dev directory.

For convenience the examples in the documentation assume existence of a set of special files in the:

/dev/axis_0 directory

To create one of these special files needs the mknod command.
The command:

mknod -m666 /dev/axis_0/inputs c 231 16

creates a suitable special file called inputs in /dev/axis_0 (which must exist) and associates it with the Axis device driver and the Axis inputs subsystem.

For more details on mknod on most Linux systems use the command:

man mknod

Once this has been done the inputs can be read like a normal (if rather short) file.


© HEBER LTD. 2005. This document and the information contained therein is the intellectual property of Heber Ltd. and must not be disclosed to a third party without consent. Copies may be made only if they are in full and unmodified. The information contained in this documentation is believed to be accurate and reliable. However, Heber Ltd. assumes no responsibility for its use, and reserves the right to revise the documentation without notice.
Document No: 80-17794, Issue 4r1    Release Date: 01.12.05     Email: support@heber.co.uk    www.heber.co.uk