sebastianbiallas / pearpc

PearPC - PowerPC Architecture Emulator
GNU General Public License v2.0
389 stars 70 forks source link

Trouble booting OSX 10.2 on x86_64 #10

Open stuaxo opened 9 years ago

stuaxo commented 9 years ago

When I try and run this, booting stops with the apple displayed, but with before the spinner appears.

I've got a version of ppc4, which can boot this, in wine using ppc ppc4.config - this might not be helpful, as I think the ppc4 version is 32 bit and my build should be 64 bit

ppc - git getting stuck during boot ...

ppc ppc4.config 
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as published by
the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA

&gMemory: 0x7fcc111c1000
GenuineIntel
translation cache: 40153000
[CPU/MMU] new pagetable: sdr1 = 0x00300003
[CPU/MMU] new pagetable: sdr1 accepted
[CPU/MMU] number of pages: 2^15 pagetable_start: 0x00300000 size: 2^18
start: 512
start: 32768
getStartBlock: 0 Apple_Free
getStartBlock: 1 Apple_Free
getStartBlock: 2 Apple_Free
getStartBlock: 3 Apple_Free
start: 134250496
getStartBlock: 0 Apple_HFS
getStartBlock: 1 Apple_HFS
getStartBlock: 2 Apple_HFS
getStartBlock: 3 Apple_HFS
start: 2147450880
getStartBlock: 0 Apple_Free
getStartBlock: 1 Apple_Free
getStartBlock: 2 Apple_Free
getStartBlock: 3 Apple_Free
getStartBlock: 0 Apple_HFS
getStartBlock: 1 Apple_HFS
getStartBlock: 2 Apple_HFS
getStartBlock: 3 Apple_HFS
Loading XCOFF...
[CPU/CPU] execution started at 01c00cb0
*** &gCPU: ba8150, &gJITC: ba8c00
sizeof cpu: 2720

ppc4 in wine, completing boot ...

wine ppc4.exe ppc4.config 
fixme:service:scmdatabase_autostart_services Auto-start service L"F06DEFF2-5B9C-490D-910F-35D3A9119622" failed to start: 3
wine: Unhandled page fault on read access to 0xfffff78000000320 at address 0x44a03c (thread 0027), starting debugger...
fixme:service:scmdatabase_autostart_services Auto-start service L"SmdmFService" failed to start: 2
fixme:service:scmdatabase_autostart_services Auto-start service L"UMWdf" failed to start: 2
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as published by
the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA

GenuineIntel
 CMOV MMX SSE SSE2 SSE3
[CPU/MMU] new pagetable: sdr1 = 0x00300003
[CPU/MMU] new pagetable: sdr1 accepted
[CPU/MMU] number of pages: 2^15 pagetable_start: 0x00300000 size: 2^18
start: 512
start: 32768
getStartBlock: 0 Apple_Free
getStartBlock: 1 Apple_Free
getStartBlock: 2 Apple_Free
getStartBlock: 3 Apple_Free
start: 134250496
getStartBlock: 0 Apple_HFS
getStartBlock: 1 Apple_HFS
getStartBlock: 2 Apple_HFS
getStartBlock: 3 Apple_HFS
start: 2147450880
getStartBlock: 0 Apple_Free
getStartBlock: 1 Apple_Free
getStartBlock: 2 Apple_Free
getStartBlock: 3 Apple_Free
getStartBlock: 0 Apple_HFS
getStartBlock: 1 Apple_HFS
getStartBlock: 2 Apple_HFS
getStartBlock: 3 Apple_HFS
[CPU/CPU] execution started at 01c00cb0
[CPU/MMU] new pagetable: sdr1 = 0x0080000f
[CPU/MMU] new pagetable: sdr1 accepted
[CPU/MMU] number of pages: 2^17 pagetable_start: 0x00800000 size: 2^20
iDevPro commented 8 years ago

me too,

pci_ide0_master_installed = 1
pci_ide0_master_image = "osx.img"
#pci_ide0_master_type = "hd"

pci_ide0_slave_installed = 1
#pci_ide0_slave_image = "e:\"
#pci_ide0_slave_image = "2,0,0"
pci_ide0_slave_image = "darwinppc-801.cdr"
pci_ide0_slave_type = "cdrom"

return:

