Subject: proposal: sys/dkio.h
To: None <tech-kern@NetBSD.ORG>
From: Jason Thorpe <>
List: tech-kern
Date: 01/28/1996 18:00:07

I've been looking at where we define disk-specific ioctls, and I don't 
really like what I see.  Firstly, we're lacking some important ones:


These are no longer CD-ROM specific.  It's been reported to me by at 
least a couple of individuals that these would be really handy for ZIP 
drives, mag-ops, etc.  It appears as if our current SCSI disk code 
doesn't deal with these at all.

What I'd like to do, then, is create <sys/dkio.h> and place the following 
ioctls in it:

	DIOCGDINFO	get disklabel information
	DIOCSDINFO	set in-core disklabel information
	DIOCWDINFO	set in-core and update disk copy of disklabel
	DIOCGPART	kernel-use: get info for this partition
	DIOCRFORMAT	format operation: read
	DIOCWFORMAT	format operation: write
	DIOCSSTEP	set step rate
	DIOCSRETRIES	set # of retries
	DIOCWLABEL	enable/disable writing of disklabel
	DIOCSBAD	set in-core dkbad info
	DIOCEJECT	eject disk
	DIOCALLOW	allow disk to be ejected
	DIOCPREVENT	prevent disk from being ejected

Note that all but DIOCALLOW and DIOCPREVENT are currently defined in 
<sys/disklabel.h>.  It's not clear to me that all of the above ioctls are 
actually implemented.  That's another problem (?) altogether.

Anyhow, if folks think this is a good idea, then I'll update the CD-ROM 
driver to understand the DIOC* versions of eject, allow, and disallow, too.


Jason R. Thorpe                             
NASA Ames Research Center                               Home: 408.866.1912
NAS: M/S 258-6                                          Work: 415.604.0935
Moffett Field, CA 94035                                Pager: 415.428.6939