Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Jul 2011 13:37:57 +0400
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        Jason Hellenthal <jhell@DataIX.net>
Cc:        svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   Re: svn commit: r224464 - in stable/8/sys: geom/part sys
Message-ID:  <4E312DF5.2050306@FreeBSD.org>
In-Reply-To: <20110728024007.GB55550@DataIX.net>
References:  <201107270410.p6R4AXc3040342@svn.freebsd.org> <20110728024007.GB55550@DataIX.net>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigC86E7A483DB4FA181B6735A7
Content-Type: text/plain; charset=KOI8-R
Content-Transfer-Encoding: quoted-printable

On 28.07.2011 6:40, Jason Hellenthal wrote:
>> +	uint32_t dsn;
>> +
>> +	if (gpp->gpp_codesize !=3D MBRSIZE)
>> +		return (ENODEV);
>=20
> Is it known for an absolute fact that the size being written is always
> going to be the size of MBRSIZE ? never less ? wouldnt ">=3D" greater-t=
han
> or equal make sense here ? though I would seriously doubt it needs to
> return on equal too as that could be written.

Yes. Now the size of bootcode must be equal to MBRSIZE. We do not have
any of bootcode images with size different than MBRSIZE. If you want to
write bootcode with size less than MBRSIZE, then just fill up your image
with zeroes to MBRSIZE.

>> -	codesz =3D DOSPARTOFF;
>>  	table =3D (struct g_part_mbr_table *)basetable;
>> -	bzero(table->mbr, codesz);
>> -	codesz =3D MIN(codesz,  gpp->gpp_codesize);
>> -	if (codesz > 0)
>> -		bcopy(gpp->gpp_codeptr, table->mbr, codesz);
>> +	dsn =3D *(uint32_t *)(table->mbr + DOSDSNOFF);
>> +	bcopy(gpp->gpp_codeptr, table->mbr, DOSPARTOFF);
>> +	if (dsn !=3D 0)
>=20
> Shit happens... any case that the product might return less than 0
> causing this to still fall through and process... ? ">" ?

Variable with type uint32_t could not be less than zero. This code only
restores old DSN if it is not zero. In any other cases you can use boot0c=
fg(8)
to set or change it.

--=20
WBR, Andrey V. Elsukov


--------------enigC86E7A483DB4FA181B6735A7
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)

iQEcBAEBAgAGBQJOMS36AAoJEAHF6gQQyKF6OIcIAK4l/muhv/PMUMqhnQHVSAFj
afLFgFAgul4ENbVD9k7o9WZoJy2Dk0285jKxang8m+O//7iATdCt9fHSle9VRh+e
LuhH+kk541Lq6TXae/EtyBR1+tcSUXOUapioioRxjst+bgFqmh4uskGnTGyJL+vl
TIhH3FhsPca+FTadlDI4cGGXOKmym6hiyi3pV/V1eZHbMkWUhCY7sNtmg718qlum
y4LHUajOjC6+KF1Lomu2x5iHmkW7MUAlFGnp1BdSobEcVM5fQn7C8zodM3ar98cX
bmvZNWV86hMWdyDJJM0C/SiQUkj94/C8TaTEcw37JvLl10UQHmPi4HVzXyhRc5M=
=gDKy
-----END PGP SIGNATURE-----

--------------enigC86E7A483DB4FA181B6735A7--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E312DF5.2050306>