JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Writing Device Drivers     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

Part I Designing Device Drivers for the Oracle Solaris Platform

1.  Overview of Oracle Solaris Device Drivers

2.  Oracle Solaris Kernel and Device Tree

3.  Multithreading

4.  Properties

5.  Managing Events and Queueing Tasks

6.  Driver Autoconfiguration

7.  Device Access: Programmed I/O

8.  Interrupt Handlers

9.  Direct Memory Access (DMA)

10.  Mapping Device and Kernel Memory

11.  Device Context Management

12.  Power Management

13.  Hardening Oracle Solaris Drivers

14.  Layered Driver Interface (LDI)

Part II Designing Specific Kinds of Device Drivers

15.  Drivers for Character Devices

16.  Drivers for Block Devices

17.  SCSI Target Drivers

18.  SCSI Host Bus Adapter Drivers

19.  Drivers for Network Devices

20.  USB Drivers

21.  SR-IOV Drivers

Part III Building a Device Driver

22.  Compiling, Loading, Packaging, and Testing Drivers

23.  Debugging, Testing, and Tuning Device Drivers

24.  Recommended Coding Practices

Part IV Appendixes

A.  Hardware Overview

B.  Summary of Oracle Solaris DDI/DKI Services

Module Functions

Device Information Tree Node (dev_info_t) Functions

Device (dev_t) Functions

Property Functions

Device Software State Functions

Memory Allocation and Deallocation Functions

Kernel Thread Control and Synchronization Functions

Task Queue Management Functions

Interrupt Functions

Programmed I/O Functions

Direct Memory Access (DMA) Functions

User Space Access Functions

User Process Event Functions

User Process Information Functions

User Application Kernel and Device Access Functions

Time-Related Functions

Power Management Functions

Fault Management Functions

Kernel Statistics Functions

Kernel Logging and Printing Functions

Buffered I/O Functions

Virtual Memory Functions

Device ID Functions

SCSI Functions

Resource Map Management Functions

System Global State

Utility Functions

C.  Making a Device Driver 64-Bit Ready

D.  Console Frame Buffer Drivers

E.  pci.conf File

Index

Utility Functions

The following list provides a subset of the utility functions that are available.

nulldev()

Zero return function

nodev()

Error return function

nochpoll()

Error return function for non-pollable devices

ASSERT()

Expression verification

bcopy()

Copy data between address locations in the kernel

bzero()

Clear memory for a given number of bytes

bcmp()

Compare two byte arrays

ddi_ffs()

Find the first bit set in a long integer

ddi_fls()

Find the last bit set in a long integer

swab()

Swap bytes in 16-bit halfwords

strcat()

Append two strings

strncat()

Append two strings, with length limit

strlcat()

Append two strings, with length and buffer limit

strcmp()

Compare two null-terminated strings

strncmp()

Compare two null-terminated strings, with length limit

strlen()

Determine the number of non-null bytes in a string

strnlen()

Determine the number of non-null bytes in a string, with length limit

strcpy()

Copy a string from one location to another

strncpy()

Copy a string from one location to another, with length limit

strlcpy()

Copy a string from one location to another with length limit and buffer limit

strcasecmp()

Case insensitive version of strcmp()

strncasecmp()

Case insensitive version of strncmp()

strchr()

Find a character in a string

strstr()

Locate the first occurrence of one string in another string

strcasestr()

Case insensitive version of strstr()

strfree()

Frees memory associated with a string

sprintf(), vsprintf()

Format characters in memory

snprintf()

Format characters in memory with buffer size specified

numtos()

Convert an integer to a decimal string

stoi()

Convert a decimal string to an integer

max()

Return the larger of two integers

min()

Return the lesser of two integers

va_arg()

Finds the next value in a variable argument list

va_copy()

Copies the state of a variable argument list

va_end()

Deletes pointer to a variable argument list

va_start()

Finds the pointer to the start of a variable argument list

See the man pages section 9: DDI and DKI Kernel Functions for detailed information about the utility functions.