Hi list,
I've gotten the qemu-ppc target to build correctly, however, I'm having issues with the qemu-ppc64 target. I'm using the 10.1.0 GCC ppc64 compiler distributed at kernel.org[1].
I'm doing the following: $ PATH=/home/user/cross/gcc-10.1.0-nolibc/powerpc64-linux/bin:$PATH $ ./config/scripts/switch-arch qemu-ppc64 $ make V=1
The make is fine until the forthstrap command, which has this output: ./forthstrap -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/lib/ -I/home/user/openbios.git/forth/device/ -I/home/user/openbios.git/forth/debugging/ -I/home/user/openbios.git/forth/admin/ -I/home/user/openbios.git/forth/util/ -I/home/user/openbios.git/forth/packages/ -I/home/user/openbios.git/forth/system/ -I/home/user/openbios.git/libopenbios/ -I/home/user/openbios.git/packages/ -I/home/user/openbios.git/drivers/ -I/home/user/openbios.git/arch/ppc/ -I/home/user/openbios.git -I./forth -D bootstrap.dict -M bootstrap.dict.d -c bootstrap.dict-console.log forth/bootstrap/start.fs panic: segmentation violation at 0xa6dbc62c dict=0x7fa7a6dbc010 here=0x7fa7a6dbc638(dict+0x628) pc=0x0(dict+0x59243ff0) dstackcnt=0 rstackcnt=0 instruction=deadbeef dstack: 0x0 rstack: 0x0 Writing dictionary core file
Is anyone else seeing this? Can someone with forth experience help here?
Glenn
[1] https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/10.1.0/...
On 20/01/2022 21:12, Glenn Washburn wrote:
Hi list,
I've gotten the qemu-ppc target to build correctly, however, I'm having issues with the qemu-ppc64 target. I'm using the 10.1.0 GCC ppc64 compiler distributed at kernel.org[1].
I'm doing the following: $ PATH=/home/user/cross/gcc-10.1.0-nolibc/powerpc64-linux/bin:$PATH $ ./config/scripts/switch-arch qemu-ppc64 $ make V=1
The make is fine until the forthstrap command, which has this output: ./forthstrap -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/lib/ -I/home/user/openbios.git/forth/device/ -I/home/user/openbios.git/forth/debugging/ -I/home/user/openbios.git/forth/admin/ -I/home/user/openbios.git/forth/util/ -I/home/user/openbios.git/forth/packages/ -I/home/user/openbios.git/forth/system/ -I/home/user/openbios.git/libopenbios/ -I/home/user/openbios.git/packages/ -I/home/user/openbios.git/drivers/ -I/home/user/openbios.git/arch/ppc/ -I/home/user/openbios.git -I./forth -D bootstrap.dict -M bootstrap.dict.d -c bootstrap.dict-console.log forth/bootstrap/start.fs panic: segmentation violation at 0xa6dbc62c dict=0x7fa7a6dbc010 here=0x7fa7a6dbc638(dict+0x628) pc=0x0(dict+0x59243ff0) dstackcnt=0 rstackcnt=0 instruction=deadbeef dstack: 0x0 rstack: 0x0 Writing dictionary core file
Is anyone else seeing this? Can someone with forth experience help here?
Glenn
[1] https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/10.1.0/...
I haven't tried building with a powerpc64 compiler for a while as the output binary for ppc is always 32-bit. IIRC there is some runtime patching around rfi/rfid and management of the MSR_SF flag to allow things to work under both qemu-system-ppc and qemu-system-ppc64.
Can you get a backtrace from the above? You'll need to clear out any existing obj-* directories and tweak HOSTCFLAGS and CFLAGS in Makefile.target to specify -O0 -g before re-running switch-arch.
ATB,
Mark.
On Mon, 24 Jan 2022 08:04:07 +0000 Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
On 20/01/2022 21:12, Glenn Washburn wrote:
Hi list,
I've gotten the qemu-ppc target to build correctly, however, I'm having issues with the qemu-ppc64 target. I'm using the 10.1.0 GCC ppc64 compiler distributed at kernel.org[1].
I'm doing the following: $ PATH=/home/user/cross/gcc-10.1.0-nolibc/powerpc64-linux/bin:$PATH $ ./config/scripts/switch-arch qemu-ppc64 $ make V=1
The make is fine until the forthstrap command, which has this output: ./forthstrap -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/lib/ -I/home/user/openbios.git/forth/device/ -I/home/user/openbios.git/forth/debugging/ -I/home/user/openbios.git/forth/admin/ -I/home/user/openbios.git/forth/util/ -I/home/user/openbios.git/forth/packages/ -I/home/user/openbios.git/forth/system/ -I/home/user/openbios.git/libopenbios/ -I/home/user/openbios.git/packages/ -I/home/user/openbios.git/drivers/ -I/home/user/openbios.git/arch/ppc/ -I/home/user/openbios.git -I./forth -D bootstrap.dict -M bootstrap.dict.d -c bootstrap.dict-console.log forth/bootstrap/start.fs panic: segmentation violation at 0xa6dbc62c dict=0x7fa7a6dbc010 here=0x7fa7a6dbc638(dict+0x628) pc=0x0(dict+0x59243ff0) dstackcnt=0 rstackcnt=0 instruction=deadbeef dstack: 0x0 rstack: 0x0 Writing dictionary core file
Is anyone else seeing this? Can someone with forth experience help here?
Glenn
[1] https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/10.1.0/...
I haven't tried building with a powerpc64 compiler for a while as the output binary for ppc is always 32-bit. IIRC there is some runtime patching around rfi/rfid and management of the MSR_SF flag to allow things to work under both qemu-system-ppc and qemu-system-ppc64.
Can you get a backtrace from the above? You'll need to clear out any existing obj-* directories and tweak HOSTCFLAGS and CFLAGS in Makefile.target to specify -O0 -g before re-running switch-arch.
Here's backtrace output ia GDB.
Starting program: /home/user/openbios.git/obj-ppc64/forthstrap -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/lib/ -I/home/user/openbios.git/forth/device/ -I/home/user/openbios.git/forth/debugging/ -I/home/user/openbios.git/forth/admin/ -I/home/user/openbios.git/forth/util/ -I/home/user/openbios.git/forth/packages/ -I/home/user/openbios.git/forth/system/ -I/home/user/openbios.git/libopenbios/ -I/home/user/openbios.git/packages/ -I/home/user/openbios.git/drivers/ -I/home/user/openbios.git/arch/ppc/ -I/home/user/openbios.git -I./forth -D bootstrap.dict -M bootstrap.dict.d -c bootstrap.dict-console.log forth/bootstrap/start.fs
Program received signal SIGSEGV, Segmentation fault. 0x00005555555575e9 in findword (s1=0x55555555f112 "(semis)") at /home/user/openbios.git/kernel/dict.c:118 118 tmplfa = read_ucell(cell2pointer(tmplfa)); (gdb) bt #0 0x00005555555575e9 in findword (s1=0x55555555f112 "(semis)") at /home/user/openbios.git/kernel/dict.c:118 #1 0x0000555555559781 in interpret_source ( fil=0x7fffffffe33a "forth/bootstrap/start.fs") at /home/user/openbios.git/kernel/bootstrap.c:591 #2 0x000055555555a9f0 in new_dictionary ( source=0x7fffffffe33a "forth/bootstrap/start.fs") at /home/user/openbios.git/kernel/bootstrap.c:1059 #3 0x000055555555ae66 in main (argc=23, argv=0x7fffffffddb8) at /home/user/openbios.git/kernel/bootstrap.c:1286
Glenn
On Mon, 24 Jan 2022, Glenn Washburn wrote:
On Mon, 24 Jan 2022 08:04:07 +0000 Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
On 20/01/2022 21:12, Glenn Washburn wrote:
Hi list,
I've gotten the qemu-ppc target to build correctly, however, I'm having issues with the qemu-ppc64 target. I'm using the 10.1.0 GCC ppc64 compiler distributed at kernel.org[1].
I'm doing the following: $ PATH=/home/user/cross/gcc-10.1.0-nolibc/powerpc64-linux/bin:$PATH $ ./config/scripts/switch-arch qemu-ppc64 $ make V=1
The make is fine until the forthstrap command, which has this output: ./forthstrap -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/lib/ -I/home/user/openbios.git/forth/device/ -I/home/user/openbios.git/forth/debugging/ -I/home/user/openbios.git/forth/admin/ -I/home/user/openbios.git/forth/util/ -I/home/user/openbios.git/forth/packages/ -I/home/user/openbios.git/forth/system/ -I/home/user/openbios.git/libopenbios/ -I/home/user/openbios.git/packages/ -I/home/user/openbios.git/drivers/ -I/home/user/openbios.git/arch/ppc/ -I/home/user/openbios.git -I./forth -D bootstrap.dict -M bootstrap.dict.d -c bootstrap.dict-console.log forth/bootstrap/start.fs panic: segmentation violation at 0xa6dbc62c dict=0x7fa7a6dbc010 here=0x7fa7a6dbc638(dict+0x628) pc=0x0(dict+0x59243ff0) dstackcnt=0 rstackcnt=0 instruction=deadbeef dstack: 0x0 rstack: 0x0 Writing dictionary core file
Is anyone else seeing this? Can someone with forth experience help here?
Glenn
[1] https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/10.1.0/...
I haven't tried building with a powerpc64 compiler for a while as the output binary for ppc is always 32-bit. IIRC there is some runtime patching around rfi/rfid and management of the MSR_SF flag to allow things to work under both qemu-system-ppc and qemu-system-ppc64.
Can you get a backtrace from the above? You'll need to clear out any existing obj-* directories and tweak HOSTCFLAGS and CFLAGS in Makefile.target to specify -O0 -g before re-running switch-arch.
Here's backtrace output ia GDB.
Not sure what do you want to do with qemu-ppc64 but the only tested and working config is qemu-ppc which should also work with 64bit PPC but only used for qemu-system-ppc64 -M mac99 which is some G5 Mac like hardware (incomplete emulation of a G5 Mac with a U3 chipset) but still says PowerMac3,1 in the device tree which might confuse anything else than Linux.
Regards, BALATON Zoltan
Hi Balaton,
On Tue, 25 Jan 2022 14:01:38 +0100 (CET) BALATON Zoltan balaton@eik.bme.hu wrote:
On Mon, 24 Jan 2022, Glenn Washburn wrote:
On Mon, 24 Jan 2022 08:04:07 +0000 Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
On 20/01/2022 21:12, Glenn Washburn wrote:
Hi list,
I've gotten the qemu-ppc target to build correctly, however, I'm having issues with the qemu-ppc64 target. I'm using the 10.1.0 GCC ppc64 compiler distributed at kernel.org[1].
I'm doing the following: $ PATH=/home/user/cross/gcc-10.1.0-nolibc/powerpc64-linux/bin:$PATH $ ./config/scripts/switch-arch qemu-ppc64 $ make V=1
The make is fine until the forthstrap command, which has this output: ./forthstrap -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/lib/ -I/home/user/openbios.git/forth/device/ -I/home/user/openbios.git/forth/debugging/ -I/home/user/openbios.git/forth/admin/ -I/home/user/openbios.git/forth/util/ -I/home/user/openbios.git/forth/packages/ -I/home/user/openbios.git/forth/system/ -I/home/user/openbios.git/libopenbios/ -I/home/user/openbios.git/packages/ -I/home/user/openbios.git/drivers/ -I/home/user/openbios.git/arch/ppc/ -I/home/user/openbios.git -I./forth -D bootstrap.dict -M bootstrap.dict.d -c bootstrap.dict-console.log forth/bootstrap/start.fs panic: segmentation violation at 0xa6dbc62c dict=0x7fa7a6dbc010 here=0x7fa7a6dbc638(dict+0x628) pc=0x0(dict+0x59243ff0) dstackcnt=0 rstackcnt=0 instruction=deadbeef dstack: 0x0 rstack: 0x0 Writing dictionary core file
Is anyone else seeing this? Can someone with forth experience help here?
Glenn
[1] https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/10.1.0/...
I haven't tried building with a powerpc64 compiler for a while as the output binary for ppc is always 32-bit. IIRC there is some runtime patching around rfi/rfid and management of the MSR_SF flag to allow things to work under both qemu-system-ppc and qemu-system-ppc64.
Can you get a backtrace from the above? You'll need to clear out any existing obj-* directories and tweak HOSTCFLAGS and CFLAGS in Makefile.target to specify -O0 -g before re-running switch-arch.
Here's backtrace output ia GDB.
Not sure what do you want to do with qemu-ppc64 but the only tested and working config is qemu-ppc which should also work with 64bit PPC but only used for qemu-system-ppc64 -M mac99 which is some G5 Mac like hardware (incomplete emulation of a G5 Mac with a U3 chipset) but still says PowerMac3,1 in the device tree which might confuse anything else than Linux.
Thank you for confirming that qemu-ppc64 is not working. My naive intent was to use the 64bit firmware for the 64bit PPC QEMU. The documentation leads one to believe that this is a valid build target. Perhaps it should be removed or at least documented that it does not work?
If the qemu-ppc64 target were to build successfully, would it also have the same restrictions of only being able to be used by the mac99 machine?
For further context, I'm doing this as a part of working on GRUB's testing. Checking again though, it looks like GRUB probably only runs in 32-bit mode on PPC64 anyway.
Glenn
On Tue, 25 Jan 2022, Glenn Washburn wrote:
Hi Balaton,
On Tue, 25 Jan 2022 14:01:38 +0100 (CET) BALATON Zoltan balaton@eik.bme.hu wrote:
On Mon, 24 Jan 2022, Glenn Washburn wrote:
On Mon, 24 Jan 2022 08:04:07 +0000 Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
On 20/01/2022 21:12, Glenn Washburn wrote:
Hi list,
I've gotten the qemu-ppc target to build correctly, however, I'm having issues with the qemu-ppc64 target. I'm using the 10.1.0 GCC ppc64 compiler distributed at kernel.org[1].
I'm doing the following: $ PATH=/home/user/cross/gcc-10.1.0-nolibc/powerpc64-linux/bin:$PATH $ ./config/scripts/switch-arch qemu-ppc64 $ make V=1
The make is fine until the forthstrap command, which has this output: ./forthstrap -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/lib/ -I/home/user/openbios.git/forth/device/ -I/home/user/openbios.git/forth/debugging/ -I/home/user/openbios.git/forth/admin/ -I/home/user/openbios.git/forth/util/ -I/home/user/openbios.git/forth/packages/ -I/home/user/openbios.git/forth/system/ -I/home/user/openbios.git/libopenbios/ -I/home/user/openbios.git/packages/ -I/home/user/openbios.git/drivers/ -I/home/user/openbios.git/arch/ppc/ -I/home/user/openbios.git -I./forth -D bootstrap.dict -M bootstrap.dict.d -c bootstrap.dict-console.log forth/bootstrap/start.fs panic: segmentation violation at 0xa6dbc62c dict=0x7fa7a6dbc010 here=0x7fa7a6dbc638(dict+0x628) pc=0x0(dict+0x59243ff0) dstackcnt=0 rstackcnt=0 instruction=deadbeef dstack: 0x0 rstack: 0x0 Writing dictionary core file
Is anyone else seeing this? Can someone with forth experience help here?
Glenn
[1] https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/10.1.0/...
I haven't tried building with a powerpc64 compiler for a while as the output binary for ppc is always 32-bit. IIRC there is some runtime patching around rfi/rfid and management of the MSR_SF flag to allow things to work under both qemu-system-ppc and qemu-system-ppc64.
Can you get a backtrace from the above? You'll need to clear out any existing obj-* directories and tweak HOSTCFLAGS and CFLAGS in Makefile.target to specify -O0 -g before re-running switch-arch.
Here's backtrace output ia GDB.
Not sure what do you want to do with qemu-ppc64 but the only tested and working config is qemu-ppc which should also work with 64bit PPC but only used for qemu-system-ppc64 -M mac99 which is some G5 Mac like hardware (incomplete emulation of a G5 Mac with a U3 chipset) but still says PowerMac3,1 in the device tree which might confuse anything else than Linux.
Thank you for confirming that qemu-ppc64 is not working. My naive intent was to use the 64bit firmware for the 64bit PPC QEMU. The documentation leads one to believe that this is a valid build target. Perhaps it should be removed or at least documented that it does not work?
There are a lot of things that could be improved but there aren't many developers working on OpenBIOS. In fact Matk is alone and doesn't have much time for it so apart from the regularly used parts others may have shortcomings. In the past I think OpenBIOS was used by other projects too and remnants of that are still there but nowadays it's mostly only used for QEMU's ppc and sparc targets so only those are likely to work. It's still not identical to the original firmware of those machines so it probably boots common OSes but may have some differences or missing parts compared to real hardware. This may be a limitation for testing software that's not already known to work on real hardware. It may help for getting it running but to make sure you should also verify on real hardware at the end. (QEMU's machine emulation is not complete enough to run the orginal firmware of the real machines, at least for PPC Macs, some sparc Suns may work better but I don't know about those.)
If the qemu-ppc64 target were to build successfully, would it also have the same restrictions of only being able to be used by the mac99 machine?
Very likely or not even on that as arch/ppc64 seems to lack all the stuff needed for recognising the machine and fill in the device tree compared to what we have in arch/ppc. I don't know if ppc64 target was ever used for anything or if it's just a provision to build for that platform but was never finished.
For further context, I'm doing this as a part of working on GRUB's testing. Checking again though, it looks like GRUB probably only runs in 32-bit mode on PPC64 anyway.
QEMU comes with openbios-ppc binary that's built from qemu-ppc target so if you want to run on that that's what you need to rebuild it from source. I don't know if it's documented, maybe somewhere on QEMU or OpenBIOS wiki.
On Tue, 25 Jan 2022, Glenn Washburn wrote:
I forgot to mention that OpenBIOS seems to work with qemu machine type "g3beige" as well for ppc and ppc64, and this is the default machine for 32-bit PPC. I'm not sure what the difference between g3beige and mac99 is.
It's used in QEMU as default firmware for mac machines (g3beige, mac99) and 40p as well as sparc and apatc64 machines but that's a different binary. The mac99 machine is a bit strange in that it emulates different machines depedning on how you run it: it's a G4 Mac with cuda/ADB by default in qemu-system-ppc -M mac99 (something like some PowerBooks) but a G5 Mac in qemu-system-ppc64 -M mac99. None of these are like any real machine though, the closest is actually qemu-system-ppc -M mac99,via=pmu which is most simliar to a PowetMac3,1 that has PMU/USB but not every detail is emulated. The g3beige is an older G3 Mac that has slightly different hardware although much of the code is shared in QEMU. Look in qemu/hw/ppc/mac_oldworld.c and qemu/hw/ppc/mac_newworld.c for details. Maybe this is also explained somewhere in QEMU docs or wiki.
Regards, BALATON Zoltan
On Wed, 26 Jan 2022 00:59:24 +0100 (CET) BALATON Zoltan balaton@eik.bme.hu wrote:
On Tue, 25 Jan 2022, Glenn Washburn wrote:
Hi Balaton,
On Tue, 25 Jan 2022 14:01:38 +0100 (CET) BALATON Zoltan balaton@eik.bme.hu wrote:
On Mon, 24 Jan 2022, Glenn Washburn wrote:
On Mon, 24 Jan 2022 08:04:07 +0000 Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
On 20/01/2022 21:12, Glenn Washburn wrote:
Hi list,
I've gotten the qemu-ppc target to build correctly, however, I'm having issues with the qemu-ppc64 target. I'm using the 10.1.0 GCC ppc64 compiler distributed at kernel.org[1].
I'm doing the following: $ PATH=/home/user/cross/gcc-10.1.0-nolibc/powerpc64-linux/bin:$PATH $ ./config/scripts/switch-arch qemu-ppc64 $ make V=1
The make is fine until the forthstrap command, which has this output: ./forthstrap -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/lib/ -I/home/user/openbios.git/forth/device/ -I/home/user/openbios.git/forth/debugging/ -I/home/user/openbios.git/forth/admin/ -I/home/user/openbios.git/forth/util/ -I/home/user/openbios.git/forth/packages/ -I/home/user/openbios.git/forth/system/ -I/home/user/openbios.git/libopenbios/ -I/home/user/openbios.git/packages/ -I/home/user/openbios.git/drivers/ -I/home/user/openbios.git/arch/ppc/ -I/home/user/openbios.git -I./forth -D bootstrap.dict -M bootstrap.dict.d -c bootstrap.dict-console.log forth/bootstrap/start.fs panic: segmentation violation at 0xa6dbc62c dict=0x7fa7a6dbc010 here=0x7fa7a6dbc638(dict+0x628) pc=0x0(dict+0x59243ff0) dstackcnt=0 rstackcnt=0 instruction=deadbeef dstack: 0x0 rstack: 0x0 Writing dictionary core file
Is anyone else seeing this? Can someone with forth experience help here?
Glenn
[1] https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/10.1.0/...
I haven't tried building with a powerpc64 compiler for a while as the output binary for ppc is always 32-bit. IIRC there is some runtime patching around rfi/rfid and management of the MSR_SF flag to allow things to work under both qemu-system-ppc and qemu-system-ppc64.
Can you get a backtrace from the above? You'll need to clear out any existing obj-* directories and tweak HOSTCFLAGS and CFLAGS in Makefile.target to specify -O0 -g before re-running switch-arch.
Here's backtrace output ia GDB.
Not sure what do you want to do with qemu-ppc64 but the only tested and working config is qemu-ppc which should also work with 64bit PPC but only used for qemu-system-ppc64 -M mac99 which is some G5 Mac like hardware (incomplete emulation of a G5 Mac with a U3 chipset) but still says PowerMac3,1 in the device tree which might confuse anything else than Linux.
Thank you for confirming that qemu-ppc64 is not working. My naive intent was to use the 64bit firmware for the 64bit PPC QEMU. The documentation leads one to believe that this is a valid build target. Perhaps it should be removed or at least documented that it does not work?
There are a lot of things that could be improved but there aren't many developers working on OpenBIOS. In fact Matk is alone and doesn't have much time for it so apart from the regularly used parts others may have shortcomings. In the past I think OpenBIOS was used by other projects too and remnants of that are still there but nowadays it's mostly only used for QEMU's ppc and sparc targets so only those are likely to work. It's still not identical to the original firmware of those machines so it probably boots common OSes but may have some differences or missing parts compared to real hardware. This may be a limitation for testing software that's not already known to work on real hardware. It may help for getting it running but to make sure you should also verify on real hardware at the end. (QEMU's machine emulation is not complete enough to run the orginal firmware of the real machines, at least for PPC Macs, some sparc Suns may work better but I don't know about those.)
If the qemu-ppc64 target were to build successfully, would it also have the same restrictions of only being able to be used by the mac99 machine?
Very likely or not even on that as arch/ppc64 seems to lack all the stuff needed for recognising the machine and fill in the device tree compared to what we have in arch/ppc. I don't know if ppc64 target was ever used for anything or if it's just a provision to build for that platform but was never finished.
For further context, I'm doing this as a part of working on GRUB's testing. Checking again though, it looks like GRUB probably only runs in 32-bit mode on PPC64 anyway.
QEMU comes with openbios-ppc binary that's built from qemu-ppc target so if you want to run on that that's what you need to rebuild it from source. I don't know if it's documented, maybe somewhere on QEMU or OpenBIOS wiki.
On Tue, 25 Jan 2022, Glenn Washburn wrote:
I forgot to mention that OpenBIOS seems to work with qemu machine type "g3beige" as well for ppc and ppc64, and this is the default machine for 32-bit PPC. I'm not sure what the difference between g3beige and mac99 is.
It's used in QEMU as default firmware for mac machines (g3beige, mac99) and 40p as well as sparc and apatc64 machines but that's a different binary. The mac99 machine is a bit strange in that it emulates different machines depedning on how you run it: it's a G4 Mac with cuda/ADB by default in qemu-system-ppc -M mac99 (something like some PowerBooks) but a G5 Mac in qemu-system-ppc64 -M mac99. None of these are like any real machine though, the closest is actually qemu-system-ppc -M mac99,via=pmu which is most simliar to a PowetMac3,1 that has PMU/USB but not every detail is emulated. The g3beige is an older G3 Mac that has slightly different hardware although much of the code is shared in QEMU. Look in qemu/hw/ppc/mac_oldworld.c and qemu/hw/ppc/mac_newworld.c for details. Maybe this is also explained somewhere in QEMU docs or wiki.
Thanks for the details. Sounds like mac99,via=pmu is what should be used for test GRUB since its closest to a real machine. I think I'll discontinue with trying to get PPC64 to build because it doesn't seem that useful for me.
Glenn
On Tue, 25 Jan 2022 14:01:38 +0100 (CET) BALATON Zoltan balaton@eik.bme.hu wrote:
On Mon, 24 Jan 2022, Glenn Washburn wrote:
On Mon, 24 Jan 2022 08:04:07 +0000 Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
On 20/01/2022 21:12, Glenn Washburn wrote:
Hi list,
I've gotten the qemu-ppc target to build correctly, however, I'm having issues with the qemu-ppc64 target. I'm using the 10.1.0 GCC ppc64 compiler distributed at kernel.org[1].
I'm doing the following: $ PATH=/home/user/cross/gcc-10.1.0-nolibc/powerpc64-linux/bin:$PATH $ ./config/scripts/switch-arch qemu-ppc64 $ make V=1
The make is fine until the forthstrap command, which has this output: ./forthstrap -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/lib/ -I/home/user/openbios.git/forth/device/ -I/home/user/openbios.git/forth/debugging/ -I/home/user/openbios.git/forth/admin/ -I/home/user/openbios.git/forth/util/ -I/home/user/openbios.git/forth/packages/ -I/home/user/openbios.git/forth/system/ -I/home/user/openbios.git/libopenbios/ -I/home/user/openbios.git/packages/ -I/home/user/openbios.git/drivers/ -I/home/user/openbios.git/arch/ppc/ -I/home/user/openbios.git -I./forth -D bootstrap.dict -M bootstrap.dict.d -c bootstrap.dict-console.log forth/bootstrap/start.fs panic: segmentation violation at 0xa6dbc62c dict=0x7fa7a6dbc010 here=0x7fa7a6dbc638(dict+0x628) pc=0x0(dict+0x59243ff0) dstackcnt=0 rstackcnt=0 instruction=deadbeef dstack: 0x0 rstack: 0x0 Writing dictionary core file
Is anyone else seeing this? Can someone with forth experience help here?
Glenn
[1] https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/x86_64/10.1.0/...
I haven't tried building with a powerpc64 compiler for a while as the output binary for ppc is always 32-bit. IIRC there is some runtime patching around rfi/rfid and management of the MSR_SF flag to allow things to work under both qemu-system-ppc and qemu-system-ppc64.
Can you get a backtrace from the above? You'll need to clear out any existing obj-* directories and tweak HOSTCFLAGS and CFLAGS in Makefile.target to specify -O0 -g before re-running switch-arch.
Here's backtrace output ia GDB.
Not sure what do you want to do with qemu-ppc64 but the only tested and working config is qemu-ppc which should also work with 64bit PPC but only used for qemu-system-ppc64 -M mac99 which is some G5 Mac like hardware (incomplete emulation of a G5 Mac with a U3 chipset) but still says PowerMac3,1 in the device tree which might confuse anything else than Linux.
I forgot to mention that OpenBIOS seems to work with qemu machine type "g3beige" as well for ppc and ppc64, and this is the default machine for 32-bit PPC. I'm not sure what the difference between g3beige and mac99 is.
Glenn
On Tue, Jan 25, 2022 at 03:49:13PM -0600, Glenn Washburn wrote:
I forgot to mention that OpenBIOS seems to work with qemu machine type "g3beige" as well for ppc and ppc64, and this is the default machine for 32-bit PPC. I'm not sure what the difference between g3beige and mac99 is.
g3beige is the first G3 Power Mac. mac99 is what "New World" is called internally (or it is just the hardware originally I think?), but here it means the "Blue and White" machine. This machine not only looks like the first iMac (in a tower case though), but its hardware and software are a lot like it as well (the codename of the iMac is "Columbus" btw :-) )
Segher
On 25/01/2022 00:03, Glenn Washburn wrote:
Here's backtrace output ia GDB.
Starting program: /home/user/openbios.git/obj-ppc64/forthstrap -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/lib/ -I/home/user/openbios.git/forth/device/ -I/home/user/openbios.git/forth/debugging/ -I/home/user/openbios.git/forth/admin/ -I/home/user/openbios.git/forth/util/ -I/home/user/openbios.git/forth/packages/ -I/home/user/openbios.git/forth/system/ -I/home/user/openbios.git/libopenbios/ -I/home/user/openbios.git/packages/ -I/home/user/openbios.git/drivers/ -I/home/user/openbios.git/arch/ppc/ -I/home/user/openbios.git -I./forth -D bootstrap.dict -M bootstrap.dict.d -c bootstrap.dict-console.log forth/bootstrap/start.fs
Program received signal SIGSEGV, Segmentation fault. 0x00005555555575e9 in findword (s1=0x55555555f112 "(semis)") at /home/user/openbios.git/kernel/dict.c:118 118 tmplfa = read_ucell(cell2pointer(tmplfa)); (gdb) bt #0 0x00005555555575e9 in findword (s1=0x55555555f112 "(semis)") at /home/user/openbios.git/kernel/dict.c:118 #1 0x0000555555559781 in interpret_source ( fil=0x7fffffffe33a "forth/bootstrap/start.fs") at /home/user/openbios.git/kernel/bootstrap.c:591 #2 0x000055555555a9f0 in new_dictionary ( source=0x7fffffffe33a "forth/bootstrap/start.fs") at /home/user/openbios.git/kernel/bootstrap.c:1059 #3 0x000055555555ae66 in main (argc=23, argv=0x7fffffffddb8) at /home/user/openbios.git/kernel/bootstrap.c:1286
Well that certainly looks like something has gone wrong with cell2pointer() on the ppc64 build. IIRC the output of the Forth interpreter is echoed to stderr so you should be able to see how far it got parsing start.fs by looking at bootstrap.dict-console.log.
Alternatively since the 32-bit build is used on both ppc32 and ppc64 machines, it may make sense just to leave this unless you are particularly interested in getting a full-fledged 64-bit build up and running.
ATB,
Mark.
On Thu, 27 Jan 2022, Mark Cave-Ayland wrote:
On 25/01/2022 00:03, Glenn Washburn wrote:
Here's backtrace output ia GDB.
Starting program: /home/user/openbios.git/obj-ppc64/forthstrap -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/lib/ -I/home/user/openbios.git/forth/device/ -I/home/user/openbios.git/forth/debugging/ -I/home/user/openbios.git/forth/admin/ -I/home/user/openbios.git/forth/util/ -I/home/user/openbios.git/forth/packages/ -I/home/user/openbios.git/forth/system/ -I/home/user/openbios.git/libopenbios/ -I/home/user/openbios.git/packages/ -I/home/user/openbios.git/drivers/ -I/home/user/openbios.git/arch/ppc/ -I/home/user/openbios.git -I./forth -D bootstrap.dict -M bootstrap.dict.d -c bootstrap.dict-console.log forth/bootstrap/start.fs
Program received signal SIGSEGV, Segmentation fault. 0x00005555555575e9 in findword (s1=0x55555555f112 "(semis)") at /home/user/openbios.git/kernel/dict.c:118 118 tmplfa = read_ucell(cell2pointer(tmplfa)); (gdb) bt #0 0x00005555555575e9 in findword (s1=0x55555555f112 "(semis)") at /home/user/openbios.git/kernel/dict.c:118 #1 0x0000555555559781 in interpret_source ( fil=0x7fffffffe33a "forth/bootstrap/start.fs") at /home/user/openbios.git/kernel/bootstrap.c:591 #2 0x000055555555a9f0 in new_dictionary ( source=0x7fffffffe33a "forth/bootstrap/start.fs") at /home/user/openbios.git/kernel/bootstrap.c:1059 #3 0x000055555555ae66 in main (argc=23, argv=0x7fffffffddb8) at /home/user/openbios.git/kernel/bootstrap.c:1286
Well that certainly looks like something has gone wrong with cell2pointer() on the ppc64 build. IIRC the output of the Forth interpreter is echoed to stderr so you should be able to see how far it got parsing start.fs by looking at bootstrap.dict-console.log.
I think it may not be printed on console with default silent build but may be in a log file somewhere in the obj-ppc* dir. Also running make V=1 may or may not help, at least I have that in my build script for some reason I forgot.
Regards, BALATON Zoltan
On 27/01/2022 15:52, BALATON Zoltan wrote:
On Thu, 27 Jan 2022, Mark Cave-Ayland wrote:
On 25/01/2022 00:03, Glenn Washburn wrote:
Here's backtrace output ia GDB.
Starting program: /home/user/openbios.git/obj-ppc64/forthstrap -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/lib/ -I/home/user/openbios.git/forth/device/ -I/home/user/openbios.git/forth/debugging/ -I/home/user/openbios.git/forth/admin/ -I/home/user/openbios.git/forth/util/ -I/home/user/openbios.git/forth/packages/ -I/home/user/openbios.git/forth/system/ -I/home/user/openbios.git/libopenbios/ -I/home/user/openbios.git/packages/ -I/home/user/openbios.git/drivers/ -I/home/user/openbios.git/arch/ppc/ -I/home/user/openbios.git -I./forth -D bootstrap.dict -M bootstrap.dict.d -c bootstrap.dict-console.log forth/bootstrap/start.fs
Program received signal SIGSEGV, Segmentation fault. 0x00005555555575e9 in findword (s1=0x55555555f112 "(semis)") at /home/user/openbios.git/kernel/dict.c:118 118 tmplfa = read_ucell(cell2pointer(tmplfa)); (gdb) bt #0 0x00005555555575e9 in findword (s1=0x55555555f112 "(semis)") at /home/user/openbios.git/kernel/dict.c:118 #1 0x0000555555559781 in interpret_source ( fil=0x7fffffffe33a "forth/bootstrap/start.fs") at /home/user/openbios.git/kernel/bootstrap.c:591 #2 0x000055555555a9f0 in new_dictionary ( source=0x7fffffffe33a "forth/bootstrap/start.fs") at /home/user/openbios.git/kernel/bootstrap.c:1059 #3 0x000055555555ae66 in main (argc=23, argv=0x7fffffffddb8) at /home/user/openbios.git/kernel/bootstrap.c:1286
Well that certainly looks like something has gone wrong with cell2pointer() on the ppc64 build. IIRC the output of the Forth interpreter is echoed to stderr so you should be able to see how far it got parsing start.fs by looking at bootstrap.dict-console.log.
I think it may not be printed on console with default silent build but may be in a log file somewhere in the obj-ppc* dir. Also running make V=1 may or may not help, at least I have that in my build script for some reason I forgot.
Right, that's the one. I'd expect it to be bootstrap.dict-console.log from the command line above but several .log files do get generated in the obj-ppc* directories as part of the Forth bootstrap process.
ATB,
Mark.
On Thu, 27 Jan 2022 16:05:56 +0000 Mark Cave-Ayland mark.cave-ayland@ilande.co.uk wrote:
On 27/01/2022 15:52, BALATON Zoltan wrote:
On Thu, 27 Jan 2022, Mark Cave-Ayland wrote:
On 25/01/2022 00:03, Glenn Washburn wrote:
Here's backtrace output ia GDB.
Starting program: /home/user/openbios.git/obj-ppc64/forthstrap -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/bootstrap/ -I/home/user/openbios.git/forth/lib/ -I/home/user/openbios.git/forth/device/ -I/home/user/openbios.git/forth/debugging/ -I/home/user/openbios.git/forth/admin/ -I/home/user/openbios.git/forth/util/ -I/home/user/openbios.git/forth/packages/ -I/home/user/openbios.git/forth/system/ -I/home/user/openbios.git/libopenbios/ -I/home/user/openbios.git/packages/ -I/home/user/openbios.git/drivers/ -I/home/user/openbios.git/arch/ppc/ -I/home/user/openbios.git -I./forth -D bootstrap.dict -M bootstrap.dict.d -c bootstrap.dict-console.log forth/bootstrap/start.fs
Program received signal SIGSEGV, Segmentation fault. 0x00005555555575e9 in findword (s1=0x55555555f112 "(semis)") at /home/user/openbios.git/kernel/dict.c:118 118 tmplfa = read_ucell(cell2pointer(tmplfa)); (gdb) bt #0 0x00005555555575e9 in findword (s1=0x55555555f112 "(semis)") at /home/user/openbios.git/kernel/dict.c:118 #1 0x0000555555559781 in interpret_source ( fil=0x7fffffffe33a "forth/bootstrap/start.fs") at /home/user/openbios.git/kernel/bootstrap.c:591 #2 0x000055555555a9f0 in new_dictionary ( source=0x7fffffffe33a "forth/bootstrap/start.fs") at /home/user/openbios.git/kernel/bootstrap.c:1059 #3 0x000055555555ae66 in main (argc=23, argv=0x7fffffffddb8) at /home/user/openbios.git/kernel/bootstrap.c:1286
Well that certainly looks like something has gone wrong with cell2pointer() on the ppc64 build. IIRC the output of the Forth interpreter is echoed to stderr so you should be able to see how far it got parsing start.fs by looking at bootstrap.dict-console.log.
I think it may not be printed on console with default silent build but may be in a log file somewhere in the obj-ppc* dir. Also running make V=1 may or may not help, at least I have that in my build script for some reason I forgot.
Right, that's the one. I'd expect it to be bootstrap.dict-console.log from the command line above but several .log files do get generated in the obj-ppc* directories as part of the Forth bootstrap process.
The only log file being created is the build.log. I think its choking at the very beginning.
Glenn