André's 8-bit Pages  Projects  Code  Resources  Tools  Forum
(by Google)

CS/A65 SCSI interface

This board implements a SCSI interface for the CS/A65 computer. It implements a mechanism to use the asynchronous mode on parallel SCSI cables - that is defined even in the SCSI-III standard. This interface can be used to attach disk drives and other SCSI devices. It has only been tested with SCSI disks, though (yet).

Since revision 1.1 it also includes an I2C controller.

Since revision 1.2 it also includes an I2C flash ROM, as well as a possibly battery buffered I2C RTC (clock) with some additional buffered RAM.

  •  
    2007-05-26 Added new board revision (with I2C flash and RTC/RAM). It also adds the missing pullups for I2C SDA and SCL.
  •  
    2006-12-14 Added new board revision (with I2C interface) and new driver code.
  •  
    2006-11-01 Added driver code.

The hardware architecture is actually very simple. As only asynchronous data transfer is needed, the board provides bidirectional access to the 8 data lines, plus access to the control lines. Parity check is provided, as well as automatic REQ/ACK handling by simply accessing the data register. For more information see the board description below.

The SCSI board has a heavily modified version of an old SASI interface from the german elektor magazin (around '88 or so). It has been reworked to get more SCSI-II compliance, but it is still not there. It works, however, with my Seagate ST1096N harddisk :-)

The software architecture is kept as flexible as possible. Three levels work together, the hardware driver, the partition level that transforms block numbers in a partition into block numbers in the device, and the third level which is the filesystem code.

Hardware layer

The hardware layer is a low level driver that can detect the devices connected to the SCSI bus, inquire the device (it returns the type etc), get the blocksize and read or write single blocks. As SCSI devices just hold a number of linearly numbered blocks there is absolutely no need to use any track/sector numbering etc. In the driver code (see below) the file csascsi1.a65 contains the low level driver for the generic SCSI interface described above. The file ramdscsi.a65 holds a driver for another interface, that I implemented in the VICE emulator, not in hardware. You write the block number to some I/O locations and get the right block memory mapped. This code shows how easy it is to replace the hardware level if necessary.

Partition layer

The partition level consists of three parts, where only two are implemented so far. First in the file part.i65 the format of the partition table is defined. paccess.a65 then translates the block numbers given to the absolute block numbers on the device using the partition table. The table is filled in on init by the code in pcpart.a65 that scans the disk for PC-like partition tables. To use other types of partition tables (like Amiga-type for example), simply replace this file with a new one that fills in the partition table appropriately. The third part would be an fdisk program that uses the low level routines to manipulate the partition tables. But here I still rely on the Linux counterpart I already have :-)

Filesystem level

The upper level is the filesystem level. It contains code to handle directories, files, allocation tables etc. This is not contained in the basic SCSI drivers, because it is heavily depending on the operating system. It should be easy to implement any filesystem you like on the level provided by the partition code.

Drivers

The most recent SCSI drivers can be found in the GeckOS/A65 operating system. An example of a filesystem implementation can be found in oa-2.0.8/sysapps/fs/fsibm*, that implement a fileserver task for the GeckOS/A65 operating system. It handles PC-style disks with the FAT12 or FAT16 filesystem (no FAT32 and no long filenames). But be warned, it is an early beta!!! Don't ever try it on a disk that contains anything valuable to you!!!

OS/A65 I2C driver

This test driver handles the I2C interface, and writes a consecutive sequence of numbers to I2C address $40 where I have a parallel port PCF8574 with LEDs on the outputs for testing. .

PETCPU fat40 I2C driver

This test driver handles the I2C interface, and writes a consecutive sequence of numbers to I2C address $40 where I have a parallel port PCF8574 with LEDs on the outputs for testing. It can be run in a PETCPU fat40 setup.

PETCPU fat40 SCSI driver

This driver handles the base SCSI operations in a PETCPU fat40 setup.

Note: This driver is newer than the OS/A65 driver below.

 
petscsi.tar.gz
 
scsi-device-list-small.jpg(Sample device scan output)
 
scsi-partition-list-small.jpg(Sample partition scan output)
 
scsi-test-setup.jpg(My SCSI test setup (still with the old board, though))

OS/A65 SCSI driver

This driver handles the base SCSI operations. It consists of these files:
  • scsi.a65 - binds the hardware driver to the fsibm FAT filesystem. It exports the same interface as described in the floppy driver.
  • part.i65 - partition definitions
  • pcpart.a65 - scan PC-style partitions
  • paccess.a65 - translates the partition-relative block numbers to absolute disk block numbers.
  • csascsi1.a65 - the actual hardware driver
The hardware driver exports the following methods:
  • iniscsi - init the device
  • inquiry - inquire a device
  • getsize - get the size of the device
  • readblock - read a block
  • writeblock - write a block
 
scsi.a65(OS/A65 binding)
 
part.i65(partition definitions)
 
pcpart.a65(pc partition scanner)
 
paccess.a65(partition access)
 
csascsi1.a65(hardware driver)

Version: 1.2B

Status: untested

Notes

 

This board implements a SCSI-I controller, as well as an I2C interface.

The following restrictions apply to the SCSI interface:

  • Can only be used as controller, not device
  • Controller SCSI ID always 7
  • Can not share the bus with another controller

The I2C interface is implemented using a Philips PCF8584 I2C controller. This controller only works relyably at 1MHz, so the board implements a mechanism to assert the RDY line to hold the CPU for a single cycle. This feature is jumperable.

Version: 1.1A

Status: ok

Notes

 
Only recently I found that the pull-up resistors for I2C SDA and SCL are missing. Add a 10k resistor from each of those lines to VCC
 

This board implements a SCSI-I controller, as well as an I2C interface.

The following restrictions apply to the SCSI interface:

  • Can only be used as controller, not device
  • Controller SCSI ID always 7
  • Can not share the bus with another controller

The I2C interface is implemented using a Philips PCF8584 I2C controller. This controller only works relyably at 1MHz, so the board implements a mechanism to assert the RDY line to hold the CPU for a single cycle. This feature is jumperable.

Version: 1.0A

Status: ok

Notes

 
This board implements a SCSI-I controller. The following restrictions apply:
  • Can only be used as controller, not device
  • Controller SCSI ID always 7
  • Can not share the bus with another controller

Last modified: 2006-12-14.

Return to Homepage

share
follow

Follow my 8-bit tweets on Twitter (In new window)

discuss

Discuss my site on this 6502.org forum thread

(Forum registration required to post)

hot!

Dive into the retro feeling and build yourself a Commodore PET replica

Need more speed? Speed up your 6502 computer with this 10 MHz 6502 CPU accelerator board

Interested in electronics design? Look at the design lesson I got from Bil Herd, the hardware designer of the C128

Want 64bit? - pimp the 6502 with the 65k processor design!