Q: Good learning documents for SCSI device drivers

Q: Good learning documents for SCSI device drivers

Post by Jeffrey M. Metcal » Tue, 30 Sep 1997 04:00:00



Hello,

I am writing to ask if anyone can point me to some good learning
documents for learning the basics of the SCSI subsystem.  I have
an open problem with the gnats database

http://www.freebsd.org/cgi/query-pr.cgi?pr=4498

where my Iomega Zip 100 SCSI drive atached to my ProAudioStudio
SCSI adapter is having data corruption problems.  I have written
to both the FreeBSD and LINUX authors of the ncr5830 code and
have received no replies.  I understand since few people actually
using FreeBSD use such hardware, I am probably on my own for a
fix.  All I'm asking is some direction in finding good books
to learn from in order to solve the problem myself.  I have
never written any kind of device driver, much less a driver
for a SCSI device.  I have fairly good C programming skills
(ie, I can understand the logic flow of the ncr5830.c kernel
code and understand the definitions and usage syntax of the data
structures).  But the code is otherwise meaningless to me
since I have no idea about how the code interacts with the
hardware (eg. what's "establising a nexus" mean?)  I'm sure
there are plenty of great books out there where a motivated
person like myself can learn what he needs to know.

I hope some kind soul can give me some focus.  Understand
that I would need the basics, yet I would also need enough practical
focus, from whatever sources are suggested, to actually trouble-shoot
and hack into some real code.  Ideally, literature that might cover
the ncr5830 would be great!! I understand this to be a well documented
and understood device.

Thanks in advance for any help!!

JM

--
Jeffrey M. Metcalf
Assistant Computer Systems Support Engineer
United Technologies Research Center

 
 
 

Q: Good learning documents for SCSI device drivers

Post by J Wuns » Thu, 02 Oct 1997 04:00:00



Quote:>   All I'm asking is some direction in finding good books
> to learn from in order to solve the problem myself.  I have
> never written any kind of device driver, much less a driver
> for a SCSI device.

Sorry, there are probably something like 0 books about the *BSD SCSI
subsystem.  Writing a book probably takes the time for writing three
device drivers, and it will be outdated within a couple of months when
the CAM code enters the scene.  The basic problem is that most FreeBSD
contributors are not from a university background, which greatly
limits their time for writing books etc.

Quote:>  I have fairly good C programming skills
> (ie, I can understand the logic flow of the ncr5830.c kernel
> code and understand the definitions and usage syntax of the data
> structures).  But the code is otherwise meaningless to me
> since I have no idea about how the code interacts with the
> hardware (eg. what's "establising a nexus" mean?)


detailed enough questions, somebody will be able to answer you.  All
the people who wrote the basics of the existing code should be
listening there.

Also, you should get comfortable with kernel debugging.  There's an
entire section in the handbook about it...

Btw., we've all once started to dive into the kernel...  it's not
unintelligible.

--
cheers, J"org


Never trust an operating system you don't have sources for. ;-)

 
 
 

1. Learning to write a device driver for SCSI...



Read Rik Faith's paper on doing it (also included in the KHG)  
Unfortunately, it's a bit out of date, so you'll also need to read
the source code of some other modern drivers like the new Buslogic driver.  
Do something similar.

The KHG has additional information on kernel support facilities which
may be useful.

An operating systems text (Tannenbaum's _Modern Operating Systems_?)
will do a reasonable job of covering basic principles like critical
regions.

Finally, you'll want to do something similar to one of the other PCI
SCSI drivers (53c7,8xx, etc) for detecting the hardware.  If you want
direct access via method 1 or method 2 to PCI configuration space instead
of using the 32 bit BIOS extensions (which don't always work right),
please do the right thing and replace the innards of pcibios* rather
than introducing Yet Another Cut And Paste Copy into the kernel
source.

It may (or may not) be compatable with other supported Adaptec boards, in
which case you probably don't want to write a device driver for it; merely
make a few changes to an existing driver.  

Of course, to do that, you'll need documentation from Adaptec on both
the old and new boards.

Somewhere between trivial and thousands of lines of 'C', another
thousand lines of chip microcode, and an assembler for the chip.

drivers/scsi/makefile and drivers/scsi/hosts.c.

Operating systems.

Yes, but none that are relevant to the Linux SCSI subsystem.
--


2. Newbie needs help with first kernel compile

3. PCI device vs SCSI device driver

4. How do I read from or write to mouse?

5. Device driver devices.pci.scsi missing

6. X server

7. learning device drivers

8. Please help !!! Unexplained home network ftp dysfunction/telnet slowness.

9. help in learning device drivers

10. Device driver documents

11. Learning Linux Device Drivers Programming ? advice needed ?

12. writing scsi device scsi adapter drivers under hp-ux

13. SCSI driver for Internal SCSI device Compaq Prosignia