ProDOS 8: How To Find Disk, Controller, and Block Information

This article describes how to find disk information, by making calls to significant memory locations.
Is the Card a Disk Controller?
----------------------
Check memory locations $Cs01, $Cs03, $Cs05 (s = slot number) for $20, $00, and $03, respectively. If these values are found, then the card in the slot is a disk controller.

Apple Disk II Disk Controller and Disk Capacity?
----------------------------------
Check memory location $CsFF. If the value is $00 or $FF, assume that an Apple Disk II disk controller card is installed ($00 is 16-sector, $FF is 13-sector).

SmartPort Device and Number of Blocks?
-----------------------------
If the device is not an Apple Disk II disk controller card, check memory location $Cs07. If the value does not equal $00, the device is not a SmartPort device, and the total number of blocks for the drive are stored at memory locations $CsFC and $CsFD in low-byte/high-byte order.

If the total number of blocks is 0, contact the card manufacturer for details on how to determine the number of blocks.

Note: We do not know of any disk controller that does not store the total number of blocks at memory locations $CsFC and $CsFD.

If the value at memory location $Cs07 is $00, the drive is a SmartPort device. To find the number of blocks on the drive, you must make SmartPort status call $03 (get DIB). This call is documented in the "Apple IIGS Firmware Reference Manual" on pages 114 through 125 with the most specific information starting on page 121.
Published Date: Feb 18, 2012