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

C.  Making a Device Driver 64-Bit Ready

D.  Console Frame Buffer Drivers

Oracle Solaris Consoles and the Kernel Terminal Emulator

x86 Platform Console Communication

SPARC Platform Console Communication

Console Visual I/O Interfaces

I/O Control Interfaces

Polled I/O Interfaces

Video Mode Change Callback Interface

Implementing the Visual I/O Interfaces in Console Frame Buffer Drivers

VIS_DEVINIT

VIS_DEFINI

VIS_CONSDISPLAY

VIS_CONSCOPY

VIS_CONSCURSOR

VIS_PUTCMAP

VIS_GETCMAP

Implementing Polled I/O in Console Frame Buffer Drivers

Frame Buffer Specific Configuration Module

The X Window System Frame Buffer Specific DDX Module

Developing, Testing, and Debugging Console Frame Buffer Drivers

Testing the I/O Control Interfaces

Testing the Polled I/O Interfaces

Testing the Video Mode Change Callback Function

Additional Suggestions for Testing Console Frame Buffer Drivers

E.  pci.conf File

Index

Console Visual I/O Interfaces

The kernel terminal emulator interacts with the console frame buffer driver through two interfaces. During normal system activity (after a successful boot of the system), communication between the kernel terminal emulator and the console frame buffer driver is through ioctl interfaces. During standalone mode (before system boot or during debugging), communication between the kernel terminal emulator and the console frame buffer driver is through polled I/O interfaces. All activity between the kernel terminal emulator and the console frame buffer driver is initiated by the kernel terminal emulator, with the exception of a callback function used by the console frame buffer driver to notify the kernel terminal emulator of changes in the video mode.

The console visual I/O interfaces are documented in detail in the visual_io(7I) man page. For more information on the video mode change callback function, see Video Mode Change Callback Interface.

I/O Control Interfaces

During normal system activity, the kernel terminal emulator communicates with the console frame buffer driver through the ioctl interfaces listed in the following table:

ioctl Name
Corresponding Data Structure
Description
VIS_DEVINIT
vis_devinit
Initializes the session between the terminal emulator module and the frame buffer. See VIS_DEVINIT.
VIS_DEVFINI
Not Applicable
Terminates the session between the terminal emulator module and the frame buffer. See VIS_DEFINI.
VIS_CONSDISPLAY
vis_consdisplay
Displays pixels as a rectangle. See VIS_CONSDISPLAY.
VIS_CONSCOPY
vis_conscopy
Copies a rectangle of pixels (scroll). See VIS_CONSCOPY.
VIS_CONSCURSOR
vis_conscursor
Displays or hides a text cursor. See VIS_CONSCURSOR.
VIS_PUTCMAP
vis_cmap
Sends the terminal emulator module color map to the frame buffer driver. See VIS_PUTCMAP.
VIS_GETCMAP
vis_cmap
Reads the terminal emulator module color map from the frame buffer. See VIS_GETCMAP.

Polled I/O Interfaces

The polled I/O interfaces provide the same functionality as the VIS_CONSDISPLAY, VIS_CONSCOPY, and VIS_CONSCURSOR ioctl interfaces. The polled I/O interfaces are called only when the operating system is quiesced and in standalone mode. See Implementing Polled I/O in Console Frame Buffer Drivers for more information.

While in standalone mode, the kernel terminal emulator communicates with the console frame buffer driver through the polled I/O interfaces listed in the following table:

Polled I/O Function
Corresponding Data Structure
Description
(*display)()
vis_consdisplay
Displays pixels as a rectangle.
(*copy)()
vis_conscopy
Copies a rectangle of pixels (scroll).
(*cursor)()
vis_conscursor
Displays or hides a text cursor.

Video Mode Change Callback Interface

The console frame buffer driver and the kernel terminal emulator must be in agreement about the video mode at all times. Video mode includes the console screen height, width, and depth in pixels. Video mode also includes whether communication between the kernel terminal emulator and the console frame buffer is in VGA text mode or pixel mode.

In order for the console frame buffer driver to notify the kernel terminal emulator of changes in the video mode, the console frame buffer driver is initialized with the address of the (*modechg_cb)() kernel terminal emulator callback function described in the following table:

Callback Function
Corresponding Data Structures
Description
(*modechg_cb)()
vis_modechg_arg

vis_devinit

Keep the terminal emulator module synchronized with the driver video mode (screen height, width, and pixel depth).