I need to try and debug the macOS trampoline inits during the early boot process of OS 9. I’m thinking Qemu supports this, but I’m unsure how to set it up?
I installed gdb-multiarch and started qemu with:
Qemu-system-ppc -s -S
The launched gdb-multiarch and connected to port 1234.
Is this the correct toolchain for debugging PPC code on an X86 host, or do I need to do something else?
On Oct 10, 2018, at 12:05 AM, Jd Lyons via OpenBIOS openbios@openbios.org wrote:
I need to try and debug the macOS trampoline inits during the early boot process of OS 9. I’m thinking Qemu supports this, but I’m unsure how to set it up?
I installed gdb-multiarch and started qemu with:
Qemu-system-ppc -s -S
The launched gdb-multiarch and connected to port 1234.
Is this the correct toolchain for debugging PPC code on an X86 host, or do I need to do something else?
I used Apple's PowerPC gdb.
On Oct 10, 2018, at 6:31 AM, Programmingkid programmingkidx@gmail.com wrote:
On Oct 10, 2018, at 12:05 AM, Jd Lyons via OpenBIOS openbios@openbios.org wrote:
I need to try and debug the macOS trampoline inits during the early boot process of OS 9. I’m thinking Qemu supports this, but I’m unsure how to set it up?
I installed gdb-multiarch and started qemu with:
Qemu-system-ppc -s -S
The launched gdb-multiarch and connected to port 1234.
Is this the correct toolchain for debugging PPC code on an X86 host, or do I need to do something else?
I used Apple's PowerPC gdb.
My host system is X86, I was thinking Mark, or someone here once outlined a way to debug Openbios by installing some sort of powerpc debug tools on X86?
On Oct 10, 2018, at 8:23 PM, Jd Lyons via OpenBIOS openbios@openbios.org wrote:
On Oct 10, 2018, at 6:31 AM, Programmingkid programmingkidx@gmail.com wrote:
On Oct 10, 2018, at 12:05 AM, Jd Lyons via OpenBIOS openbios@openbios.org wrote:
I need to try and debug the macOS trampoline inits during the early boot process of OS 9. I’m thinking Qemu supports this, but I’m unsure how to set it up?
I installed gdb-multiarch and started qemu with:
Qemu-system-ppc -s -S
The launched gdb-multiarch and connected to port 1234.
Is this the correct toolchain for debugging PPC code on an X86 host, or do I need to do something else?
I used Apple's PowerPC gdb.
My host system is X86, I was thinking Mark, or someone here once outlined a way to debug Openbios by installing some sort of powerpc debug tools on X86?
OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
Ok, breakpoint not working with gdb-multiarch:
(gdb)target remote localhost:1234 (gdb)break CalcRAMSize (gdb)continue
It just boots the Mac OS and only waits before continue.
I'm sure I'm doing something wrong here, maybe I need some PPC Libs installed, my host is X86?
On 11/10/2018 12:12, Jd Lyons via OpenBIOS wrote:
I installed gdb-multiarch and started qemu with:
Qemu-system-ppc -s -S
The launched gdb-multiarch and connected to port 1234.
Is this the correct toolchain for debugging PPC code on an X86 host, or do I need to do something else?
I actually build gdb from source for the architectures I need (sparc32, sparc64 and ppc), so I can't really comment on how multi-arch works.
I used Apple's PowerPC gdb.
Note that Apple have patched their gdb quite heavily, for example I couldn't even build it on Linux. On the plus side if you are able to do this, Apple's gdb is at least able to read symbols from Mach binaries.
My host system is X86, I was thinking Mark, or someone here once outlined a way to debug Openbios by installing some sort of powerpc debug tools on X86?
Ok, breakpoint not working with gdb-multiarch:
(gdb)target remote localhost:1234 (gdb)break CalcRAMSize (gdb)continue
It just boots the Mac OS and only waits before continue.
I'm sure I'm doing something wrong here, maybe I need some PPC Libs installed, my host is X86?
I normally allow gdb to detect correct arch before attaching to the remote with "target remote ..." by passing a relevant ELF file to gdb e.g.
power-linux-gdb openbios-ppc
Note that symbols such as CalcRAMSize are generally only visible in the guest, so you'll either need to take the executable from the guest and generate a gdb symbol file for it, or otherwise use breakpoints for routines based upon their address e.g.
break *0x12345678
ATB,
Mark.
On Oct 11, 2018, at 12:57 PM, Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
On 11/10/2018 12:12, Jd Lyons via OpenBIOS wrote:
I installed gdb-multiarch and started qemu with:
Qemu-system-ppc -s -S
The launched gdb-multiarch and connected to port 1234.
Is this the correct toolchain for debugging PPC code on an X86 host, or do I need to do something else?
I actually build gdb from source for the architectures I need (sparc32, sparc64 and ppc), so I can't really comment on how multi-arch works.
Can I build gdb for debugging ppc code on x86?
Any instructions on how to do that?
Or should I be using a PPC host for this?
I used Apple's PowerPC gdb.
Note that Apple have patched their gdb quite heavily, for example I couldn't even build it on Linux. On the plus side if you are able to do this, Apple's gdb is at least able to read symbols from Mach binaries.
My host system is X86, I was thinking Mark, or someone here once outlined a way to debug Openbios by installing some sort of powerpc debug tools on X86?
Ok, breakpoint not working with gdb-multiarch:
(gdb)target remote localhost:1234 (gdb)break CalcRAMSize (gdb)continue
It just boots the Mac OS and only waits before continue.
I'm sure I'm doing something wrong here, maybe I need some PPC Libs installed, my host is X86?
I normally allow gdb to detect correct arch before attaching to the remote with "target remote ..." by passing a relevant ELF file to gdb e.g.
power-linux-gdb openbios-ppc
Note that symbols such as CalcRAMSize are generally only visible in the guest, so you'll either need to take the executable from the guest and generate a gdb symbol file for it, or otherwise use breakpoints for routines based upon their address e.g.
break *0x12345678
ATB,
Mark.
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
On Oct 12, 2018, at 7:02 AM, Jd Lyons lyons_dj@yahoo.com wrote:
On Oct 11, 2018, at 12:57 PM, Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
On 11/10/2018 12:12, Jd Lyons via OpenBIOS wrote:
I installed gdb-multiarch and started qemu with:
Qemu-system-ppc -s -S
The launched gdb-multiarch and connected to port 1234.
Is this the correct toolchain for debugging PPC code on an X86 host, or do I need to do something else?
I actually build gdb from source for the architectures I need (sparc32, sparc64 and ppc), so I can't really comment on how multi-arch works.
Can I build gdb for debugging ppc code on x86?
Any instructions on how to do that?
Or should I be using a PPC host for this?
Mac OS X running in qemu-system-ppc should work just as well as a real PowerPC Mac would. It would probably mean running two instances of qemu-system-ppc on your host.
On Oct 12, 2018, at 6:43 PM, Programmingkid programmingkidx@gmail.com wrote:
On Oct 12, 2018, at 7:02 AM, Jd Lyons lyons_dj@yahoo.com wrote:
On Oct 11, 2018, at 12:57 PM, Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
On 11/10/2018 12:12, Jd Lyons via OpenBIOS wrote:
> I installed gdb-multiarch and started qemu with: > > Qemu-system-ppc -s -S > > The launched gdb-multiarch and connected to port 1234. > > Is this the correct toolchain for debugging PPC code on an X86 host, or do I need to do something else?
I actually build gdb from source for the architectures I need (sparc32, sparc64 and ppc), so I can't really comment on how multi-arch works.
Can I build gdb for debugging ppc code on x86?
Any instructions on how to do that?
Or should I be using a PPC host for this?
Mac OS X running in qemu-system-ppc should work just as well as a real PowerPC Mac would. It would probably mean running two instances of qemu-system-ppc on your host.
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
I just didn’t know if powerpc-linux-gdb would run to debug a running ppc target in qemu on an x86 host, but I figured it out, seems to run fine.
For reference, he’s how to build gdb on an x86 host for debugging powerpc code:
To build gdb-powerpc-linux on Linux, you'll need normal build tools such as gcc installed, I'll assume people know how to install that stuff with apt or their other package manager. Anything you don't have you need installed to build, it will likely let you know when you try to configure.
Download the GDB source code, I had trouble with the latest release, so likely people will want to use v7.9.
http://ftp.gnu.org/gnu/gdb/gdb-7.9.tar.gz
Unpack it and cd into the dir, then just:
./configure -target=powerpc-linux --enable-sim-powerpc make && sudo make install
After that, all you need to do is launch qemu-system-ppc(64) with -s and -S, it will pause and listen on port 1234 for GDB.
Then in another terminal launch gdb:
gdb-powerpc-linux target remote localhost:1234 continue
You'll likely want to set prom-env "auto-boot?=false" --nographic for Qemu.
Set your breakpoint in GDB, I.E.
break *0x20dccc
Then type boot in the Qemu terminal.
On Oct 13, 2018, at 6:45 AM, Jd Lyons lyons_dj@yahoo.com wrote:
On Oct 12, 2018, at 6:43 PM, Programmingkid programmingkidx@gmail.com wrote:
On Oct 12, 2018, at 7:02 AM, Jd Lyons lyons_dj@yahoo.com wrote:
On Oct 11, 2018, at 12:57 PM, Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
On 11/10/2018 12:12, Jd Lyons via OpenBIOS wrote:
>> I installed gdb-multiarch and started qemu with: >> >> Qemu-system-ppc -s -S >> >> The launched gdb-multiarch and connected to port 1234. >> >> Is this the correct toolchain for debugging PPC code on an X86 host, or do I need to do something else?
I actually build gdb from source for the architectures I need (sparc32, sparc64 and ppc), so I can't really comment on how multi-arch works.
Can I build gdb for debugging ppc code on x86?
Any instructions on how to do that?
Or should I be using a PPC host for this?
Mac OS X running in qemu-system-ppc should work just as well as a real PowerPC Mac would. It would probably mean running two instances of qemu-system-ppc on your host.
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
I just didn’t know if powerpc-linux-gdb would run to debug a running ppc target in qemu on an x86 host, but I figured it out, seems to run fine.
For reference, he’s how to build gdb on an x86 host for debugging powerpc code:
To build gdb-powerpc-linux on Linux, you'll need normal build tools such as gcc installed, I'll assume people know how to install that stuff with apt or their other package manager. Anything you don't have you need installed to build, it will likely let you know when you try to configure.
Download the GDB source code, I had trouble with the latest release, so likely people will want to use v7.9.
http://ftp.gnu.org/gnu/gdb/gdb-7.9.tar.gz
Unpack it and cd into the dir, then just:
./configure -target=powerpc-linux --enable-sim-powerpc make && sudo make install
After that, all you need to do is launch qemu-system-ppc(64) with -s and -S, it will pause and listen on port 1234 for GDB.
Then in another terminal launch gdb:
gdb-powerpc-linux target remote localhost:1234 continue
You'll likely want to set prom-env "auto-boot?=false" --nographic for Qemu.
Set your breakpoint in GDB, I.E.
break *0x20dccc
Then type boot in the Qemu terminal.
This information should receive its own wiki page.
On Oct 13, 2018, at 6:45 AM, Jd Lyons lyons_dj@yahoo.com wrote:
On Oct 12, 2018, at 6:43 PM, Programmingkid programmingkidx@gmail.com wrote:
On Oct 12, 2018, at 7:02 AM, Jd Lyons lyons_dj@yahoo.com wrote:
On Oct 11, 2018, at 12:57 PM, Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
On 11/10/2018 12:12, Jd Lyons via OpenBIOS wrote:
>> I installed gdb-multiarch and started qemu with: >> >> Qemu-system-ppc -s -S >> >> The launched gdb-multiarch and connected to port 1234. >> >> Is this the correct toolchain for debugging PPC code on an X86 host, or do I need to do something else?
I actually build gdb from source for the architectures I need (sparc32, sparc64 and ppc), so I can't really comment on how multi-arch works.
Can I build gdb for debugging ppc code on x86?
Any instructions on how to do that?
Or should I be using a PPC host for this?
Mac OS X running in qemu-system-ppc should work just as well as a real PowerPC Mac would. It would probably mean running two instances of qemu-system-ppc on your host.
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
I just didn’t know if powerpc-linux-gdb would run to debug a running ppc target in qemu on an x86 host, but I figured it out, seems to run fine.
For reference, he’s how to build gdb on an x86 host for debugging powerpc code:
To build gdb-powerpc-linux on Linux, you'll need normal build tools such as gcc installed, I'll assume people know how to install that stuff with apt or their other package manager. Anything you don't have you need installed to build, it will likely let you know when you try to configure.
Download the GDB source code, I had trouble with the latest release, so likely people will want to use v7.9.
http://ftp.gnu.org/gnu/gdb/gdb-7.9.tar.gz
Unpack it and cd into the dir, then just:
./configure -target=powerpc-linux --enable-sim-powerpc make && sudo make install
After that, all you need to do is launch qemu-system-ppc(64) with -s and -S, it will pause and listen on port 1234 for GDB.
Then in another terminal launch gdb:
gdb-powerpc-linux target remote localhost:1234 continue
You'll likely want to set prom-env "auto-boot?=false" --nographic for Qemu.
Set your breakpoint in GDB, I.E.
break *0x20dccc
Then type boot in the Qemu terminal.
What are you trying to debug (Mac OS X, Mac OS 9, Linux)?
On Oct 13, 2018, at 9:17 AM, Programmingkid programmingkidx@gmail.com wrote:
On Oct 13, 2018, at 6:45 AM, Jd Lyons lyons_dj@yahoo.com wrote:
On Oct 12, 2018, at 6:43 PM, Programmingkid programmingkidx@gmail.com wrote:
On Oct 12, 2018, at 7:02 AM, Jd Lyons lyons_dj@yahoo.com wrote:
On Oct 11, 2018, at 12:57 PM, Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
On 11/10/2018 12:12, Jd Lyons via OpenBIOS wrote:
>>> I installed gdb-multiarch and started qemu with: >>> >>> Qemu-system-ppc -s -S >>> >>> The launched gdb-multiarch and connected to port 1234. >>> >>> Is this the correct toolchain for debugging PPC code on an X86 host, or do I need to do something else?
I actually build gdb from source for the architectures I need (sparc32, sparc64 and ppc), so I can't really comment on how multi-arch works.
Can I build gdb for debugging ppc code on x86?
Any instructions on how to do that?
Or should I be using a PPC host for this?
Mac OS X running in qemu-system-ppc should work just as well as a real PowerPC Mac would. It would probably mean running two instances of qemu-system-ppc on your host.
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
I just didn’t know if powerpc-linux-gdb would run to debug a running ppc target in qemu on an x86 host, but I figured it out, seems to run fine.
For reference, he’s how to build gdb on an x86 host for debugging powerpc code:
To build gdb-powerpc-linux on Linux, you'll need normal build tools such as gcc installed, I'll assume people know how to install that stuff with apt or their other package manager. Anything you don't have you need installed to build, it will likely let you know when you try to configure.
Download the GDB source code, I had trouble with the latest release, so likely people will want to use v7.9.
http://ftp.gnu.org/gnu/gdb/gdb-7.9.tar.gz
Unpack it and cd into the dir, then just:
./configure -target=powerpc-linux --enable-sim-powerpc make && sudo make install
After that, all you need to do is launch qemu-system-ppc(64) with -s and -S, it will pause and listen on port 1234 for GDB.
Then in another terminal launch gdb:
gdb-powerpc-linux target remote localhost:1234 continue
You'll likely want to set prom-env "auto-boot?=false" --nographic for Qemu.
Set your breakpoint in GDB, I.E.
break *0x20dccc
Then type boot in the Qemu terminal.
What are you trying to debug (Mac OS X, Mac OS 9, Linux)?
Debugging the Mac OS 9 trampoline, to see if I can get it to boot on the G5 cpu.
http://macos9lives.com/smforum/index.php/topic,4600.msg33350/topicseen.html#...
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
On Oct 14, 2018, at 6:11 AM, Jd Lyons lyons_dj@yahoo.com wrote:
On Oct 13, 2018, at 9:17 AM, Programmingkid programmingkidx@gmail.com wrote:
On Oct 13, 2018, at 6:45 AM, Jd Lyons lyons_dj@yahoo.com wrote:
On Oct 12, 2018, at 6:43 PM, Programmingkid programmingkidx@gmail.com wrote:
On Oct 12, 2018, at 7:02 AM, Jd Lyons lyons_dj@yahoo.com wrote:
On Oct 11, 2018, at 12:57 PM, Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
On 11/10/2018 12:12, Jd Lyons via OpenBIOS wrote:
>>>> I installed gdb-multiarch and started qemu with: >>>> >>>> Qemu-system-ppc -s -S >>>> >>>> The launched gdb-multiarch and connected to port 1234. >>>> >>>> Is this the correct toolchain for debugging PPC code on an X86 host, or do I need to do something else?
I actually build gdb from source for the architectures I need (sparc32, sparc64 and ppc), so I can't really comment on how multi-arch works.
Can I build gdb for debugging ppc code on x86?
Any instructions on how to do that?
Or should I be using a PPC host for this?
Mac OS X running in qemu-system-ppc should work just as well as a real PowerPC Mac would. It would probably mean running two instances of qemu-system-ppc on your host.
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
I just didn’t know if powerpc-linux-gdb would run to debug a running ppc target in qemu on an x86 host, but I figured it out, seems to run fine.
For reference, he’s how to build gdb on an x86 host for debugging powerpc code:
To build gdb-powerpc-linux on Linux, you'll need normal build tools such as gcc installed, I'll assume people know how to install that stuff with apt or their other package manager. Anything you don't have you need installed to build, it will likely let you know when you try to configure.
Download the GDB source code, I had trouble with the latest release, so likely people will want to use v7.9.
http://ftp.gnu.org/gnu/gdb/gdb-7.9.tar.gz
Unpack it and cd into the dir, then just:
./configure -target=powerpc-linux --enable-sim-powerpc make && sudo make install
After that, all you need to do is launch qemu-system-ppc(64) with -s and -S, it will pause and listen on port 1234 for GDB.
Then in another terminal launch gdb:
gdb-powerpc-linux target remote localhost:1234 continue
You'll likely want to set prom-env "auto-boot?=false" --nographic for Qemu.
Set your breakpoint in GDB, I.E.
break *0x20dccc
Then type boot in the Qemu terminal.
What are you trying to debug (Mac OS X, Mac OS 9, Linux)?
Debugging the Mac OS 9 trampoline, to see if I can get it to boot on the G5 cpu.
http://macos9lives.com/smforum/index.php/topic,4600.msg33350/topicseen.html#...
Very interesting work. Maybe we could use the information learned to boot other versions of the Mac OS in QEMU.