Subject: Re: [PATCH] Fixup for Amigas with memory at 0x200000
To: None <port-amiga@netbsd.org>
From: Ignatios Souvatzis <is@netbsd.org>
List: port-amiga
Date: 01/10/2003 21:47:14
--OgqxwSJOaUobr8KG
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Hi,
On Fri, Jan 10, 2003 at 09:58:05PM +0200, Ilpo Ruotsalainen wrote:
> On Fri Jan 10 2003 at 21:38:59 +0200, Ilpo Ruotsalainen wrote:
> > On Fri Jan 10 2003 at 21:35:53 +0200, Ilpo Ruotsalainen wrote:
> > > After some debugging I've managed to narrow it down to this:
> > >=20
> > > LMMUenable_start:
> > >=20
> > > /* enable the MMU */
> > > #if defined(M68040) || defined(M68060)
> > > RELOC(mmutype, %a0)
> > > cmpl #MMU_68040,%a0@
> > > jne Lenable030
> > > movl #0xdff180,%a0
> > > movw #0xa00,%a0@
> > > pflusha
> > > movl #0xdff180,%a0
> > > movw #0x00a,%a0@
> > > movl #0xc000,%d0
> > > .word 0x4e7b, 0x0003 | movec %d0,%tc
> > > jmp Lunshadow:l
> > > #endif /* M68040 || M68060 */
> > > /* ENABLE, SRP_ENABLE, 8K pages, 8bit A-level, 11bit B-level */
> > > Ltc: .long 0x82d08b00
> > > Lenable030:
> > > movl #0xdff180,%a0
> > > movw #0x0a0,%a0@
> > > lea Ltc,%a0
> > > pmove %a0@,%tc
> > > jmp Lunshadow:l
> > >=20
> > > LMMUenable_end:
> > >=20
> > > With the code looking like this, I end up with RED screen. Which seems
> > > to say it dies on the "pflusha" instruction (unless that instruction
> > > changes MMU mappings or such? I'd think it's the movec that changes t=
hem
> > > but I don't know really almost anything about 68k MMUs...).
> >=20
> > Hmpf, sent this a few minutes too early. Next iteration with the
> > "pflusha" instruction removed produced a kernel that booted
> > successfully. So that seems to be the guilty one, I'm not m68k guru
> > enough to instantly know why it would die on that...
>=20
> (I seem to have a bad habit of replying to myself a lot :P)
>=20
> The problem is that locore.s is compiled as 030 code. 030 and 040/060
> have different opcodes for pflusha, so the wrong 030 opcode is emitted
> which causes 060 to crash and burn. Replacing the pflusha with .word
> 0xf518 (which is the 040 version of pflusha) generated a booting kernel.
So, Aymeric: if you replace the pflusha in the 040/60 section with=20
=2Eword 0xf518, or use the slightly reordered patch I'll send to you=20
in a few minutes, you may commit this IMO (and request pullup).
(That is: the DraCo version works, too, with this change.).
Regards,
Ignatios
--=20
seal your e-mail: http://www.gnupg.org/
--OgqxwSJOaUobr8KG
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (NetBSD)
iD8DBQE+HzFRPCRcZ/VMtk4RAjmKAJ9h33Z3zoit+shJZgl13kb0FXu0/gCbBTlg
FQChSEPAF1J46OTAL10Oi/M=
=Ji9s
-----END PGP SIGNATURE-----
--OgqxwSJOaUobr8KG--