GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

About QEMU, a PPC Mac emulator for Windows, macOS and Linux that can run Mac OS 9.0 up to Mac OS X 10.5

Moderators: Cat_7, Ronald P. Regensburg

alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

Looks like you're right.With addr=0x05800000(as well as any other) and without cpu-num=0 it boots into openbios,with cpu-num=0 --black screen with no messages...Can't be quick enough to hold Apple-option-o-f on start :smile:
Programmingkid
Apple Corer
Posts: 243
Joined: Sun Jan 31, 2016 6:01 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Programmingkid »

alex195812 wrote:Looks like you're right.With addr=0x05800000(as well as any other) and without cpu-num=0 it boots into openbios,with cpu-num=0 --black screen with no messages...Can't be quick enough to hold Apple-option-o-f on start :smile:
If you want to go straight into OpenBIOS at startup, just add this to your command-line: -prom-env auto-boot?=false.

Could you provide your complete command-line for testing the Apple ROM file?
User avatar
adespoton
Forum All-Star
Posts: 3099
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by adespoton »

Seems to me the first step is to take a new world ROM as loaded in Mac OS 9.1 and step through how it loads ant what interfaces are in place that it references. With that, we'll know what needs to be exposed to the Old World ROM. Booting both in SheepShaver with debug for comparison *may* provide some extra clues.
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

My command line is:

Code: Select all

/usr/local/qemu/2.8.0-rc2/debug/bin/qemu-system-ppc -M g3beige -m 512 -device loader,file=/Volumes/SnowLeo/Applications/SheepShaver_UB_20140201/mac_oldworld_rom4mb.rom,addr=0x05800000,cpu-num=0 -cdrom /Volumes/DATA1600/ISO/Unix/MacOS/Mac\ OS\ 9.toast  -boot d
LLDB output is:

Code: Select all

Process 22340 launched: '/usr/local/qemu/2.8.0-rc2/debug/bin/qemu-system-ppc' (x86_64)
Process 22340 stopped
* thread #1: tid = 0x3275b, 0x00007fff8cba672a libsystem_kernel.dylib`__sigsuspend + 10, queue = 'com.apple.main-thread', stop reason = signal SIGUSR2
    frame #0: 0x00007fff8cba672a libsystem_kernel.dylib`__sigsuspend + 10
