LINUX HOME
Logo Image

Serial
Ports

Cards with serial ports should be installed as /dev/ttyS* devices, as described in Configuring Serial Ports for Linux.

Linux
Samples

Using The
Samples


Linux

The [cd]/linux directory contains many directories. Most customers can use our cards simply by converting the DOS register level samples, or finding the samples already converted to linux.

Linux 2.4

The "/linux/2.4/Register IO Driver" directory contains an ISA (and PC/104) compatible driver eliminating the need to be logged in as root. This driver is optional, but can add flexibility to your system. This driver was written by a third party and is open source. Please refer to the directory contents (readme etc) for more information. Many customers may prefer to use the "PCI Register IO Driver", described below, even with ISA and PC/104 devices.

Linux 2.6

The "/linux/iogen 2.6 kernel only" directory contains an ISA (and PC/104) compatible driver eliminating the need to be logged in as root. This driver will support any number of cards. This driver also adds IRQ support. In addition there are several card specific samples provided with the driver. Most of these samples are ports of the DOS samples for these cards. Full source is provided.

The "/linux/acces_pci 2.6 kernel only" directory contains a PCI compatible driver eliminating the need to be logged in as root. The driver supports interrupts on an arbitrary number of cards, and includes many card specific samples. Full source is provided.

Converting DOS Samples for Linux

Our DOS C samples are not hard to convert for Linux. The samples for many our cards are already converted; these can also be used as conversion samples. For the remaining cards, the following conversion guidelines are provided.

To gain I/O port access without inserting a kernel module, use the function ioperm(). This function also requires the program to be run in the super user or root mode and must be compiled with the -O option for example:

g++ -O sample0.c

The functions outportb() and inportb() have to be changed to outb() and inb() and the arguments reversed:

outportb(baseaddress, data)
becomes
outb(data, baseaddress)

Remove the <dos.h> and <conio.h> include statements. They provide DOS-specific screen formatting functions, such as windows(), textcolor(), and textbackground(). These funtions can simply be omitted when using the Linux terminal.

The function cprintf() needs to be changed to printf().
Cprintf() is provided in conio.h, and differs from printf() only in that it works with the above formatting functions.

The function clrscr() needs be changed to system("clear").

The function gotoxy(X Y) needs to be changed to system("tput cup X Y").

Since dos.h is not in linux, kbhit() and getch() are not supported, we've included a library called kbinp.h with functions that mimic them.

getch() can be used as before, but kbhit() must be transformed as such:

  while(!kbhit());

may be changed to:

  while(kbhit()==0);


Detecting PCI Cards Under Linux

Our pcifind.plx PERL script provides a friendly listing of all our PCI cards in your system, including their base addresses and IRQs. To run it, open a terminal window and change to its directory, then type "perl pcifind.plx".

If, for some reason, you can't run pcifind.plx, type "/sbin/lspci -vv -d 494f:*" at the command line; this will produce a more detailed but less readable listing of all the resources of our PCI cards. You will also need to consult the card's manual for its device ID. (Because lspci doesn't know about our cards specifically, it simply prints device IDs.)


Using USB Boards Under Linux

The USB directory contains the files required to use ACCES USB boards under Linux.