Subject: Re: [Cannot boot netbsd-3.0 on my powerbook 12'] It does boot!
To: None <port-macppc@netbsd.org>
From: Antoine Reilles <Antoine.Reilles@loria.fr>
List: port-macppc
Date: 02/13/2006 22:43:57
--2iBwrppp/7QCDedR
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Feb 13, 2006 at 07:00:54AM -0800, Chuck Silvers wrote:
> On Fri, Feb 10, 2006 at 02:33:42PM +0100, Antoine Reilles wrote:
> > After looking at the ofwinit routine in openbsd, I tried to add code to
> > save and restore return address, and now, i can boot a GENERIC macppc
> > kernel on my powerbook 6,8
> >=20
> > I don't exactly know why it was not working before, neither why exactly
> > it does not, but so far three different kernels with different config,
> > but the same tweak to boot without problem.
> > It is also surely related to the problem Olivier was experiencing
> > (http://mail-index.netbsd.org/port-macppc/2005/12/27/0001.html),
> > or davide
> > (http://mail-index.netbsd.org/port-macppc/2004/08/30/0010.html), and=20
> > also PR #22316.
> >=20
> > Here the patch i used.
> > I borrowed those lines from openbsd, so they use %r, since they
> > converted all their assembly to that.
> > Can someone who has a clue please look at it ?
>=20
> the openbsd version of this code saves and restores those caller-saved
> registers around calling some functions (savemmu and save_ofw_mapping).
> since ofwinit() in netbsd doesn't call any functions (outside the
> FIRMWORKSBUGS case, which does its own save-and-restore dance and
> is not enabled for macppc), saving and restoring those registers
> is not necessary. =20
It tried it because that was the only lines in openbsd's ofwinit for
which i could reasonably think they would not make things even worse
than what they were
> if this change really is making a difference for you,
> then I would guess that it's because it changes the position of the
> instructions that come after your change.  if that's true, then adding
> the same number of nop instructions instead of the other instructions
> would work just as well.  could you give that a try?
I just tried to replace the four statements i added before by nop, and
it looks good: at least, 1 try, 1 success. I tried the previous patch
with different builds, for several different config, and got 100%
success.

antoine

--2iBwrppp/7QCDedR
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (NetBSD)

iD8DBQFD8P2d4VqmoGDE/mwRAsYOAJ9bxyVysKq5CuW/fBXfJGLnAQx6twCfaz3d
Co5vPgCqir/evs8YT5npMII=
=s7oA
-----END PGP SIGNATURE-----

--2iBwrppp/7QCDedR--