Subject: Re: nore on disk stats
To: None <perry@piermont.com>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-kern
Date: 11/13/1995 22:32:29
On Tue, 14 Nov 1995 00:30:52 -0500
"Perry E. Metzger" <perry@piermont.com> wrote:
> Actually, Jason Thorpe has given me a program that walks the kernel
> tables and gets all of the information very cleanly -- even
> automatically tells you whats a disk, whats a network interface,
> etc. I sill need an interface to extract disk geometry information,
> but given that I'll have about everything I need in order to
> prrogramatically extract all the information one needs for
> installation purposes, and in a port independent manner, too!
Well, like I've mentioned before, this is Really Easy with SCSI.
However, having an hp300, I do indeed realize that All The World's Not
SCSI. What I'd duggest is a new ioctl (DIOCGGEOM maybe?) that would be
implemented in the individual drivers, like the disklabel-related ones
are, which fills in a structure like the following:
struct disk_geom {
u_int32_t dg_ncyl; /* cylinders per unit */
u_int32_t dg_ntrk; /* tracks per cyl */
u_int32_t dg_nblk; /* blocks per unit */
u_int32_t dg_blksz; /* bytes per block */
};
If you can't get this info from a particular type of hardware, you just
get back an ENOTTY.
Anyhow, I don't have time to work on anything like that at the moment;
already have way too much to do :-) But, this at least might be
something to think about for 1.2...
Ciao.
--------------------------------------------------------------------------
Jason R. Thorpe thorpej@nas.nasa.gov
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