Tuesday June 14, 2005 ATA on Solaris x86, at 10k feet
I'm part of a team of software engineers responsible for the ATA and SATA disk and optical drivers on x86. We are responsible for maintaining the current ata driver suite, which is mostly in sustaining mode, and for creating a new architecture of SATA drivers so that Solaris can utilize many more controllers and features that SATA offers.
You might be wondering about SPARC. Unfortunately, poor design choices were made nearly a decade ago that forked the ata drivers from the x86 source. This is a product of the times when Sun operated in independent planet divisions. Because of this, if you browse the source you'll see many similar parts. A separate platform team still maintains the SPARC driver.
Many have expressed interest over the years to see these drivers merged back. It's somewhat unlikely at this point since both drivers are mostly in sustaining mode, and given that the new SATA architecture will eventually obsolete the present ATA drivers.
The existing x86 ATA driver does have support for many popular and common SATA controllers. If the controller has the capability to operate in legacy mode (ie emulate parallel ATA), it will likely work. Controllers that work are the ones commonly found on the major chipsets, such as ICH5, ICH6 and Nforce4, as well as Sil3112, Sil3114, Sil3512. Check out the latest hardware compatibility list for any others reported to work. Also feel free to update the list with any controllers you have found to work which are not already listed.
To expand our support for SATA controllers which do not work in legacy mode, and to utilize new SATA features such as NCQ and hotplugging,our team is creating a completely new SATA driver model that centralizes most of the generic support for SATA into a loadable module, and then uses the existing SCSI target disk driver 'sd' as the target driver. This allows the HBA driver to be relatively lean, so that its focus is on operations needed to directly program and operate the controller. The new SATA architecture will initially be delivered for x86 drivers, but it is written generically and can be built on SPARC.
If you want to browse the source, have a look at the following modules and their corresponding source files. I've given a brief description of what each does.
gda usr/src/uts/common/io/dktp/dcdev/ghd.c
Insignificant; it should have just been part of dadk. dadk uses _depends_on[] to load this module.
objmgr usr/src/uts/common/io/dktp/drvobj/objmgr.c
A facility to load other module objects and set up function pointers. This file is going away soon.
snlb usr/src/uts/common/io/dktp/disk/snlb.c
Sun Lebeling, vtoc, fdisk.
strategy usr/src/uts/common/io/dktp/drvobj/strategy.c
Queuing. Way over-architected. Read at your own risk.
pci-ide /usr/src/uts/common/io/pci-ide/pci-ide.c
Splits a single physical controller into two ata devinfo nodes,one for each channel. See the prtconf output listed below.
ata usr/src/uts/common/io/dktp/controller/ata
The ata controller driver doing the bulk of the interesting work many source files in directory.
dadk usr/src/uts/common/io/dktp/dcdev/dadk.c
interfaces between cmdk and ata. Similar to scsi.
scsi usr/src/uts/common/io/scsi/impl
Provides interfaces between sd and ata. Similar to dadk.
cmdk usr/src/common/io/dktp/disk/cmdk.c
Target driver for ata disks, very slim. This module uses _depends_on[] to load objmgr, snlb, dadk and strategy
sd usr/src/common/io/scsi/targets/sd.c
SCSI target driver used for ATAPI devices
-bash-3.00$ prtconf -D | egrep "sd|cmdk|ide"
pci-ide, instance #0 (driver name: pci-ide)
ide (driver name: ata)
ide (driver name: ata)
pci-ide, instance #1 (driver name: pci-ide)
ide, instance #2 (driver name: ata)
cmdk, instance #0 (driver name: cmdk)
ide (driver name: ata)
The above prtconf listing shows two ATA controllers on the system, which appear as the 'pci-ide' nodes above. Each controller has two channels, both of which are represented by the 'ide' node, which are driven by the driver 'ata'. One of the channels has a disk, with 'cmdk' bound to it.
Feel free to drop me a note if you have any questions or suggestions.