libsystem_kernel.dylib`__sigsuspend + 10:
-> 0x7fff8cba672a:  jae    0x7fff8cba6734            ; __sigsuspend + 20
   0x7fff8cba672c:  movq   %rax, %rdi
   0x7fff8cba672f:  jmp    0x7fff8cba1c78            ; cerror
   0x7fff8cba6734:  retq   
GDB output:

Code: Select all

Starting program: /Volumes/disk0s3/Developer/qemu/2.8.0-rc2/debug/bin/qemu-system-ppc -M g3beige -m 512 -device loader,file=/Volumes/SnowLeo/Applications/SheepShaver_UB_20140201/mac_oldworld_rom4mb.rom,addr=0x05800000,cpu-num=0 -cdrom /Volumes/DATA1600/ISO/Unix/MacOS/Mac\ OS\ 9.toast  -boot d
warning: `/BinaryCache/coreTLS/coreTLS-35.40.1~1/Objects/coretls.build/coretls.build/Objects-normal/x86_64/system_coretls_vers.o': can't open to read symbols: No such file or directory.
warning: Could not open OSO archive file "/BinaryCache/coreTLS/coreTLS-35.40.1~1/Symbols/BuiltProducts/libcoretls_ciphersuites.a"
warning: Could not open OSO archive file "/BinaryCache/coreTLS/coreTLS-35.40.1~1/Symbols/BuiltProducts/libcoretls_handshake.a"
warning: Could not open OSO archive file "/BinaryCache/coreTLS/coreTLS-35.40.1~1/Symbols/BuiltProducts/libcoretls_record.a"
warning: Could not open OSO archive file "/BinaryCache/coreTLS/coreTLS-35.40.1~1/Symbols/BuiltProducts/libcoretls_stream_parser.a"
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/bdz.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/bdz_ph.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/bmz.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/bmz8.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/brz.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/buffer_entry.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/buffer_manager.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/chd.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/chd_ph.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/chm.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/cmph.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/cmph_structs.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/compressed_rank.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/compressed_seq.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/fch.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/fch_buckets.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/graph.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/hash.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/jenkins_hash.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/linear_string_map.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/miller_rabin.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/select.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/vqueue.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/cmph/cmph-1~1091/Objects/cmph.build/cmph.build/Objects-normal/x86_64/vstack.o': can't open to read symbols: No such file or directory.
[New Thread 0x111b of process 1374]
[New Thread 0x1203 of process 1374]
[New Thread 0x1303 of process 1374]
[New Thread 0x1403 of process 1374]
[New Thread 0x1503 of process 1374]
[New Thread 0x1603 of process 1374]
warning: `/BinaryCache/CoreServicesInternal/CoreServicesInternal-221.7.2~1/Objects/CoreServicesInternal.build/CoreServicesInternal.build/Objects-normal/x86_64/BookmarkCommon.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/CoreServicesInternal/CoreServicesInternal-221.7.2~1/Objects/CoreServicesInternal.build/CoreServicesInternal.build/Objects-normal/x86_64/BookmarkData.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/CoreServicesInternal/CoreServicesInternal-221.7.2~1/Objects/CoreServicesInternal.build/CoreServicesInternal.build/Objects-normal/x86_64/CFURLAliasInteroperability.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/CoreServicesInternal/CoreServicesInternal-221.7.2~1/Objects/CoreServicesInternal.build/CoreServicesInternal.build/Objects-normal/x86_64/CFURLBookmark.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/CoreServicesInternal/CoreServicesInternal-221.7.2~1/Objects/CoreServicesInternal.build/CoreServicesInternal.build/Objects-normal/x86_64/CFURLBookmarkFile.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/CoreServicesInternal/CoreServicesInternal-221.7.2~1/Objects/CoreServicesInternal.build/CoreServicesInternal.build/Objects-normal/x86_64/CFURLBookmarkProperties.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/CoreServicesInternal/CoreServicesInternal-221.7.2~1/Objects/CoreServicesInternal.build/CoreServicesInternal.build/Objects-normal/x86_64/CFURLBookmarkResolution.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/CoreServicesInternal/CoreServicesInternal-221.7.2~1/Objects/CoreServicesInternal.build/CoreServicesInternal.build/Objects-normal/x86_64/CoreServicesInternal_vers.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/CoreServicesInternal/CoreServicesInternal-221.7.2~1/Objects/CoreServicesInternal.build/CoreServicesInternal.build/Objects-normal/x86_64/ExternalProvider.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/CoreServicesInternal/CoreServicesInternal-221.7.2~1/Objects/CoreServicesInternal.build/CoreServicesInternal.build/Objects-normal/x86_64/FileURL.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/CoreServicesInternal/CoreServicesInternal-221.7.2~1/Objects/CoreServicesInternal.build/CoreServicesInternal.build/Objects-normal/x86_64/FileURLEnumerator.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/CoreServicesInternal/CoreServicesInternal-221.7.2~1/Objects/CoreServicesInternal.build/CoreServicesInternal.build/Objects-normal/x86_64/FileURLReplaceObject.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/CoreServicesInternal/CoreServicesInternal-221.7.2~1/Objects/CoreServicesInternal.build/CoreServicesInternal.build/Objects-normal/x86_64/PlatformUtils.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/CoreServicesInternal/CoreServicesInternal-221.7.2~1/Objects/CoreServicesInternal.build/CoreServicesInternal.build/Objects-normal/x86_64/ScopedBookmarksClient.o': can't open to read symbols: No such file or directory.
warning: `/BinaryCache/CoreServicesInternal/CoreServicesInternal-221.7.2~1/Objects/CoreServicesInternal.build/CoreServicesInternal.build/Objects-normal/x86_64/ftsattr.o': can't open to read symbols: No such file or directory.
[New Thread 0x170b of process 1374]
[New Thread 0x1823 of process 1374]

