Linux Device Driver for P-PCI(-LV)

Last Modified: Aug 6, 2002

How to get the distribution kit

You can get the distribution kit in URL:http://www-online.kek.jp/~yasu/BELLE/Linux-driver.tar.gz.
1. Execute tar command to get the files.
% tar xvfz Linux-driver.tar.gz

The directory linux is created and then the files are created.
% ls linux
Makefile       ppci.h         read_fadc.c    write.c
howto.txt      read.c         read_ppci.c    write_fadc.c
ppci.c         read1.c        test_ppci.c    write_ppci.c

ppci.c and ppci.h are files for the device driver.

How to install the device driver

1. Make a device driver and test programs.

% make clean
% make

2. Make the device files.
   This makes devices files in /dev directory.
   The names are ppci0, ppci1, ppci2, ppci3 and ppci4.
% su
# make devices


3. Load the device driver in Linux kernel.

# /sbin/insmod ppci.o

4. Make sure if it is successfully loaded.
   If you can find, a message "PPCI has been installed.",
   it's OK.

% /bin/dmesg

How to use the device driver

You can find the examples in the directory linux. Please read them. For an example, read and write programs are used as follows;
On one PC,
% ./read
usage : read minor_number loop count
% ./read 0 1 1000
This means the read program reads 1000 longword data from channel 0 at once.

On the other PC,
% ./write
usage : write minor_number loop count
% ./write 0 1 1000
This means the write program writes 1000 longword data into channel 0 at once.