Path: utzoo!mnetor!uunet!husc6!bloom-beacon!gatech!rutgers!bellcore!tness7!tness1!nuchat!elg From: elg@nuchat.UUCP (Eric Green) Newsgroups: comp.sys.cbm Subject: Re: Need 1541 info Message-ID: <919@nuchat.UUCP> Date: 10 Apr 88 06:14:49 GMT References: <5314@pyr.gatech.EDU> Organization: Public Access - Houston, Tx Lines: 72 From article <5314@pyr.gatech.EDU>, by byron@pyr.gatech.EDU (Byron A Jeff): > I'm homebrewing a 68010 based system and I've decided I need some > form of mass storage. I want to use a 1541 for the following reasons: > > 1) I have two in my apartment. > 2) The interface is simple and inexpensive. > 3) The drive is intelligent (well kinda) so I don't have to write > drivers from scratch to use it initially. One reason you DON'T want to use a 1541: It's slow as molasses. > > First the hardware: > 1) What is the pinout for the DIN connector? Get the Programmer's Reference Guide. $14.95 at any bookstore. It has that, plus, a waveform diagram of the synchronous bus protocol. Get the Abacus book "Anatomy of the 1541" for more information about that bus protocol. It is NOT a simple protocol, it takes a bit of work to get it going right, and timing is extremely critical -- especially for output, where the C-64 has four "nop" instructions providing a delay between one signal going low and waiting for another to come high. Since input is synchronous, no problem with timing there. The C64 Programmer's Reference Guide has a listing of the timing parameters, and you can read the disassembly in "Anatomy of the 1541" or "Anatomy of the Commodore 64" to get the nitty-gritty of what those waveform diagrams stand for. The basic complexity is that there are no handshaking lines. Thus, the clock line and data line must be pressed into service for handshaking purposes. > 3) What is the maximum clock rate? The 1541 can go faster only if you use a "fastloader"-type program (which basically discards all the complicated handshaking of the regular DOS, doing handshaking on a 256-byte basis instead of a 1-byte basis, and using two bus lines to transfer data). > > And software: > 5) What is the format of the data transferred? All commands have a > drive and channel number along with commands and data. How is > this info packaged? How does the drive send back a block of > data? To open a file, C64 DOS sets the ATN line, sends an "OPEN" code with the device number, then a secondary address (ATN is still set right now), then the filename (ATN still set). Then raises ATN back to low level (ATN signals that the C-64 is sending a command). To close a file, it sets the ATN, sends a "CLOSE" code. To read from disk drive, sends a "TALK" code, then a secondary address, and raises ATN back up. All input handshaking from the computer then fetches bytes from the already-opened file with that secondary address. A "CLRCHN" code unsets the "TALK" (this is sent with ATN, of course). A "CLOSE" code, then a secondary address, closes a file. Various wobblings of the handshaking, on input, tells the computer it's hit EOF on the current input file. I'm not up on actual byte-by-byte handshaking, at the moment.... I have a description somewhere around here, that I wrote up from reading the disassemblies and the Abacus books, I'll type it in and post it when I find it (includes the "fast" mode for 1571, too -- which isn't so fast, because it uses the exact same handshaking method as the 1541, only speeding up actual transferance of the byte itself). > 6) Is it possible to get a particular sector without having it in a file > (random access) short of rewriting the DOS in the drive? Oh certainly. Block-reads and block-writes have always been part of the DOS, as far back as most can remember (that was the ONLY way that the old Pet people could do random-access files). > Byron A. Jeff > uucp: ...!{decvax,hplabs,ihnp4,linus,rutgers,seismo}!gatech!pyr!byron -- Eric Lee Green P.O. Box 92191 Lafayette, LA 70509 uunet!nuchat!elg "I survived the Flood of '88"