Subject: Re: What shall we do with the drunken disklabel?
To: Soren S. Jorvang <soren@wheel.dk>
From: Dave Olson <olson@bengaltech.com>
List: port-sgimips
Date: 07/01/2000 14:11:29
Soren S. Jorvang wrote: 
|  I am not planning on changing the on-disk convention, just the
|  userland representation.

Hmmm.  I think I'd find that even more confusing, particularly if any
other tools get used.

|  > convention.  If you don't use the SGI sash as the loader, you don't
|  > need anything at all, other than to leave block 0 alone with the
|  > minimal data structure at the start of the block, and a "bogus" size
|  > that is at least the start address of the secondary loader plus it's size
|  > to pass the validity check.
|  
|  Are you saying that it is possible to boot from a disk without
|  having the volume header "filesystem"?

Well, there really isn't a volume header filesystem, per se.  It's
just a magic number, and a table of partition sizes, and the list
of files "in the volume header filesystem".  Everything else
is unnecessary.  For historical reasons, device_parameters is
still there to keep offsets the same.

That is, this structure and it's substructures in block are
all that is needed (from dvh.h):

struct volume_header {
        int vh_magic;                           /* identifies volume header */
        short vh_rootpt;                        /* root partition number */
        short vh_swappt;                        /* swap partition number */
        char vh_bootfile[BFNAMESIZE];           /* name of file to boot */
        struct device_parameters vh_dp;         /* device parameters */
        struct volume_directory vh_vd[NVDIR];   /* other vol hdr contents */
        struct partition_table vh_pt[NPARTAB];  /* device partition layout */
        int vh_csum;                            /* volume header checksum */
        int vh_fill;    /* fill out to 512 bytes */
};

vh_rootpt and swappt aren't really needed. vh_bootfile isn't used,
the nvram contents are used. vh_dp isn't really used for booting (and only
a couple of fields are ever used at all) so it comes down to just vh_vd and
vh_pt, and the csum as a sanity check.  That leaves other parts of block 0
that can be used for the netbsd stuff, or it can follow in block 1 and 
beyond, as desired.  The fake_volhdr program shows the minimal stuff
that's needed (still on the SGI ftp site, in support/Pipeline, for those
interested).  It does a fair amount more than anything from 6.2 on
needs, in the interests of backwards compatibility.


Dave Olson
Personal:  olson@bengaltech.com        Work:  olson@geocast.com
           http://www.bengaltech.com          http://www.geocast.com