Thread 1 received signal SIGUSR2, User defined signal 2.
0x00007fff86ded72a in __sigsuspend () from /usr/lib/system/libsystem_kernel.dylib
Have no idea what on earth it means :smile:
Without assigning -cdrom there's no sigsuspend reporting,but no moving.All similar for mac99,NWorld and MacOS922 image.
-prom-env "auto-boot?=false" changes nothing-still black qemu window.
As for Mac ROM,I think SShaver and BasiliskII know much about it,as well as the initial developer of SS and BII.Could he share his knolege(if he's still alive)?Also much could tell the ROMPatcher from SS (and BII).To someone smarter than me :smile:
Programmingkid
Apple Corer
Posts: 243
Joined: Sun Jan 31, 2016 6:01 pm

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Programmingkid »

alex195812 wrote: Thread 1 received signal SIGUSR2, User defined signal 2.
0x00007fff86ded72a in __sigsuspend () from /usr/lib/system/libsystem_kernel.dylib[/code]

Have no idea what on earth it means :smile:
Without assigning -cdrom there's no sigsuspend reporting,but no moving.All similar for mac99,NWorld and MacOS922 image.
-prom-env "auto-boot?=false" changes nothing-still black qemu window.
As for Mac ROM,I think SShaver and BasiliskII know much about it,as well as the initial developer of SS and BII.Could he share his knolege(if he's still alive)?Also much could tell the ROMPatcher from SS (and BII).To someone smarter than me :smile:
The SIGUSR1 and SIGUSR2 stuff is just a signal you can ignore using this command in gdb:
handle SIGUSR1 SIGUSR2 noprint nostop

You could also just type 'c' for continue when you hit these signals.

I think we need to find out where it is stopping. Maybe you could try the backtrace command (bt) in gdb?

https://github.com/cebix/macemu/blob/ma ... atches.cpp
This is the source code that SheepShaver uses to make Apple's ROM work. It does a lot of stuff with registers. Just look at the patch_nanokernel_boot() function.

The author does a good job of commenting what the code in the file does. It just looks a little intimidating.
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

After continuing:

Code: Select all

(gdb) c
Continuing.
[New Thread 0x1047 of process 1212]
[New Thread 0x1b03 of process 1212]
[New Thread 0x1c03 of process 1212]
[New Thread 0x1d03 of process 1212]
[New Thread 0x1e03 of process 1212]
Error while mapping shared library sections:
cl_kernels: No such file or directory.
[New Thread 0x181f of process 1212]
Error while mapping shared library sections:
cl_kernels: No such file or directory.
Now will try bt.

Code: Select all

(gdb) bt
#0  0x00007fff91d9672a in __sigsuspend () from /usr/lib/system/libsystem_kernel.dylib
#1  0x000000010065f8ed in qemu_coroutine_new () at util/coroutine-sigaltstack.c:211
#2  0x000000010065d761 in qemu_coroutine_create (
    entry=0x1005a7180 <bdrv_rw_co_entry>, opaque=0x7fff5fbfd928)
    at util/qemu-coroutine.c:75
#3  0x000000010059f6b3 in bdrv_prwv_co (child=0x103c67da0, offset=0, 
    qiov=0x7fff5fbfd9e8, is_write=false, flags=0) at block/io.c:622
#4  0x000000010059fb1d in bdrv_preadv (child=0x103c67da0, offset=0, 
    qiov=0x7fff5fbfd9e8) at block/io.c:734
#5  0x000000010059fbe1 in bdrv_pread (child=0x103c67da0, offset=0, 
    buf=0x7fff5fbfda80, bytes=512) at block/io.c:755
#6  0x00000001005247f9 in find_image_format (file=0x103c67da0, 
    filename=0x103c66680 "/Volumes/DATA1600/ISO/Unix/MacOS/Mac OS 9.toast", 
    pdrv=0x7fff5fbfdd58, errp=0x7fff5fbfdd40) at block.c:605
#7  0x000000010051c6f5 in bdrv_open_inherit (
    filename=0x103c66680 "/Volumes/DATA1600/ISO/Unix/MacOS/Mac OS 9.toast", 
    reference=0x0, options=0x1040af400, flags=0, parent=0x0, child_role=0x0, 
    errp=0x7fff5fbfe148) at block.c:1804
#8  0x000000010051d01d in bdrv_open (
    filename=0x103c66680 "/Volumes/DATA1600/ISO/Unix/MacOS/Mac OS 9.toast", 
    reference=0x0, options=0x1040abe00, flags=0, errp=0x7fff5fbfe148) at block.c:1924
