Subject: RE: Included program DEVGETGEOMST
To: Toby S Brinck <tbrinck@isc.sjsu.edu>
From: John C. Hayward <johnh@david.wheaton.edu>
List: port-pmax
Date: 01/05/1996 17:50:16
On Fri, 5 Jan 1996, Toby S Brinck wrote:

> 
> watzup.....
> 
> I believe I understand enough of the syntax of the program that Arne 
> included with his installation notes to know what it does.  The problem I 
> have is compiling the sucker.  Are there any special switches I need to 
> give the compiler, and is it 'cc' that I use?
> 
> Thanx.
> 
> Toby Brinck
> tbrinck@isc.sjsu.edu
> San Jose State University
I compiled it with cc and it worked for me without any switches:
==================================================================
# cat disksize.c
#include <sys/devio.h>
#include <sys/ioctl.h>

main(){
  DEVGEOMST g;
  ioctl(0, DEVGETGEOM, &g);
  printf("size %d:  sec/trk %d, trk/cyl %d, cyl %d  (attr %d)\n",
         g.geom_info.dev_size,
         g.geom_info.nsectors,
         g.geom_info.ntracks,
         g.geom_info.ncylinders,
         g.geom_info.attributes);
}

# cc disksize.c
# a.out </dev/rz0a
size 832527:  sec/trk 62, trk/cyl 9, cyl 1476  (attr 0)
===========================================================================

My problem is that after I do all the stuff specified in the instructions
when I attempt:
>>> boot -f rz(0,0,0)netbsd
it waits for a while then comes back with an error about bad path.

It appears that I don't have the boot blocks correct.

I did have a question about "swaping the a and d" partitions.
Should this be:
a    ....                   start of miniroot
...
d    ....                   0 (start of disk)

or:
d    ....                   0 (start of disk)
...
a    ....                   start of miniroot
====================================
or does it not matter?  I tried both ways without success.

The only thing I have not done according to example is to treat
cylinders as 1 block items.  I'll try that next.

I also have a problem with the math in that in the above example:

62*9*1476 = 823608 not the 832527 reported by the disksize.c program.

I don't know if this is because of different zoneing info though I
think my disks might be old enough that that should not be an issue.

johnh...