Linux support for the USB2 family of products
1. Introduction
We realize the increasing popularity of the Linux operating system and have created software support for -
- USB2ISA family of products , and USB2PCMCIA products
under Linux operating system .
The software support contains of core install binaries and the developer's support files . We are providing a basic API (application programming interface) set for developers allowing building of applications which can access i/o ports and physical memory areas .
An additional api set is available in our SDKBUS kit allowing - - read/write on memory and i/o spaces
- dealing with IRQ and DMA channels
- managing the hardware - issuing hardware reset , adjusting read/write cycle ...
for ISA / PCMCIA cards mounted on our USB2 family of products .
The majority of the software running under Linux is open source , and many of it's user's are actual developers and professional programmers . We have geared our Linux product release specifically for developers and programmers , who can take the source code of a specific ISA, or PCMCIA card , and make it working with USB2 products .
2. Where is the source code?
We have developed an independent USB2 host and device support. Originally developed under Windows operating systems we have ported it to work under Linux operating system.
We do not share our source code with developers or users - it is our company proprietary and confidential code. We are providing instead an easy to use interface to our products, together with samples.
Most of the present day Linux kernels contain USB2 EHCI host support.
If needed, you can add an USB2 host controller - as a PCI card to a desktop computer, or a PCMCIA card to a notebook computer, and use this controller specifically for the USB2ISA family of products and USB2PCMCIA product.
3. Core binaries use
The linux release files are packed in a single .zip file.
The file name includes our release number - for ex. linux-2-140-x.run. Every time any of the files are updated, the release number is increased to reflect the change.
You can copy the .run file to a disk, and run it to install the files to a folder on your linux system.
There is a folder containing files for 64bit releases of the Linux operating system.
Our core binaries contain : - application - 'arsenum3' / gui enumerator
- application - 'arsenum4' / text enumerator
The binaries have been built and tested for x86 type processors - including the 64bit families of - Intel , AMD , VIA , Transmeta ... and compatible processors . The majority of the today's computer systems include one of the above processors .
We did build and provide releases for other types of processors as well - ARM processors .
3.1. ARS Technologies enumerator
You can load the gui based enumerator on command line as -
./arsenum3
or
sudo ./arsenum3
If needed, please change the mode of 'arsenum' to allow execution -
chmod u+x arsenum3
You can load the text based enumerator on command line as -
./arsenum4
or
sudo ./arsenum4
The program scans and reports the computer system's i/o and memory spaces .
When an USB2ISA / USB2PCMCIA product is connected / disconnected there are text messages . When inserted , the enumerator reports the type of the card - USB2ISA or USB2PCMCIA , the usb port where it was connected . A scanning of the hardware resources is performed and the found i/o ports , and physical memory areas are reported .
The scanning of the hardware resources is not ideal , and some hidden ports / memory areas may not be recognized or reported .
There may be a need to add manually resources which were not detected. To add resources, select the resource type : i/o ports, memory area, irq channel, or dma channel, and type the addresses or the channel number.3.2. Debug mode of the enumerator
To load the enumerator in debug mode type on command line -
./arsenum3 d
or
sudo ./arsenum3 d
The enumerator will display one after another messages on the steps it takes.
In case of problems, please check / take a note of the last displayed message before the problem occurred, and notify us.
4. Developer's support
4.1 Basic API set
Here is the commands list :
standard commands used by application for direct access to i/o ports -
BYTE in8(WORD port) - returns 1byte of data read from the i/o address in 'port'
WORD in16(WORD port) - returns 2bytes of data read from the i/o address in 'port'
void out8(WORD port, BYTE data) - writes 1byte of data to i/o address in 'port'
void out16(WORD port, WORD data) - writes 2bytes of data to i/o address in 'port'
standard commands used by application for direct access to physical memory -
BYTE rd8(DWORD phaddr) - returns 1byte of data read from the physical memory address in 'phaddr'
WORD rd16(DWORD phaddr) - returns 2bytes of data read from the physical memory address in 'phaddr'
void wr8(DWORD phaddr, BYTE data) - writes 1byte of data to physical memory address in 'phaddr'
void wr16(DWORD phaddr, WORD data) - writes 2bytes of data to physical memory address in 'phaddr'
- where
BYTE = unsigned char
WORD = unsigned short
DWORD = unsigned long
i/o port read/write - port range 0-ffff (64 kB space)
physical memory read/write - address range 0-fffff (1mB space)
!!! Note1 : In order to read/write meaningful values , the ARSTech enumerator should be running , the USB2ISA / USB2PCMCIA card needs to be connected and recognized by the enumerator , and the mounted ISA / PCMCIA card need to actually have the i/o port or the physical memory area being accessed .
!!! Note2: The calling convention of the api set is different that the Linux - outb/outw , writeb/writew commands. The first parameter in our api set is the address of the port or physical memory , compared to Linux where the address is the second parameter. Please replace as for ex. -
#define outb(a, b) out8(b, a)
!!! Note3 : An additional API set is available in our SDKBUS kit allowing the additional possibilities of -
- building of kernel drivers which use the kernel level api set
- dealing with IRQ and DMA channels and events based on them
- managing the hardware - issuing hardware reset , adjusting read/write cycle ...
for ISA / PCI / PCMCIA cards mounted on our USB2 family of products , or SSI2 family of products .
4.2 Samples for using our API set
There is a sample 'isa-rw' , showing reading of sector 1 - partition table of a hard disk , connected to an ISA I/O card mounted on USB2ISA - the type that has one floppy , one ide controllers , 2 serial and one parallel ports . The disk need to be connected and powered on .
In addition the ARSTech enumerator should be running , the USB2ISA / USB2PCMCIA card needs to be connected and recognized by the enumerator , and the mounted ISA / PCMCIA card need to actually have the i/o port or the physical memory area being accessed .
To build the samples you can run the script file -
./mk.bat
The api set in 'isarw' is obtained from the dynamic library file - libarsusb4.so . You will need to place this file in the same folder where your binary is, or in some of the system folders - '/lib' , '/usr/lib' , '/usr/local/lib' .
5. Running DOS programs with USB2ISA / USB2PCMCIA
You can run DOS applications and drivers under Linux using DOS emulators.
There is a variety of choices with one well maintained and supported one - DosBox, which provides support not only on Linux , but on Windows , Mac OS X , and number of other environments.
You can run the enumerator , connect USB2ISA / USB2PCMCIA , run dosbox , run the DOS application and test .