#9  0x0000000100588d2a in blk_new_open (
    filename=0x103c66680 "/Volumes/DATA1600/ISO/Unix/MacOS/Mac OS 9.toast", 
    reference=0x0, options=0x1040abe00, flags=0, errp=0x7fff5fbfe148)
    at block/block-backend.c:160
#10 0x000000010024c26e in blockdev_init (
    file=0x103c66680 "/Volumes/DATA1600/ISO/Unix/MacOS/Mac OS 9.toast", 
    bs_opts=0x1040abe00, errp=0x7fff5fbfe148) at blockdev.c:582
---Type <return> to continue, or q <return> to quit---
#11 0x000000010024b833 in drive_new (all_opts=0x1015763c0, block_default_type=IF_IDE)
    at blockdev.c:1080
#12 0x0000000100274e39 in drive_init_func (opaque=0x10159bf30, opts=0x1015763c0, 
    errp=0x0) at vl.c:1187
#13 0x00000001006584ab in qemu_opts_foreach (list=0x100855438, 
    func=0x100274e00 <drive_init_func>, opaque=0x10159bf30, errp=0x0)
    at util/qemu-option.c:1116
#14 0x000000010026fbaf in qemu_main (argc=11, argv=0x7fff5fbffa30, 
    envp=0x7fff5fbffa90) at vl.c:4482
#15 0x00000001004e3bc9 in -[QemuCocoaAppController startEmulationWithArgc:argv:] (
    self=0x101602420, _cmd=0x100748ab9, argc=11, argv=0x7fff5fbffa30)
    at ui/cocoa.m:949
#16 0x00000001004e39b9 in -[QemuCocoaAppController applicationDidFinishLaunching:] (
    self=0x101602420, _cmd=0x7fff91381cb7, note=0x10152e5e0) at ui/cocoa.m:901
#17 0x00007fff930c645c in __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ ()
   from /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
#18 0x00007fff92fb6634 in _CFXNotificationPost ()
   from /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
#19 0x00007fff91937aa1 in -[NSNotificationCenter postNotificationName:object:userInfo:] () from /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
#20 0x00007fff8d29ea8b in -[NSApplication _postDidFinishNotification] ()
   from /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
#21 0x00007fff8d29e7f6 in -[NSApplication _sendFinishLaunchingNotification] ()
   from /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
#22 0x00007fff8d29b946 in -[NSApplication(NSAppleEventHandling) _handleAEOpenEvent:]
    () from /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
#23 0x00007fff8d29b385 in -[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] () from /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
---Type <return> to continue, or q <return> to quit---
#24 0x00007fff9196a818 in -[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] ()
   from /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
#25 0x00007fff9196a689 in _NSAppleEventManagerGenericHandler ()
   from /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
#26 0x00007fff8ecb343c in aeDispatchAppleEvent(AEDesc const*, AEDesc*, unsigned int, unsigned char*) ()
   from /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
#27 0x00007fff8ecb31b9 in dispatchEventAndSendReply(AEDesc const*, AEDesc*) ()
   from /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
#28 0x00007fff8ecb30c3 in aeProcessAppleEvent ()
   from /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
#29 0x00007fff98c88c6e in ?? ()
   from /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
#30 0x0000000000000001 in ?? ()
#31 0x00007fff7d478aa0 in ?? ()
#32 0x0000000061657674 in ?? ()
#33 0x00007fff923dc0c0 in ?? () from /usr/lib/libobjc.A.dylib
#34 0x0000000065707063 in ?? ()
#35 0x0000000000000001 in ?? ()
#36 0x00007fff5fbff4b0 in ?? ()
#37 0x00007fff8d294da2 in _DPSNextEvent ()
   from /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
Backtrace stopped: frame did not save the PC
User avatar
Cat_7
Expert User
Posts: 5099
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Cat_7 »

Is this happening with the g3beige machine model or the Mac99 machine model?

Best,
Cat_7
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

