On Jan 25, 2018, at 10:18 AM, Programmingkid email@example.com wrote:
On Jan 25, 2018, at 10:01 AM, Jd Lyons firstname.lastname@example.org wrote:
In an effort to figure out why qemu-system-ppc hangs at BootX when using some emulated and KVM CPU’s, I suppose it would be good to enter some breakpoints in the code.
I found some BootX sources at:
Tho I’m not sure what versions correspond to which release of OS X?
And it’s not clear how to build them, tho I haven’t tried yet.
I found some info on BootX as well as some idea how to do what I’m looking to do:
There are few other useful debugging tech- niques. Setting "auto-boot?" to false will cause the system to enter the OpenFirmware User In- terface by default. Changing kFailToBoot to 0 in include.tproj/sl.h will alter BootX’s default be- havior on error, so that it will return to Open- Firmware. Finally, calling Enter(), will cause BootX to drop back into the OpenFirmware User Interface. This can be used as a break point. The "dumpl" word will dump some memory, by en- tering the address, then the length, then "dumpl". By calling printf in BootX immediately before En- ter(), the address can be easily determined, and the variable can then be examined and altered from OpenFirmware. Finally typing the "go" command will resume BootX’s execution.
I noted when I boot from boot usb0/disk:3,\:tbxi while holding command+v BootX sends some info to the screen, seemingly via open firware, while displaying the “Apple Logo” boot graphic. The info show some of the boot process and what stage it’s loading” loading mach_kernel’ “ loading the .mkext”
It would be nice to get this output going via Open Bios, if anyone has any idea how I might be able to do that?
Have you tried adding "-prom-env boot-args=-v" to QEMU's arguments yet?
Yes, I usually use -prom-env 'boot-args=-v debug=0xffe kdp=2’.
On a real PPC Mac BootX seems to give some extra debug in fo with command+V, tho most of the time it goes by so fast that it’s unreadable. Booting from a slower drive like USB yield the kind of info I’m looking for, to be able to tell at what stage BootX is hanging.
Unfortunately, this debug info is no sent to the screen, or stdio in OpenBios, or I just haven’t figured out how to do that yet.