[haiku-development] Re: PPC sync / isync cleanup PATCH and adding missing kernel calls.

  • From: Alexander von Gluck <kallisti5@xxxxxxxxxxx>
  • To: <haiku-development@xxxxxxxxxxxxx>
  • Date: Tue, 06 Oct 2009 21:04:36 -0500

On Tue, 06 Oct 2009 23:04:55 +0200, Eric Petit <eric@xxxxxxxxxx> wrote:
> On 7/30/09 12:37 AM, Alexander von Gluck wrote:
>> On Sat, 25 Jul 2009 11:01:53 -0500, Alexander von Gluck
>>> Attached is a patch that covers the following PPC items:
>>> * relocated those previous isync / sync patches to make them
>>> better utilized.  Since we ALWAYS have to isync or sync near mtsrin
>>> (and family) calls, why leave it up to the function caller to do
>>> so?
> 
> Reviving an old thread - although the isync fix has been checked in, I 
> still see the boot code hanging in ppc_set_segment_register with the 
> current revision r33471 (I added printf's before/after it, see below). 
> That's with qemu 0.10.6. Do you have any idea how to fix/workaround it, 
> or is there some way I can help tracking down this problem?
> 
> Eric
> 
> % qemu-system-ppc -cdrom haiku-boot-cd-ppc.iso -boot d -nographic
> 
>  >> =============================================================
>  >> OpenBIOS 1.0 [Mar 1 2009 19:06]
>  >> Configuration device id QEMU version 1 machine id 2
>  >> CPUs: 1
>  >> Memory: 128M
>  >> UUID: 00000000-0000-0000-0000-000000000000
>  >> CPU type PowerPC,750
> Welcome to OpenBIOS v1.0 built on Mar 1 2009 19:06
> 
> 
> checking for memory...
> 0: base = 0x00000000, size = 134217728
> 1: empty region
> total physical memory = 128 MB
> suggested page table size = 1048576
> need new page table, size = 1048576!
> new table at: 0x07d00000
> MSR: 0x00003030
> found 4 translations
> found page table!
> no mapping for the exception handlers!
> calling ppc_set_segment_register (0)...
> 
> [there QEMU hangs forever, using 100% CPU]

Funny... I was just looking at this yesterday :). The fix mentioned got
the PPC port working on real hardware alot further along (bootmenu now
works fine, we can load the kernel and modules into memory on G3 and G4
systems but lock up attempting to jump into the kernel). qemu-system-ppc
still does not boot as expected and you can't even get the bootmenu up.

Something somewhere is really fishy, between being unable to jump into the
kernel on real hardware... and being unable to get into the menu on
emulated hardware.  I think it has something to do with the mmu code in the
boot loader and how we lay out the page table on powerpc.  Maybe the early
boot issue is the real problem... and the real hardware will run a little
further just because it is less susceptible to bugs?

I've put my eyeballs on this for quite some time but can't fish out the
issue.  (my powerpc assembly is novice at best, that previous patch was
from lots of research of the assembly code that was locking up) If anyone
has any PowerPC assembly experience and access to hardware or
qemu-system-ppc, please take a look at things to try and figure out what is
going on.  The PPC PCI drivers are incomplete, but until Haiku can at least
load the kernel into memory on qemu/real hardware, little progress will be
made on the PPC front.

FYI to Eric, if you play with the range of the for statement on line 994
in src/system/boot/platform/openfirmware/arch/ppc/mmu.cpp and change it
(incorrectly) to ' for (int32 i = 1; i < 8; i++) { ' the boot loader will
get a little further and give a "failed to find cpu" message.

Thanks!
  --Alex
http://haikufire.com

Other related posts: