Device Driver Tutorial

Exit Print View

Updated: July 2014
 
 

Installing a Driver

After you write and build your driver, you must install the driver binary. To install a driver, copy the driver binary and the configuration file to the appropriate /kernel/drv directory.

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

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

# cp mydriver.conf /usr/kernel/drv

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

Copy the driver binary to the /tmp directory.

# cp mydriver /tmp

    Link to the driver from the kernel driver directory.

  • On a 64-bit SPARC architecture, link to the sparcv9 directory:

    # ln -s /tmp/mydriver /usr/kernel/drv/sparcv9/mydriver
  • On a 64-bit x86 architecture, link to the amd64 directory:

    # ln -s /tmp/mydriver /usr/kernel/drv/amd64/mydriver
  • On a 32-bit architecture, create the link as follows:

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

When the driver is well tested, copy the driver directly to the appropriate kernel driver area of the system.

  • On a 64-bit SPARC architecture, copy the driver to the sparcv9 directory:

    # cp mydriver /usr/kernel/drv/sparcv9/mydriver
  • On a 64-bit x86 architecture, copy the driver to the amd64 directory:

    # cp mydriver /usr/kernel/drv/amd64/mydriver
  • On a 32-bit architecture, copy the driver to the kernel driver area of the system:

    # cp mydriver /usr/kernel/drv/mydriver