LINUX HOME | ||
![]() |
||
LinuxThe [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.4The "/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.6The "/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 LinuxOur 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: 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().
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);
|