Re: [PARPORT] ZIP & C64


Grant R. Guenther (grant@torque.net)
Sat, 28 Feb 1998 08:51:47 -0500 (EST)


> I really think it's possible, i've seen driver code for Linux
> but it uses SCSI stuffs.

It might be possible to write a program that could transfer files to
and from a ZIP disk, but you have a lot of work to do. The very first
thing will be to understand how to program your parallel port. It's
been about 12 years since I saw a C64, my guess is that they have simple
unidirectional ports, so your driver would only be able to do 4-bit
mode at best.

Assuming you establish how to program the port, you would have to
port the protocol engine from the Linux ppa driver, and implement
a SCSI command layer. You should get hold of the SCSI-II standard
and study how SCSI works.

Next you need to implement a 'filesystem'. As I recall, file systems
were implemented in ROM in the disk drives themselves on the C64, so
there is probably no such thing as a C64 standard file system, besides,
you'd probably want it to look like something standard - the MS-DOS
structure, possibly.

Finally, you need to either build a user interface to all this stuff.

I'm not sure, but you might find a lot of useful clues by studying the
'mtools' package. I know that some support for ZIP drives has made it
into that package - but I don't think a cross platform implementation
of the PPA driver is there. It is something that ought to be done.
I had originally thought of writing PPA as a portable user-mode
application, but the size of the project seemed overwhelming.

> I mean of example, what is a simple program which eject the disk?
> WITHOUT USING any SCSI libraries.

Read the source of my ziptool.c program - it formats the SCSI command
blocks for ejection, and then sends them (via the Linux SCSI system)
to the driver. In your situation, the SCSI administration layers are
not required.

There is an ancient version of the first thing I wrote for testing out
my understanding of the PPA. It's still available at the following URL

        ftp://gear.torque.net/pub/oldstuff/uppa.c

ziptool.c is at

        ftp://ftp.torque.net/pub/ziptool.c

(NB: those hosts _are_ different)

You would want to study ppa.c from the latest 2.1 kernels, as the
protocol engine has been improved a lot since my original driver.
You might also want my old ppa 0.26 driver from the 2.0 source tree
as a bridge between uppa.c and the current ppa.c.

Also, go to Dave Campbell's page

        http://www.torque.net/~campbell

I believe he has some other user mode programs that might give you
some other clues ...

Good luck ...

--------------------------------------------------------------------------
Grant R. Guenther grant@torque.net
--------------------------------------------------------------------------

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Wed 30 Dec 1998 - 10:17:31 EST