              Apple /// CF/IDE driver ver 1.0

Features:
Native Apple /// SOS driver written in 6502 code.
Up to 8 user definable partitions - up to 32mb each.
Can manage up to 2 devices - master & slave.
   Master (device 0) can be either Compactflash memory installed in the built-in socket on the interface card or a IDE HDD attached to the 40pin IDE connector and configured as master.
   Slave (device 1) can be either Compactflash (you will need an adapter that can be connected to a 40pin IDE connector and slave configurable) or an IDE HDD configured as slave.
Although any size of device can be attached and successfully used, the maximum usable capacity is limited to 16,711,680 blocks.

                 CF-IDE Status Requests
The following list gives the status code and the contents of the status list for each status request supported.

Status Code: $00 (Device Status)
Status List: Physical Drive Number ($01 bytes)

Does device readiness check and returns a single byte for the drive number, Master=0 or Slave=1.  This is the same value as set in the driver configuration byte $0.
If device is not ready this request terminates with a SOS error - DRIVE NOT CONNECTED.  Drive number is returned regardless of device status.

Status Code: $01 (Device Identification)
Status List: $0200 Data Buffer

Copies the device identification data block into the status list data buffer.  This buffer must be 512 bytes long. Refer to the ATA interface specifications for the format and content of the device identification data.

Status Code: $02 (Device Error Status)
Status List: Error Data Buffer  ($05 bytes)

Returns 5 bytes of error data from the most recent command.  The format of the error data is as follows:
   Byte 0:      Device Error Code
      Bit 7 = BBK bad block has been detected
      Bit 6 = UNC uncorrectable error was encountered
      Bit 5 = 0 (undefined)
      Bit 4 = IDNF requested block ID is in error or cannot be found
      Bit 3 = 0 (undefined)
      Bit 2 = ABRT command was aborted or an invalid command
      Bit 1 = 0 (undefined)
      Bit 0 = AMNF general error
   Byte 1,2,3:  Sector Number (LB,MB,HB) that error occurred.
   Byte 4:      Number of blocks left to complete command

Status Code: $03 (Partition Table Data)
Status List: Partition Data Buffer ($0100 bytes)

Copies 256 bytes of partition table data to status list buffer.  The format of the partition table is as follows:
   Byte $ 0:  Checksum of partition table bytes $01 through $FF (1 byte)
   Byte $10:  Device serial number (20 ASCII characters)
   Byte $24:  Device firmware revision number (8 ASCII characters)
   Byte $2C:  Device model information (40 ASCII characters)
   Byte $64:  Original partition initialization date (8 ASCII characters)
   Byte $6C:  Date partition was last modified (8 ASCII characters)
   Byte $A3:  Partition #1 Start Block (3 bytes)
   Byte $A6:  Partition #1 Length (3 bytes)
   Byte $A8:  Partition #2 Start Block (3 bytes)
   Byte $AB:  Partition #2 Length (3 bytes)
   Byte $B3:  Partition #3 Start Block (3 bytes)
   Byte $B6:  Partition #3 Length (3 bytes)
   Byte $B8:  Partition #4 Start Block (3 bytes)
   Byte $BB:  Partition #4 Length (3 bytes)
   Byte $C3:  Partition #5 Start Block (3 bytes)
   Byte $C6:  Partition #5 Length (3 bytes)
   Byte $C8:  Partition #6 Start Block (3 bytes)
   Byte $CB:  Partition #6 Length (3 bytes)
   Byte $D3:  Partition #7 Start Block (3 bytes)
   Byte $D6:  Partition #7 Length (3 bytes)
   Byte $D8:  Partition #8 Start Block (3 bytes)
   Byte $DB:  Partition #8 Length (3 bytes)

Status Code: $FE (Preferred Bitmap Location)
Status List: Bitmap Initial Block ($02 bytes)

Always returns $FFFF - don't care.

                      CF-IDE Control Requests
The following list gives the control code and the contents of the control list for each control request supported.

Control Code: $00 (Reset Device)
Control List: None

Execute a software reset call to all attached AT devices.

Control Code: $01 (Device I/O Function)
Control List: None

Perform device direct I/O function with user supplied call block.  The format of I/O buffer call block is as follows:

    Byte $00:      ATA Command Code
    Byte $01:      Sector Number HB
    Byte $02:      Sector Number MB
    Byte $03:      Sector Number LB
    Byte $04:      Number of sectors ($00=256 sectors)
    Byte $05,$06   Bytes returned to buffer (HB,LB)
    Byte $07...    Data Buffer ($00 to $0100 length call specific)

