qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] [PATCH] mac99: Bring memory layout closer to real hardwar


From: BALATON Zoltan
Subject: Re: [Qemu-ppc] [PATCH] mac99: Bring memory layout closer to real hardware
Date: Mon, 14 Apr 2014 11:36:58 +0200 (CEST)
User-agent: Alpine 2.02 (LMD 1266 2009-07-14)

On Mon, 14 Apr 2014, Alexander Graf wrote:
On 12.04.14 11:59, BALATON Zoltan wrote:
keeping a machine called mac99 that does not match any real Mac. I'll send my current patch with minimal changes to make the memory layout better match what's seen on PowerMac3,1.

I can't apply that without changing OpenBIOS as well. And OpenBIOS doesn't get the memory layout from the machine, it only gets an identifier that says "I'm machine numer X, use me".

So we would have to add a new machine type in fw_cfg for this machine, as otherwise we would render newer OpenBIOS incompatible with older QEMU at which point we can as well just call the whole thing a new machine.

Since OpenBIOS is included with QEMU I don't know if we should really worry about compatibility with different versions other than what's included but the last patch I've sent does not even change anything which requires changing OpenBIOS so it should be safe to apply. (The patches I've sent to the OpenBIOS mailing list are independent and fix the device tree not related to the changes in QEMU. OpenBIOS assigns addresses based on the order of devices so changing this makes addresses change too without needing to change OpenBIOS itself.)

2. Eventually MorphOS runs into this invalid instruction and crashes:

IN:
0x0041cbcc:  lwzx    r7,r2,r9
0x0041cbd0:  lwz     r8,24(r5)
0x0041cbd4:  cmpw    r7,r8
0x0041cbd8:  beqlr

invalid bits: 00000001 for opcode: 1f - 17 - 04 (7d02492f) 0041cbdc
IN:
0x0041cbdc:  .long 0x7d02492f

It's stwx with the lowest bit set:

  4:    7d 02 49 2e     stwx    r8,r2,r9

which usually would be the Rc bit in this form of instruction encoding. You could try to issue an instruction like this on a machine with the same CPU as the one you're trying to emulate and see if the CPU happens to ignore Rc (or maybe even sets CR!)

I don't have access to a machine with a G4 CPU (or any PPC at the moment). Is there anyone who could help testing this?

Regards,
BALATON Zoltan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]