&gMemory: 0x10d81b000
GenuineIntel
translation cache: 11581e000
[CPU/MMU] new pagetable: sdr1 = 0x00300003
[CPU/MMU] new pagetable: sdr1 accepted
[CPU/MMU] number of pages: 2^15 pagetable_start: 0x00300000 size: 2^18
start: 512
start: 32768
getStartBlock: 0 Apple_HFS
getStartBlock: 1 Apple_HFS
getStartBlock: 2 Apple_HFS
start: 681566208
getStartBlock: 0 Apple_Free
getStartBlock: 1 Apple_Free
getStartBlock: 2 Apple_Free
getStartBlock: 0 Apple_HFS
getStartBlock: 1 Apple_HFS
getStartBlock: 2 Apple_HFS
Loading XCOFF...
[CPU/CPU] execution started at 05600da4
*** &gCPU: 7ff3b900a400, &gJITC: 7ff3b900ec00
sizeof cpu: 2720
claunia commented 8 years ago

@stuaxo, @iDevPro have you tried without JIT?

iDevPro commented 8 years ago

./configure --enable-cpu generic

configure: WARNING: you should use --build, --host, --target
checking build system type... Invalid configuration generic: machine 'generic' not recognized
configure: error: /bin/sh ./config.sub generic failed

default config show this:

cpu emulation method:                cpu_jitc_x86_64
compiled for architecture:           x86_64
compiled for OS-API:                 posix
compiled for UI system:              cocoa
enable debug:                        yes
enable profiling:                    no
make release build:                  yes
omit frame pointer:                  yes
final C compiler flags:               -Wundef -Wall -fsigned-char -O3 -fomit-frame-pointer -g -fno-inline -mdynamic-no-pic -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pipe
final C++ compiler flags:             -Wundef -Wall -Woverloaded-virtual -std=c++11 -fsigned-char -O3 -fomit-frame-pointer -g -fno-inline -mdynamic-no-pic -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pipe
final linker flags:                  -framework Cocoa
final linker add:      
stuaxo commented 8 years ago

It actually seems to be booting for me using

./configure --enable-cpu=generic

(Note the = - the instructions above seemed to miss it)

I'm currently booting it on generic, it's slow but seems to work, I'll retest the behaviour under jit to see if it's the same when it finished).

stuaxo commented 8 years ago

Update: booting on generic succeeded. Under a JIT build it seemed to fail (was stuck on apple logo forever).

iDevPro commented 8 years ago

boot

stuaxo commented 8 years ago

Looks about the same, even though we are on different host OS's - You OSX and I Ubuntu 15.10 64 bit, hopefully, this is useful info.

screenshot from 2016-02-24 15-21-17

iDevPro commented 8 years ago

But after 10 minutes it can't load :(

stuaxo commented 8 years ago

Try

bash ./configure --enable-cpu=generic ^ notice the = sign.

make

Then running

iDevPro commented 8 years ago

Already, this is generic :(

iDevPro commented 8 years ago

bash ./configure --enable-cpu=generic

================================================================================
                             Configuration summary
================================================================================

cpu emulation method:                cpu_generic
compiled for architecture:           x86_64
compiled for OS-API:                 posix
compiled for UI system:              cocoa
enable debug:                        yes
enable profiling:                    no
make release build:                  yes
omit frame pointer:                  yes
final C compiler flags:               -Wundef -Wall -fsigned-char -O3 -fomit-frame-pointer -g -fno-inline -mdynamic-no-pic -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pipe
final C++ compiler flags:             -Wundef -Wall -Woverloaded-virtual -std=c++11 -fsigned-char -O3 -fomit-frame-pointer -g -fno-inline -mdynamic-no-pic -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -pipe
final linker flags:                  -framework Cocoa
final linker add:                    

================================================================================
iDevPro commented 8 years ago

What record want delete ?

stuaxo commented 8 years ago

I've got know idea what that is. - After configure, can you run make and try and run it again ?

iDevPro commented 8 years ago

Yeah, sorry but app want delete some record, and stall here :(

iDevPro commented 8 years ago
2016-02-24 21 57 55
stuaxo commented 8 years ago

I'll see if I can get access to a Mac and work out what that means.

iDevPro commented 8 years ago
2016-02-24 23 54 44 2016-02-24 23 58 22

LDFLAGS=-L/usr/local/opt/bison/lib ./configure --with-x --enable-ui=x11 --enable-cpu=generic

Only GENERIC, Only X11 @ MacOSX 10.11

sebastianbiallas commented 8 years ago

Sorry, on MacOSX you currently cannot use the cocoa interface (I wanted to implement this but did not had time). --enable-ui=x11 uses x11 and works.

Similarly, there are still issues with the JIT there.

stuaxo commented 8 years ago

I'm curious if the JIT works anywhere, and where ?

Maybe we can work out if it's a 32 vs 64 bit thing, or maybe it only works under MSVC, that sort of thing ?

mominul commented 8 years ago

JIT works in Windows and Linux

iDevPro commented 8 years ago

How build for jit on OS X ?)

iDevPro commented 8 years ago

What is this ?)