Supported ATA command codes:
  $03 = Extended Error Info - Returns an extended error code for the compactflash memory card.  Data buffer length = 1 byte.
  $20 = Sector Read - Reads from 1 to 256 sectors (blocks) as requested beginning with the sector number specified.  Data buffer length = 256 bytes to 65536 bytes long depending on requested number of sectors.
  $30 = Sector Write - Writes from 1 to 256 sectors (blocks) as requested beginning with the sector number specified.  Data buffer length = 256 bytes to 65536 bytes long depending on requested number of sectors.
  $40 = Read verify - Verifies the number of sectors requested beginning with the sector number specified.  Data buffer length = None.
  $50 = Sector Format - Formats the specified sector numbers beginning with sector number specified with value of $FF.  Data buffer length = None.
  $90 = Internal Diagnostic Test - Performs the device internal diagnostic test.  The diagnostic code is returned in Data Buffer.   Data buffer length = 1 byte.
  $EC = Device Identity - Transfers 512 bytes of device identification data.  Format per ATA specs applicable for the device.  Data buffer length = 512 bytes.

Control Code: $FE (Media Format)
Control List: None

Invalidates partition table status flag internal to the driver so subsequent read/writes will update its partition parameters with the current partition values on the device.  Physically does not perform any format operations.

                 Apple /// CF/IDE Utilities Program

Utility program to setup, test, and manage your CompactFlash or IDE drives attached to the CFFA interface card.

Features:
1. Can manage up to 2 devices - master & slave for each IFC installed.
2. Test the interface connectivity with the CF or IDE drives attached.
3. Displays identification summary of devices connected - model & serial #, firmware version, CF command features & logic block capability, & total block capacity of device.
4. Verify the media of each device.
5. Low Level format of devices with CFA features capability and initialize partition table.
6. Setup drive partitions, maximum of 8 each device - up to 32meg (65535 blocks).
7. Perform SOS system level formatting of each partition volume.

                            MAIN MENU
SELECT DRIVE
Scans the SOS driver table and lists the drive name of the 1st SOS unit# for each device found operational.
Up to 4 interface cards are supported or a maximum of 8 devices (2 on each IFC).
For example, if there is only 1 interface card installed with both master (device #0) and slave (device #1) attached then 2 drives are listed.
All functions of this utility are applicable to the attached devices and not to the individual SOS drives that may be partitioned on each device (a maximum combination of 8 drives is possible).

TEST IFC
Commands each device to perform its internal diagnostics.  The diagnostic result displayed will represent the result from both devices attached.
All non-pass diagnostic results for the slave device are preceded with "Slave Failed - " followed by the appropriate diagnostic error reported.
Currently the CFFA card does not support the device #1 passed diagnostic signal.
If a slave device is present and both devices pass the diagnostics the diagnostic message displayed will always be "Slave Failed - No Errors Detected"
To receive the correct results you will need to connect pin 34 at the IDE header and pin 46 at the compactflash socket.

Following the internal diagnostic message a summary of the device identification is displayed.  If 2 devices are connected the master device is displayed 1st followed by the slave device.
The information that is displayed is as follows:
DEVICE NO:  Either 0 (master) or 1 (slave)
MODEL NO:  40 character model # information on the device
SERIAL NO: 20 character serial # of the device
FIRMWARE:  8 character firmware revision number
LBA SUPPORT: Logical Block Access supported by this device - Yes or No.  This driver and utility only supports devices with LBA support.
CFA FEATURE:  Compactflash feature set support by the device - Yes or No.  If a device supports the CFA feature then low level formatting of the device media will be permitted.
CAPACITY:  The maximum number of usable blocks on the device.  If device capacity exceeds 9,728,000 blocks then >9728K is displayed.

VERIFY DRIVE
A read verify of all usable blocks on the device is performed.  A progress bar displays the percentage of completion. Any bad blocks reported are displayed in the active window above the progress bar.
The verification can be halted/resumed at any point through the progress of the verification process.

FORMAT DRIVE
If the device supports the CFA Feature Set then a complete low level media format of all usable block on the device is performed beginning with block $0.
The low level format can be halted/resumed at any point through the progress of the format process.
Following the low level format or if the device does not support the CFA Feature Set (typical of most IDE HDD) the partition table is initialized (block $0) with the current date and device information.

PARTITION DRIVE
Partitions the device media into segments for each drive.  A maximum of 8 partitions is allowed.
The information displayed is an open edit table of partition information - starting block, Partition Length, & Volume Name along with a header of device information (model #, slot, drive, capacity), partition initialization date, last modified date, & rem
Starting Block:  Acceptable values for starting block anything from 1 to 9999999 or the maximum capacity of the device less the partition length which ever is less.  Block 0 is reserved for the partition table.
Any change to an existing starting block will result in the erasure of the existing volume and all of its data for that partition.
Partition Length:  Acceptable values for partition length is anything from 0 to 65535 or up to the maximum capacity of the device (from the beginning block of the partition).
Any change to an existing partition length results in the erasure of the existing volume and all of the data for that partition.
Volume Name:  The current SOS formatted volume name on the partition.  If no volume has been initialized "UNFORMATTED" will appear in the volume name column.
To initialize or reformat the volume of the partition enter open-apple F or type in a new name for the volume.  This is a high level format routine to initialize a standard SOS root directory and file control block on the partition.
Any change to an existing starting block results in the erasure of the existing volume and all of the data for that partition.



























































































































































aining unused blocks.