Both of them.
I also heve tried another thing: tried to boot OS9.0 in qemu.First I initialised 2GB image in OS9.2.2 under qemu,then installed a retail OS 9.0 onto it in SheepShaver.It failed to start in qemu(No valid state found..).Then I copied Mac OS ROM from istallation cd into System Folder.Boot starts,but aborts.With another Mac OS ROM(from PowerBook 9.04 install cd) it hangs on floppy icon with ? sign(no boot drive found).With Mac OS ROM from G4Cube 9.04 cd it boots farther and stops with message "This startup disk will not work on tihis Macintosh model.Use the latest installer to update this disk for this model". Hmm...
Last edited by alex195812 on Sun Dec 04, 2016 1:31 pm, edited 3 times in total.
User avatar
Cat_7
Expert User
Posts: 5099
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by Cat_7 »

Hi,

You should now that sheepshaver installations allow 9.0 and 9.04 to run. 9.0 never ran in qemu, but 9.0.4 does (has some problems). The best cd with 9.04 for booting in qemu is the 9.0.4 cube installer.

You can install 9.04 with qemu so you can be sure the image "should" boot.

Prevent any other issues, it would be best to try and boot a 9.2.1/9.2.2 image, with 9.1 as second best,

Best,
Cat_7
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

Yes,I know that.I tried just to run 9.0 in qemu using this trick.The results depend on Mac Soft ROM(The best with G4Cube ROM) and something else...
By the way,if you open Mac OS ROMs from 9.0 or 9.0.4 cds in hex,first you see is something like :"Compatible...PowerMac3,1...MacROM for NewWorld..."
User avatar
adespoton
Forum All-Star
Posts: 3099
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by adespoton »

Does the MacROM have an xsum embedded at the end? If not, I wonder what would happen if we started messing with the header?

I don't think that 9.1+ will work with an old world ROM, will it? So testing these variations against 9.0.4 is probably our best bet to trace what's going on. Installing via qemu 1.8pre with the vga patch and no old-world ROM set should create a bootable image we can test with your command line.
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

Well,AFAIK systems >9.04 requre MMU and that's why they don't work unmodifyed in SShaver.Systems >8.5=<9.04 can work with both New or Old ROMs in SS.Probably for 9.04>it's the same--guess they won't work unmodifyed with Old ROMs(for the latter don't support MMU).
As for playing with MacROMs,the guys here: https://www.thinkclassic.org/viewtopic.php?id=46 did that(and more) for booting OS9.2.2 on unsupported newer hardware.I thought their ways could help with booting <9.04 in qemu(As qemu mac99 is New World PowerMac3,1).I tried their trick with OFirmware command line in openbios,but met a problem entering a long string in OBios : only one line can be entered.As I knew that G4Cube 9.04 distribution cd boots in qemu,I came to idea to use its Mac ROM with 9.0 installation.The other way was to modify "native" ROM like Thinkclassic guys did,but lazyness...The boot process doesn't come to desktop,though.Maybe upgrading some extensions or modifications in suitcase could help?Don't know how to do it.Or mabe disabling MMU is needed?
One more thing: https://68kmla.org/forums/index.php?/to ... world-rom/ .This guy learned something from SShaver sources and learned to reassemble MacROM.Though it doesn't work in Mac OS X(depends on docker...what is docker?Is it for Linux?)I want to investigate it all closer some time later.
As for Old World stuff,I know too little about yet,but I saw mentioning somewhere that the boot process is a)tricky for ToolBox needed after loading OpenFirmware;b)It's somwhat buggy in Apple implementation;c)It's of CHRP type.As SLOF supports CHRP booting,it came to me,could a kind of SLOF be used for Old World qemu machines?I need a deeper knolege though.By the way,judging on the big number of qemu messges like "tryihg to read invalid spr..." when starting,G3 emulation in qemu is much worse then G4 presenty.
9.0.4 installation--yes,I'm going to make it a little later.Need a break now. :smile:
I also met a strange issue trying to install MOSX10.0DP4 and MOSX Server 1.2v3.Both installation cds boot to OS9 desktop(in Server case you meet "mad" mouse behavior),but after starting the istallation you get "Fatal Error:No boot-device property in device tree".What do installers want?I tried to set "boot-device" property in openbios prompt by

Code: Select all

dev /
" cd" encode-string " boot-device" property 
with no result.What is wrong?Or must this property be hard-coded in mac99 profile?But what must it look like?
LightBulbFun
Tinkerer
Posts: 49
Joined: Mon Jul 13, 2015 11:32 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by LightBulbFun »