void openDisplay()
{
    NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
    [NSApplication sharedApplication];

    NSRect frame = NSMakeRect(100, 100, 300, 500);
    NSWindow* window  = 
    [
        [
            [NSWindow alloc] initWithContentRect:frame
            styleMask:NSResizableWindowMask
            // NSBorderlessWindowMask
            backing:NSBackingStoreBuffered
            defer:NO
        ]
        autorelease
    ];
    [window setBackgroundColor:[NSColor blueColor]];
    [window makeKeyAndOrderFront:NSApp];

    NSAlert *alert = [[NSAlert alloc] init];

    [alert addButtonWithTitle:@"OK"];
    [alert addButtonWithTitle:@"Cancel"];
    [alert setMessageText:@"Delete the record?"];
    [alert setInformativeText:@"Deleted records cannot be restored."];
    [alert setAlertStyle:NSWarningAlertStyle];
    if ([alert runModal] == NSAlertFirstButtonReturn) {
    }
    [alert release];
    [pool release];
    //return 0;
}
stuaxo commented 8 years ago

I tried searching all the code in the masterbranch and can't find openDisplay() - or the rest of the code ?

Which file did you find that code inside ?

It looks like some of the example code from here:

https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Sheets/Tasks/UsingAlertSheets.html

iDevPro commented 8 years ago

look here ;) /src/system/ui/cocoa/display.m

stuaxo commented 8 years ago

Ahhh - I get it now; this is on the cocoa branch, not master :)

My guess is that @sebastianbiallas left that dialog in as some debug code by accident. I'm not sure how far along the cocoa gui is, it might be worth running the X11 version instead ?

jacobmischka commented 8 years ago

JIT did not work for me on Linux, it failed in the same place as @stuaxo

stuaxo commented 7 years ago

I had another go today.

In wine it works if I'm in 32 bit, otherwise seems to get stuck on the boot screen.

I wasn't able to make a build with or without JIT that got past that screen.

Here is the output.

ppc ppc4.config 
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as published by
the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA

[CPU/CPU] <Warning> You are using the generic CPU!
[CPU/CPU] <Warning> This is much slower than the just-in-time compiler and
[CPU/CPU] <Warning> should only be used for debugging purposes or if there's
[CPU/CPU] <Warning> no just-in-time compiler for your platform.
[CPU/MMU] new pagetable: sdr1 = 0x00300003
[CPU/MMU] new pagetable: sdr1 accepted
[CPU/MMU] number of pages: 2^15 pagetable_start: 0x00300000 size: 2^18
start: 512
start: 32768
getStartBlock: 0 Apple_Free
getStartBlock: 1 Apple_Free
getStartBlock: 2 Apple_Free
getStartBlock: 3 Apple_Free
start: 134250496
getStartBlock: 0 Apple_HFS
getStartBlock: 1 Apple_HFS
getStartBlock: 2 Apple_HFS
getStartBlock: 3 Apple_HFS
start: 2147450880
getStartBlock: 0 Apple_Free
getStartBlock: 1 Apple_Free
getStartBlock: 2 Apple_Free
getStartBlock: 3 Apple_Free
getStartBlock: 0 Apple_HFS
getStartBlock: 1 Apple_HFS
getStartBlock: 2 Apple_HFS
getStartBlock: 3 Apple_HFS
Loading XCOFF...
[CPU/CPU] execution started at 01c00cb0
[CPU/OPC] <Warning> read from spr 25:31 (L2CR) not supported! (from 00083290)
[CPU/MMU] new pagetable: sdr1 = 0x0080000fr: 00086ac4
[CPU/MMU] new pagetable: sdr1 accepted
[CPU/MMU] number of pages: 2^17 pagetable_start: 0x00800000 size: 2^20
[CPU/OPC] <Warning> read from spr 25:31 (L2CR) not supported! (from 0ab0d4cc)
^C033ab84 (1914699776 ops) pdec: 0000d5d8 lr: 0033a710
stuaxo commented 7 years ago

Oops, obviously hadn't left it running long enough - generic seems fine.