Date: Fri, 11 Oct 2002 08:32:46 -0700 From: Peter Wemm <peter@wemm.org> To: Poul-Henning Kamp <phk@critter.freebsd.dk> Cc: ticso@cicely.de, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: booting UFS2 on alpha (was: cvs commit: src/sys/boot/common ufsread.c) Message-ID: <20021011153246.84E6D2A88D@canning.wemm.org> In-Reply-To: <14845.1034332326@critter.freebsd.dk>
next in thread | previous in thread | raw e-mail | index | archive | help
Poul-Henning Kamp wrote:
> In message <20021010210124.GV17920@cicely8.cicely.de>, Bernd Walter writes:
>
> >>>>boot dka400
> >(boot dka400.4.0.6.0 -flags 0)
> >block 0 of dka400.4.0.6.0 is not a valid boot block
> >bootstrap failure
> >
> >This one is my biggest problem.
> >SRM doesn't accept the disklabel.
> >Once I dd the first 512 bytes from an old disk SRM is happy.
> >I compared them with hexdump, but wasn't able to find the reason.
>
> Is there some place which documents what the requirements for being
> a valid boot-block is ?
sbin/disklabel.c:
/*
* Generate the bootblock checksum for the SRM console.
*/
for (p = (u_long *)boot, i = 0, sum = 0; i < 63; i++)
sum += p[i];
p[63] = sum;
And:
/*
* On the alpha, the primary bootstrap starts at the
* second sector of the boot area. The first sector
* contains the label and must be edited to contain the
* size and location of the primary bootstrap.
*/
n = read(b, boot + dp->d_secsize, (int)dp->d_bbsize);
if (n < 0)
err(4, "%s", xxboot);
bootinfo = (u_long *)(boot + 480);
bootinfo[0] = (n + dp->d_secsize - 1) / dp->d_secsize;
bootinfo[1] = 1; /* start at sector 1 */
bootinfo[2] = 0; /* flags (must be zero) */
The first sector has a tiny table starting at bytes 480 and on.
480-487: size of boot code
488-495: start of boot code
496-511: 64 bit checksum of sector 0.
Sector 0 is also the disklabel (the traditional BSD location) rather than
sector 1 like on i386.
Cheers,
-Peter
--
Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021011153246.84E6D2A88D>
