tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Generic boot image support in makefs(8)



Hello,

is%netbsd.org@localhost writes:
> On Sun, Jan 13, 2008 at 04:42:24PM +0000, Nick Hudson wrote:
> > Hi,
> > 
> > I added an option to makefs(8) to write a file into the first 32K of a 
> > cd9660 
> > image. This can be used to create bootable NetBSD/hp700 CDs.
> > 
> > Any comments before I commit?
> 
> I think this collides with SUN disklabels, needed for bootable SUN CD's (Sun3,
> Sun3x,32 bit Sparc - I'm not totally sure about Sparc64).

It is possible to have both SPARC disklabel and hp700 LIF structure.
I did this when I was developing hp700 xxboot.

hp700 LIF uses bytes 0-1 (0x80 0x00) and 240-251 (points to IPL location)
of the first sector.  The IPL itself is placed elsewhere.

SPARC disklabel starts at 128th byte (LABELOFFSET in <sparc/disklabel.h>)
of the first sector.

<sys/disklabel.h> (added byte offsets):
struct disklabel {
        uint32_t d_magic;               /* 128: the magic number */
        uint16_t d_type;                /* 132: drive type */
        uint16_t d_subtype;             /* 134: controller/d_type specific */
        char      d_typename[16];       /* 136: type name, e.g. "eagle" */

        ... (snip)

#define NDDATA 5
        uint32_t d_drivedata[NDDATA];   /* 220: drive-type specific information 
*/
#define NSPARE 5
        uint32_t d_spare[NSPARE];       /* 240: reserved for future use */
        uint32_t d_magic2;              /* 260: the magic number (again) */
        uint16_t d_checksum;            /* 264: xor of data incl. partitions */

                        /* filesystem and partition information: */
        ... (snip)
};

The hp700 LIF header (240-251) happen to fit in the spare words (d_spare),
and does not damage SPARC disklabel (the checksum of the disklabel needs
to be recalculated, though).

Just for your information.
-- 
ITOH Yasufumi



Home | Main Index | Thread Index | Old Index