harker@nsc.nsc.com (Robert Harker, all around good guy) (09/14/88)
I am looking for a skeleton SCSI device driver to use as a model for writing a device driver for a custom SCSI device I am building. Having listened to the net and read the sun documentation I am running into a dead end on how to write a device driver for the Sun SCSI interface. If you have written one or know of someone who has, I would like to see the code your wrote or an outline of your code. I need help with how you divide the device driver between the generic Sun SCSI controller half and the custom half you write for the specific SCSI target. How do you pass data between these two halfs? How do you initiate SCSI commands on the SCSI bus? Wouldn't it be nice if Sun provided a skeleton device driver and a model device driver for SCSI devices like they do for MultiBus/VME devices? (please dont tell me about the SCSI device driver kit Sun consulting sells, it's only $1,350 single user, $6,500 unlimited useage, this is only a hobby of mine) I am working on designing a general propose SCSI microcontroller engine to allow for easy attachment of I/O devices to the SCSI bus. I am doing this as a hobby, trying to learn about hardware and UNIX device drivers. (if your going to hack hardware, PCs are for wimps (:-) I am currently designing it around a Motorola 68HC11 microcontroller with the New Micro Inc. forth ROM burned in. To this I have attached a NCR 5380 SCSI controller chip. I am writing a forth vocabulary of SCSI words to handle reading SCSI commands, and reading and writing SCSI data. This Microcontroller will have a simple 8 bit expansion bus for interfacing it to other I/O peripherals. I am currently working on 24 bit digital I/O as well as 12 bit A/D and D/A conversion. I am finding forth to be an excellent hardware development environment. It gives me a nice user interface for developing code and debugging problems. It also allows for the simple inclusion of assembly code routines for good performance. The New Micro Inc Forth should also allow me to generate ROMable code for embedded applications (like a SCSI Forth engine). I have tries other microprocessor development environments (CPM & IBM PC) and found them hard to learn and use. I like the forth microcontroller because it is well documented and easy to learn. It is also cheap ($200) As to leaning about SCSI I have found two very good sources of information: The first is two articles by Steve Ciarcia in the April/May 1986 issues of Byte on adding a SCSI interface to the SB-180 computer. The second is a series of articles by Rick Lehrbaum in "The Computer Journal" (issues 22, 23, 24, and 25, 406-257-9119). These both are very good introductory articles explaining how the SCSI bus works. For the hardcore, both of the SCSI specs are very good, SCSI and the proposed SCSI II spec, as well as the NCR 5380 manual.