Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Jun 2000 01:02:54 -0600
From:      "Kenneth D. Merry" <ken@kdm.org>
To:        Nat Lanza <magus@cs.cmu.edu>
Cc:        scsi@FreeBSD.ORG, hackers@FreeBSD.ORG
Subject:   Re: SCSI HBA device detection?
Message-ID:  <20000625010254.A19247@panzer.kdm.org>
In-Reply-To: <uoc66r0iarh.fsf@hurlame.pdl.cs.cmu.edu>; from magus@cs.cmu.edu on Fri, Jun 23, 2000 at 01:10:26PM -0400
References:  <uoc66r0iarh.fsf@hurlame.pdl.cs.cmu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jun 23, 2000 at 13:10:26 -0400, Nat Lanza wrote:
> I'm writing a SCSI HBA driver that simulates a bus with some
> ramdisk-backed disks attached to it. I've read through the HBA
> tutorial in Daemon News, but I'm still unsure how to tell the system
> about my pretend disk devices. I suspect part of the problem is that
> I don't actually have real devices or a real IO bus.
> 
> Anyone feel like explaining this?

Well, when the system boots, it sends out a SCSI INQUIRY command to each
target on each bus.  Each target that responds and sends back inquiry data
will get further along in the probe process.  The same thing happens when
you do 'camcontrol rescan 4' to rescan SCSI bus 4.

You need to have your "disks" respond to the inquiry command with inquiry
data, as well as have them respond suitably to the various other commands
that CAM will send.

The commands you'll need to support include (but are not limited to),
inquiry, test unit ready, read capacity, read (6, 10 and maybe 12 byte),
write (6, 10 and maybe 12 byte) and perhaps mode sense.  Those commands
will probably get you most of the way towards probing and attaching with
the da(4) driver.

Another alternative to a ramdisk-like driver is a target mode driver.

There is a target mode processor target device in sys/cam/scsi/scsi_target.c 
that you can look at as an example.

You'd be limited to the SCSI bus speed (40, 80, 160MB/sec) for throughput
though.  You'll need specific hardware (Adaptec or QLogic) to do it as
well.

Ken
-- 
Kenneth Merry
ken@kdm.org


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000625010254.A19247>