Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KNvix-0007Nz-Hl for qemu-devel@nongnu.org; Tue, 29 Jul 2008 16:23:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KNviw-0007My-BG for qemu-devel@nongnu.org; Tue, 29 Jul 2008 16:23:11 -0400 Received: from [199.232.76.173] (port=40864 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KNviw-0007Mf-0w for qemu-devel@nongnu.org; Tue, 29 Jul 2008 16:23:10 -0400 Received: from fe02x03-cgp.akado.ru ([77.232.31.165]:50260 helo=akado.ru) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KNviv-0003UM-93 for qemu-devel@nongnu.org; Tue, 29 Jul 2008 16:23:09 -0400 Received: from av1474.oops ([10.0.66.9] verified) by fe02-cgp.akado.ru (CommuniGate Pro SMTP 5.1.16) with ESMTPS id 18406569 for qemu-devel@nongnu.org; Wed, 30 Jul 2008 00:22:57 +0400 Date: Wed, 30 Jul 2008 00:23:01 +0400 (MSD) From: malc Subject: Re: [Qemu-devel] Mac OS X PPC host support (was: [4932] Preliminary PPC64/Linux host support) In-Reply-To: <9ABED4D6-5AFB-44D4-A1F6-A86B5E139543@web.de> Message-ID: References: <0D03767C-CA27-40D9-B390-04F6BECC9603@web.de> <9ABED4D6-5AFB-44D4-A1F6-A86B5E139543@web.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Tue, 29 Jul 2008, Andreas F?rber wrote: > > Am 27.07.2008 um 20:14 schrieb malc: > >> On Sat, 26 Jul 2008, Andreas F?rber wrote: >> >>> >>> Am 26.07.2008 um 20:54 schrieb malc: >>> >>>>> there are currently numbers hardcoded for Linux. >>>> It's not just about numbers, last time i looked (cursory) the ABIs where >>>> a lot different (PPC32 case) just changing the numbers wont get one very >>>> far i think. >>> >>> Of course not only, but it's one step that could be applied. The stack >>> alignment is 16 Bytes for both, and the prolog in my ppc(32) branch seems >>> to match the referenced Apple pseudocode now. >>> >>> Where else do you have differences in mind? Which additional functions may >>> need to be adjusted? >> >> I'd have to check Darwins ABI to be sure, but here's the short list: > > http://developer.apple.com/documentation/DeveloperTools/Conceptual/LowLevelABI/Articles/32bitPowerPC.html > >> a. Alignement of 64 bit arguments (in the register file) >> (This was the thing that confused Sparcs ASI helpers when i first >> tried to boot Sparc on, then new, PPC32 tcg) > > What register file? Please be more detailed, I'm not intimate with TCG. I meant this http://en.wikipedia.org/wiki/Register_file But anyhow it is not aligned hence the ASI failure You saw earlier. >> b. List of reserved registers > > According to the Apple ppc ABI document, r2 is not system-reserved compared > to SVR4 ppc ABI. The other general-purpose registers look similar (assuming > we don't have nested functions), although Apple seems to have less strict > prescriptions what to store where. > >> c. The approach to TOC (or however Apple calls the substitute) > > Not sure what you mean. Pointers to concrete files and functions might help. I have checked and MacOS X on PPC32 doesn't use those. > >> In any case, PPC32 + MacOS X i can help with. PPC64 + MacOS X not so much. > > Restoring Mac OS X ppc(32) to work again would be just great. > PPC64 didn't work pre-TCG. We'll probably know where to poke ourselves once > ppc is running. I have made a stab at making it work and tried it on MacOS X (Tiger) that i have here, for Sparc it progress a bit further but still meets it's doom shortly: qemu: fatal: Trap 0x29 while interrupts disabled, Error state pc: ffd04020 npc: ffd04024 General Registers: %g0: 00000000 %g1: 00000000 %g2: ffd908e0 %g3: ffd00000 %g4: ffd83038 %g5: 00000001 %g6: 00000000 %g7: 00000000 Current Register Window: %o0: 00000000 %o1: 00000000 %o2: 00000000 %o3: 00000000 %o4: 00000000 %o5: 00000000 %o6: ffdd3fa0 %o7: 00000000 %l0: 00000000 %l1: 00000000 %l2: 00000000 %l3: 00000000 %l4: 00000000 %l5: 00000000 %l6: 00000000 %l7: 00000000 %i0: 00000000 %i1: 00000000 %i2: 00000000 %i3: 00000000 %i4: 00000000 %i5: 00000000 %i6: 00000000 %i7: 00000000 Floating Point Registers: [all bit zero FPRs snipped] psr: 0x04001fc0 -> ---- SP- wim: 0x00000001 fsr: 0x00080000 BlueSwirl, rings any bells? I tried my best to hack it while in Mac OSX, but, honestly, i can not stand that system and have no spare (quiet enough) machine to SSH into it and do things remotely, sorry. The code is available at: http://repo.or.cz/w/qemu/malc.git?a=shortlog;h=refs/heads/tcgppc32macosx -- mailto:av1474@comtv.ru