Saturday, May 06, 2006

 The capabilities of the Solaris platform continue to expand to meet customer needs. The Solaris 10 release is designed to fully support both 32-bit and 64-bit architectures. The Solaris OS supports machines based on both 32-bit and 64-bit SPARC processors as well as 32-bit and 64-bit x86 platforms.

The primary difference between the 32-bit and 64-bit development environments is that 32-bit applications are based on the ILP32 data model, while 64-bit applications are based on the LP64 model. The primary difference between applications for SPARC and x86-based systems, from the driver developer's point of view, is big-endian versus little-endian translation.

To write a common device driver for the Solaris OS, developers need to understand and consider these differences.

Note: This document addresses topics related to x86 platforms only. In this document, references to 64-bit operating systems refer to the Solaris OS on machines with AMD Opteron processors.

The Solaris OS runs in 64-bit mode on appropriate hardware, and provides a 64-bit kernel with a 64-bit address space for applications. The 64-bit kernel extends the capabilities of the 32-bit kernel by addressing more than 4 Gbyte of physical memory, by mapping up to 16 Tbyte of virtual address space for 64-bit application programs, and by allowing 32-bit and 64-bit applications to coexist on the same system.

This document discusses the differences between 32-bit and 64-bit data models, provides guidelines for cleaning 32-bit device drivers in preparation for the 64-bit Solaris OS kernel, and addresses driver-specific issues with the 64-bit Solaris OS kernel.

Conclusion


This document describes issues that you need to be aware of when you write 32-bit and 64-bit safe drivers for the Solaris OS on x86 platforms. These issues include multiple C language data models, the use of system-derived types that have changed, and changes to some of the DDI interfaces. Also, you need to address some driver-specific issues. Finally, you need to consider performance issues such as the use of DMA.

This article lists and describes these issues, and it provides solutions and recommendations for these issues. This guide should help you write clean code for 32-bit and 64-bit device drivers for the Solaris OS on x86 platforms.

For further information on device drivers in the Solaris OS, see Writing Device Drivers. To see examples of some basic device drivers, see Device Driver Tutorial (PN 817-5789, Sun Microsystems). If you are new to development in the Solaris OS or are unfamiliar with the range of information on the Solaris OS, see the Introduction to the Solaris Development Environment.

 References


Writing Device Drivers, Appendix C: "Making a Device Driver 64-Bit Ready," PN 816-4854, Sun Microsystems, 2004

Solaris 64-Bit Developer's Guide, PN 816-5138, Sun Microsystems, 2004

STREAMS Programming Guide, PN 816-4855, Sun Microsystems, 2004

Software Optimization Guide for AMD Athlon 64 and AMD Opteron Processors (pdf), PN 25112, Advanced Micro Devices, 2004