Download Linux Device Driver User Manual

Transcript
SIO4, Linux Device Driver, User Manual
2.7. The Driver
The paragraphs that follow give instructions on building, starting and verifying startup of the driver. These files are
installed into the /usr/src/linux/drivers/sio4/driver/ directory.
File
*.c
*.h
makefile
makefile.dep
sio4.h
sio4.o
sio4_legacy.h
sio4_start
Description
These sources implement the driver interface and its functionality. Some functionality has
been modularized based on individual source file base names.
These are driver header files. Others are listed below.
This is the driver make file.
This is a make dependency file. This is updated automatically.
This is the driver interface header file. It should be included by SIO4 applications.
This is a pre-built version of the executable driver module.
This is an additional driver interface header file. This includes some outdated and
superceded definitions. This should be included by applications on an as-needed basis.
This is a shell script to install the driver module and device nodes.
2.7.1. Build
Follow the below steps to build the driver.
1.
Change to the directory where the driver and its sources were installed. This should be
/usr/src/linux/drivers/sio4/driver.
2.
Remove all existing build targets by issuing the below command.
make clean
3.
Build the driver by issuing the below command.
make all
NOTE: Building the SIO4 driver requires installation of the kernel header sources. If they are not
present the build will fail.
NOTE: Due to the differences between the many Linux distributions some build errors may
occur. These errors may include system header location differences and should be easily
correctable. Other errors may also appear as some distributors port newer kernel changes into
older kernel distributions.
NOTE: Debug messages already present in the driver sources are enabled only when the macro
SIO4_DEBUG is enabled. This macro is undefined by default and can be found in sio4.h.
2.7.2. Startup
NOTE: The driver may have to be rebuilt before being used due to kernel version differences
between the GSC build host and the customer target host.
The startup script used in this procedure is designed to insure that the driver module in the install directory is the
module that is loaded. This is accomplished by making sure that an already loaded module is first unloaded before
attempting to load the module from the disk drive. In addition, the script also deletes and recreates the device nodes.
This is done to insure that the device nodes in use have the same major number as assigned dynamically to the driver
by the kernel, and so that the number of device nodes correspond to the number of boards identified by the driver.
14
General Standards Corporation, Phone: (256) 880-8787