
                      CIO-DIO-48H Version 1.1
                      ----------------------

 Linux loadable module for the Computer Boards CIO-DIO-48H 
 ------------------------------------------------------------------------

NOTE:  kernel 2.0 driver is called:  dio48h_2_0.c
       kernel 2.2 driver is called:  dio48h_2_2.c

Introduction:
-------------

This driver was written by Warren J. Jasper at North Carolina State
University.  It is a driver for the ComputerBoards CIO-DIO-48H
adapter.  

Please send comments and bug fixes to wjasper@tx.ncsu.edu.  The source for the
driver is located at ftp://lx10.tx.ncsu.edu/pub/Linux/drivers.


Distribution contents:
----------------------

README       - this file
Makefile     - Makefile to compile and install the driver
dio48h.c     - CIO-DIO 48H Driver source.
dio48h_2_0.c - PCI-DIO-48 Driver source 2.0 Kernel
dio48h_2_2.c - PCI-DIO-48 Driver source 2.0 Kernel
dio48h.h     - Driver definitions and contants.
dio.h	     - User and driver definitions and constants.
diotest.c    - Test program.

Building and installing the driver:
-----------------------------------

1. Untar the tar file:

   tar zxvf CIO-DIO48H.1.1.tgz

2. This should create the following files:
    Makefile
    Makefile.orig
    ModList
    README
    dio.h
    dio48h.c
    dio48_2_0.c
    dio48_2_2.c
    dio48h.h
    diotest.c

3. If the major device number 35 is in use, then edit the following line
   in the Makefile. 

	MAJOR_DEV=35


4. Sometimes the dependency list is not correct, depending on which version
   Linux you are running, and which distribution.  Type:

   make depend

5. To compile, type:

   make

6. To make the appropriate devices:
 
   make devices

7. To install the driver type:

    make install

    check that the destination directory is correct.


Having the driver install at boot:
----------------------------------

To install the driver so that it comes up every time on boot-up, you
will need to include the following lines in one of your boot rc files.
The one we used is called /etc/rc.d/rc.local. Your setup may vary.

echo -n "Local customization:"

if [ -x /sbin/insmod  -a -r /lib/modules/`uname -r`/misc/dio48H.o ]; then
        echo -n " DIO48H"
        /sbin/insmod -f /lib/modules/`uname -r`/misc/dio48H.o
fi

How the driver works:
---------------------

The driver is fairly straight forward, but since the current version of
Linux is not 1003.4 compliant (it is not a real-time operating system),
certain design decisions were made in writing this driver. 

There is only one major number for the device.  In the header file
dio48h.h, the following values need to be set for your particular
machine:

#define DAC_BASE           0x350 /* Default base address */
#define DEFAULT_MAJOR_DEV  35    /* Default Major Device Number */

Make sure that these numbers are not being used on your system.  The
Base address must also be set with DIP switches on the board. 

****************************************************************************

The following ioctl() functions have been implemented:

1. ioctl(fd, DIO_SET_MODE, MODE,IO);
   Sets the INTEL 8255 Programmable Peripheal Iterface to one of three modes:
       MODE_IO            - normal input/output mode
       MODE_STROBE_IO     - Strobed Input/Output (port A or B)
       MODE_BIDIRECTIONAL - Bi-Directional Bus (port A only )
    See the documentation of the chip for more information

2. ioctl(fd, DIO_SET_DIRECTION, PORT_INPUT);
   Set the direction of the port to either input or output.  Port C can be split
   into two levels (4 bits each), while ports A and B are either all input or
   all output.

