Re: [ILUG] SCSI woes

From: John P. Looney (jplooney-ilug at domain online.ie)
Date: Mon 07 Feb 2000 - 11:14:02 GMT


On Mon, Feb 07, 2000 at 10:52:02AM +0000, Vincent Cunniffe mentioned:
> > Or is the AVA-1505 a complete pile of crap? (even though I
> > got it for free :-)
> Alan Cox was ranting about it possibly being the nastiest piece
> of hardware he'd ever seen ;-)

 I've seen worse. Tony Bolger got a hold of an ancient NCR scsi card that
was detected on boot, but didn't allow him to mount any of his MO disks,
when he plugged in his Magneto-optical player to it.

 He played around with it for a while, and then called me over to look at
the output of

 "dd bytes=512 if=/dev/sda"

 It took me about twenty seconds to start giggling. 128 bytes into the
output was the string:

     <random stuff...> 0.5 SODMS

 Yeah, it was reading the first 128bytes backwards, and the second 128
bytes forwards, ad infinitum. Turns out that their offical spec says "Read
from the 128byte memory buffer, and set a flag saying "I'm ready for
more, and wait for an interrupt".

 So, most OSes will just memcpy() the buffer on the card to an internal
buffer. But Linux doesn't. It uses memmove(), in case the memory addresses
overlap (check the man page if you don't know the difference). This card
was so cheap and nasty, that the 128 byte buffer was a "virtual buffer".
What it did was that when you read byte 0 from the card, it gave you said
byte, and incremented the counter. When you read byte 1, it incremented
the counter. Because it was just an I/O port, instead of a memory buffer,
even if you read bytes 1, 15, 29, and 304, then 2, it would give you
0,1,2,3,4 - in that order.

 So, when memmove() was copying backwards.....

 Now that's a crappy SCSI card. When Tony sent in the four-line "This card
is too thick for memmove(), he challenged Alan to come up with a crapper
SCSI card. Alan thought about it, and said he'd not heard of one.

Kate



This archive was generated by hypermail 2.1.6 : Thu 06 Feb 2003 - 13:05:22 GMT