Subject: Re: Trouble with PCI, VGA, 32Mbyte
To: Charles M. Hannum <mycroft@ai.mit.edu>
From: Peter Dufault <dufault@hda.com>
List: current-users
Date: 06/10/1995 21:57:44
Charles M. Hannum writes:

>    > * Allow a mnemonic name for the command, and always use the mnemonic
>    > names when suggesting something to a user.
> 
>    This makes it quite a bit less arbitrary - you need to know a lot
>    about the individual commands.
> 
>    > * Unless another option is given, disallow any command that would
>    > modify the device's state in a significant way.
> 
>    Again, this makes it quite a bit less arbitrary - you need to know a lot
>    about the individual commands.
> 
> If by `you' you mean the user, then I'd argue that the user bloody
> well ought to know what he/she is doing.  If by `you' you mean the
> program, then it's quite trivial to store the information in a file
> somewhere.  Note that I did *not* suggest restricting the interface so
> that you *must* use a mnemonic name; you can still send any command
> you want.

I've already pointed out that I don't intend this to be a general
disk formatting utility.  It is a method of sending arbitrary commands
to a SCSI device.

There are levels of users, including users (such as me) that have to
send various SCSI commands to various devices at times.  I find
the current interface convenient.  As a matter of fact, I don't
know of a better one on a Unix system.

There are other users who don't need this level of control.  It is
convenient for someone like me to provide scripts for these other
users.  I need a basis for this.  The current scsi command provides
this basis.

Devices that accept this "arbitrary ioctl" must be protected
from casual use.  There is little difference between providing a
convenient command line interface and providing a convenient library
interface.

If you propose that this capability only be provided within the kernel
then I disagree.

The mode page editor provides a clean interface that I consider to be
a good interface.  However, I still want the arbitrary interface.

>    > * Verify the CDB length when possible.
> 
>    The FreeBSD driver does this already.
> 
> I just looked, and neither the driver, the library, nor the program
> actually check that the CDB is the correct length for the particular
> command.

Check again.

The "test unit ready" command is six zeros.  Let's try a few illegal
commands on FreeBSD:

> hda# scsi -f /dev/rsd0.ctl -c "0"
> SCIOCCOMMAND ioctl: Input/output error
> hda# scsi -f /dev/rsd0.ctl -c "0 0"
> SCIOCCOMMAND ioctl: Input/output error
> hda# scsi -f /dev/rsd0.ctl -c "0 0 0 0 0 0"
> hda# scsi -f /dev/rsd0.ctl -c "0 0 0 0 0 0 0"
> SCIOCCOMMAND ioctl: Input/output error

Only the correct command works since the driver validates the length
of the command.  Check in scsi_scsi_cmd in scsi_base.c.

>    I won't bother with any more peace offerings.
> 
> One could rightly argue that you never made any.

I saw the postings relating to issues that the SCSI mode page editor
would help with.  I pointed out the mode editor.  When someone
asked about 1K sector I pointed out how it maybe could be done.
The fact that I wasn't sure since I didn't have my SCSI spec at my
side probably indicated "to the casual reader" that it was for
those way familiar with SCSI.

You responded with sarcasm and criticism.

My peace offering was in proposing that you thought I was offering
a general disk formatting utility that would require an individual
to carefully build up a SCSI CDB.

However, as you are quick to point out, you intended to be sarcastic
and critical.

-- 
Peter Dufault               Real Time Machine Control and Simulation
HD Associates, Inc.         Voice: 508 433 6936
dufault@hda.com             Fax:   508 433 5267