Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Device Driver Tutorial
Previous Next

Building and Installing the Template Driver

This section shows you how to build and install the driver for a 32-bit platform. See Building a Driver and Installing a Driver for build and install instructions for SPARC architectures and for 64-bit x86 architectures.

Compile and link the driver. Use the -D_KERNEL option to indicate that this code defines a kernel module. The following example shows compiling and linking for a 32-bit architecture using the Sun Studio C compiler:

% cc -D_KERNEL -c dummy.c
% ld -r -o dummy dummy.o

Make sure you are user root when you install the driver.

Install drivers in the /tmp directory until you are finished modifying and testing the _info(), _init(), and attach() routines. Copy the driver binary to the /tmp directory. Link to the driver from the kernel driver directory. See Device Driver Testing Tips for more information.

# cp dummy /tmp

Link to the following directory for a 32-bit architecture:

# ln -s /tmp/dummy /usr/kernel/drv/dummy

Copy the configuration file to the kernel driver area of the system.

# cp dummy.conf /usr/kernel/drv
Previous Next

 
 
  Published under the terms fo the Public Documentation License Version 1.01. Design by Interspire