Uspci

From V5wiki

Jump to: navigation, search

Contents

Introduction

Installation

Building

To build and install USPCI suite:

  1. Unpack the distribution.
  2. Cd into its directory.
  3. Type make. This builds both the kernel module uspci.ko (in kernel_module/) and uspci_test utility (in utils/).
  4. Place the uspci.ko to an appropriate location where it can be found by depmod and insmod/modprobe, usually
    /lib/modules/$(shell uname -r)/extra/
  5. Place the uspci_test utility to whichever location is convenient, e.g. /usr/local/bin/.

Bringing up

To bring the USPCI kernel module up at boot, place the following commands, e.g. into /etc/rc.d/rc.local:

# Load UserSpace-PCI module
rm -f /dev/uspci
if modprobe -v uspci
then
        major=$(awk '$2=="uspci" {print $1}' /proc/devices)
        mknod /dev/uspci c $major 0
fi

Programming

Basic concepts

Opening a PCI device

Performing I/O

IRQ handling

uspci_test utility

The uspci_test utility allows to interact with PCI devices from command line. Its features include performing I/O, IRQ handling and waiting. The uspci_test is located in the utils/ subdir.

Personal tools