just some random info that may help you all. one i wanted to mention that in old world PCI macs that the Mac OS ROM is presented as a node in the Open firmware device tree (usually at the root) like so "/AAPL,ROM" with / being the root of the device tree. and you can then from OF boot from it like so "boot /AAPL,ROM" and it will load the Mac OS ROM. also the G3 beige is supported till 9.2.2 so all versions of OS9 support Old world ROMs. keep in mind if you are trying to integrate a ROM make sure it matches the hardware your emulating (if you have a G3 beige rom make sure to use it with the g3beige machine option and using a New world rom image as an old world rom image prolly wont work) also when getting a ROM dump make sure in this case its just a dump of the Mac OS ROM and not the full 4MB OpenFirmware 1MB plus 3MB Mac OS ROM image. just keep these things in mind when playing with it and i hope it can help some :)
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

I have finally come to a result with booting MOS 9.0 in qemu.After installing retail 9.0 distribution in SShaver and placing Mac OS ROM file from G4Cube9.0.4 in System Folder I had only partial succes:boot started and stopped complaining about outdated startup disk.I changed Finder to G4Cube version.Nope.Then I changed System file to G4 version."This sysem software must run from original,not copied media".Then I returned native System file and changed the version number to 9.0.4(in ResEdit).Boot crashed with qemu messages in Terminal "Trying to execute code outside RAM or ROM at 0xffcf91c8
This usually means one of the following happened:" and so on.
Next day I began installing G4Cube 9.0.4 in qemu.After succesful installation (despite of "drunken mouse") I failed to boot the installed image with the same "trying to execute...".But with option -cpu G3 it worked OK.The image also works in SheepSaver(My old SS 9.0.4 image doesn't even mount in qemu).In SS it's faster...
So I tried my previous 9.0 image with G3 and succeeded.Version number shown is 9.0.4 though.Mac OS ROM 5.2.1.sungem user network work with manually assigned IP and other stuff.
In short:Mac OS 9.0 can work in qemu with Mac OS ROM 5.2.1,version number changed to 9.0.4 and -cpu G3 option.
Other ROMs seems like cannot handle qemu hardware.
I wonder if Mac OS ROM could be edited to support OSes older than 9.0.4...Something about workaround the checksum error is here: https://www.thinkclassic.org/viewtopic.php?id=46
But Mac ROM file is almost 3,5 million lines in iHex...Brrr
And also if support for OSes newer than 9.04 could be added to rompatches in SheepShaver would it boot,say,9.1?SS boots 9.1 with version changed to 9.0.4...afaik
Or even could rompatches be made as a separate console program for ROMs manipulating?
However,SS seems not to support New ROMs higher than 1.6...
[edit]Made some changes,now version reported in 9.0 is 9.0
The same trick as with 9.0 but now with 8.6 installation brings to "Sorry,a system Error occured... bus error To temporary disable extensions..." on "Mac OS8.6" screen.Moving extensions takes no effect.Maybe ROM 4.6.1 would do better(I use 5.2.1)?But I don't have it.
Made a couple of screenshots,but don't know how to post them :smile:
[edit]Good news!Mac OS ROM can be edited in ResEdit!No checksum errors!I changed its "vers" resource to 9.0 and it still works!Though with 9.0 version in System file my 9.0 installation doesn't boot.Had to change it back to 9.0.4.
Now I have a plan to convert yet unistallable OSX distros to resd-write images,mount them in,say,Cheetah and to play changing BootX,mach_kernel or extentions.But will the installers work from wr media?Leave it for tomorrow.
User avatar
sentient06
Mac Mechanic
Posts: 187
Joined: Tue Mar 29, 2011 8:57 pm
Location: London, UK

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by sentient06 »

alex195812 wrote:Good news!Mac OS ROM can be edited in ResEdit!No checksum errors!I changed its "vers" resource to 9.0 and it still works!Though with 9.0 version in System file my 9.0 installation doesn't boot.Had to change it back to 9.0.4.
Now I have a plan to convert yet unistallable OSX distros to resd-write images,mount them in,say,Cheetah and to play changing BootX,mach_kernel or extentions.But will the installers work from wr media?Leave it for tomorrow.
Sounds like a very productive day! =D

Did anyone try the disc for unsupported machines mentioned in ThinkClassic and MacOS9Lives?

URL for reference: https://www.thinkclassic.org/viewtopic.php?id=347.
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

The download link on that forum is dead now,but, as I can see from screenshots,it's MacOS9Lives! 2013 universal disc.It may be found at macintoshgarden now.My qemu 922 installation is from that disc.
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

Now I have a plan to convert yet unistallable OSX distros to resd-write images,mount them in,say,Cheetah and to play changing BootX,mach_kernel or extentions.But will the installers work from wr media?Leave it for tomorrow.
I thought it would be easy to do...First I decided to change BootX in MOSX Server 1.2v3 to the one from Cheetah.After converting the image to rw dmg in Disk Utility and mouning it on host I fiound two new partitions mounted read-only,both of Mac OS Standard format:"Mac OS X Server 1.2" and "MOSX_Booter".The file to change was on the second.No way to mount it read-write.
Tying to attach the image to qemu as secong hard-disk lead to unability to boot Mac OS 9.22.
When attached to Cheetah or Panther in qemu:the same as on host--two read-only partitions.
In SheepShaver--though read-write mounted,but only one partition--"Mac OS Server 1.2".
Tried to edit the original toast image in UltaISO on wine.Changed the extension to iso and opened. "Unsupported block size.HFS Vlolume will be omitted"...No way through?
Is there a way to change this file besides copy-pasting in a hex editor(which is absolute pain-in-ass) or editing in iBored?
I found Mac OS ROM 4.6.1 but trying to boot MOS 8.6 with it was unsuccesfull.
Last edited by alex195812 on Sat Dec 10, 2016 11:10 am, edited 1 time in total.
User avatar
adespoton
Forum All-Star
Posts: 3099
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by adespoton »

I seem to recall getting to this point and giving up a few years back when we were first looking at improving Mac support on qemu.

That said, you should be able to take the read only partition and dd it to a rw partition. The problem is writing it back when you're done.
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

Thanx God,it's not so hopeless.I read somewhere that Classic partitions in OS X are mouted read-only...What about Developer Prevews,I thought?.And yes,in 10.0 DP3 MOSX_Booter partition is mounted read-write mode.So I managed to change its BootX to Public Beta one.And my read-write dmg attached as cdrom works properly.It boot to Mac OS 9 fine.However,changing BootX takes no effect when booting Mac OS X Server.Next step is to change mach_kernel...I can continue trying...
So it appears that I can log on as root and change mach_kernel to Public Beta one.But still no effect--broken floppy after "Mac OS X Server" screen.What else to try?Extensions?It is more complicated for me.Have to think more...
But anyway this trick is suitable for modifying installation media.If so,couid 4Mb Old World ROM with the help of ResEdit be split into OpenFirmware and MacOS ROM,then Mac OS ROM be edited properly,placed into System Folder of a distribution and next,loaded in qemu with -M g3beige option "New World" way?Sounds crazy,but who knows?
User avatar
adespoton
Forum All-Star
Posts: 3099
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by adespoton »

Seems like it might need some minor editing to get things pointing to the right parts of memory when loaded, but other than that, doable. Just check where it's looking when it loads, and where the component actually is, and you'll know what needs to be patched.
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

Hi everyone! I want to report some progress booting MOSX10.0DP4.
The trick is to attach the installation cd as a hard disk,then in openbios prompt type:

Code: Select all

boot hd:9,\\:tbxi
Here you are!
It needs -cpu G3.
Now installing the system.See if it boots...
[edit]System installs OK.First I installed it over OS 9 installation without reformatting.Had problems with booting.Simple "boot" command in openbios gave black screen,command

Code: Select all

boot hd:SystemFolderX\\:tbxi
seemengly worked,but came to blue screen with working cursor.Had no patience to wait and find out if it can go farther...Reinstalled with reformatting the drive.Boots and configures OK.However fails to boot in the presence of sungem network device(I used -netdev way,will try -net,later).
I also tried 10.0DP1.With no modifications "This image is not for this platform...".After changing files BootX,Finder and System to DP2 versions boot starts and freezes with broken folder icon(kernel panic,afaik).Just like MOSX Server distros.
All best!
Next I want to try splitting OldWorld ROMs...
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

Well,it looks like it's easy to extract Mac OS ROM from 4Mb Old World image.In iHex at offset 3145492 I found this:

Code: Select all

kcThursday, November 14, 1996DeclROM for OpenTxptMacintosh CPU Family 6.0Copyright © 1986-1996 by Apple Computer, Inc.  All Rights Reserved.€€Љ€€Ю€€Д€€d€Macintosh 4A€€ш€€ж p$€€ €>€€м€€€шкт√u¶ZУ+«HH(|1C¶|(¶|2C¶|3B¶А!|(¶NА!|(¶|1C¶
Next followed a long zeroed space.I supposed that offsets from 0 to this line is just the ROM,saved it to a separate file,placed as Mac OS ROM in System Folder of my OS 9.0 image and tried to boot it.With -M g3beige openbios said "This image is not for this platform".With -M nac99,strangely,it started booting with no complaints and stopped on floppy icon with question mark.Just like when using,say,3.6 New ROM.That is,this image is kinda working as New ROM,being Old one.I wonder if g3beige profile could be allowed to boot "New World way"?
I used 6E92FE08 - Power Mac 6500.ROM from a collection found on the net.Don't know is it all of any use.

Now I know how to upload screenshots: :smile:
ImageImageImageImageImage
LightBulbFun
Tinkerer
Posts: 49
Joined: Mon Jul 13, 2015 11:32 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by LightBulbFun »

are you sure your actually using the 6500s ROM? as simply changing its name to Mac OS ROM and renaming the other stock ROM to something else wont change what OF loads as OF loads the file with the tbxi signature blessed onto it regardless of name or location. so unless you blessed the 6500 ROM it it would still be using the stock Mac OS ROM (and by your screen shots it looks like it)
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

Guess you're right!When removed all other ROMs from System Folder I get "No valid state..." now.
However,the screenshots are from other tests,not about Old World ROM,I wrote about them before.Just can't put them into older posts :smile: .
Somewhat strange about tbxi...Mounting my 9.0 and 9.0.4 images on the host and trying bless -info I see that both have blessed System Folders but no blessed System Files.But while 9.0(with Old world image) doesn't boot,9.0.4(with unblessed Mac OS ROM) boots fine...
[edit]Found a way (using ResEdit) to assign file type "tbxi" to Old ROM,but still "No valid state..."
That is,have to look for another way...
I hoped to load the ROM with -device loader option and next,in openbios "boot loader",but there's no "loader" in device tree.
Another attempt: -device loader,file=<My ROM>,addr=05600000 and in openbios "boot /memory@0:0x05600000"."Cannot find load for this packageNo valid state...".Maybe the syntax is wrong?Or no support for boot from memory?
Need to know more...
alex195812
Mac Mechanic
Posts: 169
Joined: Mon Aug 29, 2016 3:44 am

Re: GSOC qemu Boot Mac OS >= 8.5 on PowerPC system

Post by alex195812 »

Well, I'm still trying to go on.Now with MOSX10.0DP1.I have found a way to boot its kenel.I did the following;
1)Duplicated my 10.0DP2 image,and formatted its 11th partition to UFS(In Panther's Disk Utulity).
2)Booted to 10.0DP3 with attached DP1 iso and DP2(reformatted) image.
3)Opened /System/Administration/InstallerX.app and opened Mac_OS_X/System/Installation/Packages/OSInstall.mpkg.
4)Chose my target disk and started installation.The installation continued to almost very end and after reporting an error I quit the installer.Reboot.Of course, the installed system is misconfigured...Nevertheless...
With -M mac99 -cpu G3 kernel starts but "Still waiting for root device".With -M g3beige -g 1024x768x8 -usb -device usb-mouse It comes to:
Image
After typing: mount /dev/sd0a /;exit it comes to
Image
and next to
Image
The cursor can move.Seems liike with vga patches for g3beige similar to those made by Ben for mac99 graphics could start right.
Next I tried all described above for MOSXServer 1.2v3.That;s what it comes to:
Image
No valid disk label...
After attaching also the installation cd and adding -prom-env 'rd=sd0 -v' to command line it comes to:
Image
That is installation from cd starts,but as neither keyboard nor mouse work,installation can't continue...
Post Reply