qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: OpenMPIC controller emulation in qemu ?


From: Andrew Randrianasulu
Subject: Re: OpenMPIC controller emulation in qemu ?
Date: Fri, 17 May 2024 16:01:27 +0300



On Fri, May 17, 2024 at 11:41 AM BALATON Zoltan <balaton@eik.bme.hu> wrote:
On Fri, 17 May 2024, Andrew Randrianasulu wrote:
> On Fri, May 17, 2024 at 12:02 AM Mark Cave-Ayland <
> mark.cave-ayland@ilande.co.uk> wrote:
>
>> On 16/05/2024 14:51, Andrew Randrianasulu wrote:
>>
>>>     > and openfirmware starts ....
>>>     >
>>>     > bash-5.1$ build/qemu-system-ppc -M mac99 -smp 2 -nographic
>>>     >
>>>     >>> =============================================================
>>>     >>> OpenBIOS 1.1 [Mar 7 2023 22:21]
>>>     >>> Configuration device id QEMU version 1 machine id 1
>>>     >>> CPUs: 2
>>>     >>> Memory: 128M
>>>     >>> UUID: 00000000-0000-0000-0000-000000000000
>>>     >>> CPU type PowerPC,G4
>>>     > milliseconds isn't unique.
>>>     > Welcome to OpenBIOS v1.1 built on Mar 7 2023 22:21
>>>     > Trying hd:,\\:tbxi...
>>>     > Trying hd:,\ppc\bootinfo.txt...
>>>     > Trying hd:,%BOOT...
>>>     > No valid state has been set by load or init-program
>>>     >
>>>     > 0 >
>>
>> You can check the device tree in OpenBIOS by using show-devs to see how
>> many CPUs are
>> present, and confirm that the properties are set correctly.
>>
>> The reason that SMP hasn't been enabled for the Mac machines is mainly
>> because no-one
>> has been inclined to work on it yet ;)
>>
>>>     >
>>>     >
>>>     >
>>>     > but boooting finnix fails:
>>>     >
>>>     > bash-5.1$ build/qemu-system-ppc -M mac99 -smp 2 -nographic -cdrom
>>>     > ~/finnix-ppc-110.iso -boot d
>>>     >
>>>     >>> =============================================================
>>>     >>> OpenBIOS 1.1 [Mar 7 2023 22:21]
>>>     >>> Configuration device id QEMU version 1 machine id 1
>>>     >>> CPUs: 2
>>>     >>> Memory: 128M
>>>     >>> UUID: 00000000-0000-0000-0000-000000000000
>>>     >>> CPU type PowerPC,G4
>>>     > milliseconds isn't unique.
>>>     > Welcome to OpenBIOS v1.1 built on Mar 7 2023 22:21
>>>     > Trying cd:,\\:tbxi...
>>>     >>> switching to new context:
>>>     >
>>>     > я:interpret: exception -13 caught
>>>
>>>     There's a comment in openbios/forth/system/ciface.fs that says it
>> might
>>>     not be an error and also a line:
>>>
>>>     \ ." INTERPRETE: --- " 2dup type
>>>
>>>     where you could remove the \ to get it print the Forth code that
>> causes
>>>     the error. (By the way is INTERPRETE a typo with extra E at the end?)
>>>
>>>
>>>
>>> I tried this and get:
>>>
>>> bash-5.1$ build/qemu-system-ppc -M mac99 -smp 4 -nographic -cdrom
>>> ~/finnix-ppc-110.iso -boot d -bios /dev/shm/openbios-qemu.elf
>>>
>>> >> =============================================================
>>> >> OpenBIOS 1.1 [May 16 2024 12:44]
>>> >> Configuration device id QEMU version 1 machine id 1
>>> >> CPUs: 4
>>> >> Memory: 128M
>>> >> UUID: 00000000-0000-0000-0000-000000000000
>>> >> CPU type PowerPC,G4
>>> milliseconds isn't unique.
>>> Welcome to OpenBIOS v1.1 built on May 16 2024 12:44
>>> Trying cd:,\\:tbxi...
>>> >> switching to new context:
>>>
>>> я:interpret: exception -13 caughte-int nip nip ;
>>>
>>> =====
>>
>> Try rebuilding OpenBIOS with DEBUG_CIF enabled in libopenbios/client.c
>> which will
>> show the calls being used by the bootloader.
>>
>
>
> ===============
>
> bash-5.1$ build/qemu-system-ppc -M mac99 -smp 2 -nographic -cdrom
> ~/finnix-ppc-110.iso -boot d -bios /dev/shm/openbios-qemu.elf

Add -d unimp,guest_errors here. If it crashes you won't see an error
without that so having these debug options enabled helps finding where it
stopped.

>>> =============================================================
>>> OpenBIOS 1.1 [May 17 2024 00:06]
>>> Configuration device id QEMU version 1 machine id 1
>>> CPUs: 2
>>> Memory: 128M
>>> UUID: 00000000-0000-0000-0000-000000000000
>>> CPU type PowerPC,G4
> milliseconds isn't unique.
> Welcome to OpenBIOS v1.1 built on May 17 2024 00:06
> Trying cd:,\\:tbxi...
>>> switching to new context:
>>> finddevice("/chosen") = 0xfff57108
>>> exit()
> EXIT
> 0 >   ok
> 0 > show-devs
> fff56d28 / (bootrom)
> fff56e44 /aliases
> fff56ee8 /openprom (BootROM)
> fff5d110 /openprom/client-services
> fff57090 /options
> fff57108 /chosen
> fff571b8 /builtin
> fff5725c /builtin/console
> fff5ce1c /packages
> fff5e000 /packages/cmdline
> fff5e140 /packages/disk-label
> fff5fe64 /packages/terminal-emulator
> fff60ed0 /packages/deblocker
> fff61224 /packages/hfsplus-files
> fff615b0 /packages/hfs-files
> fff61938 /packages/ext2-files
> fff61c5c /packages/iso9660-files
> fff61f80 /packages/grubfs-files
> fff622a4 /packages/mac-parts
> fff62608 /packages/pc-parts
> fff62928 /packages/xcoff-loader
> fff629f4 /packages/elf-loader
> fff62abc /packages/bootinfo-loader
> fff5fb8c /cpus
> fff6bdf8 /cpus/PowerPC,G4@0 (cpu)
> fff5fc8c /memory@0 (memory)
> fff5fd54 /rom@ff800000
> fff62be8 /nvram@fff04000 (nvram)
> fff62e80 /pci@f2000000 (pci)
> fff633a8 /pci@f2000000/mac-io@c (mac-io)
> fff63868 /pci@f2000000/mac-io@c/via-cuda@16000 (via-cuda)
> fff63a88 /pci@f2000000/mac-io@c/via-cuda@16000/adb (adb)
> fff63bf0 /pci@f2000000/mac-io@c/via-cuda@16000/adb/keyboard@8 (keyboard)
> fff63dcc /pci@f2000000/mac-io@c/via-cuda@16000/adb/mouse@9 (mouse)
> fff63f58 /pci@f2000000/mac-io@c/via-cuda@16000/rtc (rtc)
> fff640e8 /pci@f2000000/mac-io@c/via-cuda@16000/power-mgt (power-mgt)
> fff642d0 /pci@f2000000/mac-io@c/escc@13000 (escc)
> fff643f0 /pci@f2000000/mac-io@c/escc@13000/ch-a@13020 (serial)
> fff64648 /pci@f2000000/mac-io@c/escc@13000/ch-b@13000 (serial)
> fff64910 /pci@f2000000/mac-io@c/escc-legacy@12000 (escc-legacy)
> fff64a34 /pci@f2000000/mac-io@c/escc-legacy@12000/ch-a@12002 (serial)
> fff64c50 /pci@f2000000/mac-io@c/escc-legacy@12000/ch-b@12000 (serial)
> fff64edc /pci@f2000000/mac-io@c/ata-3@20000 (ata)
> fff652ac /pci@f2000000/mac-io@c/ata-3@21000 (ata)
> fff6567c /pci@f2000000/mac-io@c/ata-3@21000/cdrom@0 (block)
> fff65b18 /pci@f2000000/mac-io@c/interrupt-controller@40000 (open-pic)
> fff65d68 /pci@f2000000/usb@d (usb)
> fff660b4 /pci@f2000000/QEMU,VGA@e (display)
> fff6b688 /pci@f2000000/ethernet@f (network)
> fff6bc0c /uni-n@f8000000 (memory-controller)
> ok
> 0 >
>
> ==================
>
> I think this mean forth just jumps back to its interpreter instead of
> booting after enabling debug ?

It seems to be looking for something in chosen which is probably missing.
Where's this Forth script that it runs?

strange thing, I left it overnight and more was printed:

>> =============================================================
>> OpenBIOS 1.1 [May 17 2024 00:06]
>> Configuration device id QEMU version 1 machine id 1
>> CPUs: 2
>> Memory: 128M
>> UUID: 00000000-0000-0000-0000-000000000000
>> CPU type PowerPC,G4
milliseconds isn't unique.
Welcome to OpenBIOS v1.1 built on May 17 2024 00:06
Trying cd:,\\:tbxi...
>> switching to new context:
>> finddevice("/chosen") = 0xfff57108
>> finddevice("/options") = 0xfff57090
>> getprop(0xfff57108, "stdout", 0x002305f4, 4) = 4
>> 0x002305f4  07 c5 b1 54 __ __ __ __ __ __ __ __ __ __ __ __  .Е±T
>> getprop(0xfff57108, "stdin", 0x002305f8, 4) = 4
>> 0x002305f8  07 c5 ab 70 __ __ __ __ __ __ __ __ __ __ __ __  .Е«p
>> getprop(0xfff57108, "memory", 0x0023385c, 4) = 4
>> 0x0023385c  07 c5 a9 5c __ __ __ __ __ __ __ __ __ __ __ __  .Е©\
>> getprop(0xfff57108, "mmu", 0x00233758, 4) = 4
>> 0x00233758  07 c5 a7 50 __ __ __ __ __ __ __ __ __ __ __ __  .Е§P

>> of_client_interface: interpret 0021efa0
 ([1] -- [1])ethod ;w then ;0= ;int nip nip ;
>> handle_calls return: 00000000
>> of_client_interface: interpret 0021f018
>> interpret  " /chosen" find-package if dup " memory" rot GPP$ if D2NIP swap " mmu" rot GPP$ if D2NIP elsevalue mmu# value mem#  ([1] -- [1])
>> handle_calls return: 00000000
>> of_client_interface: interpret 0021f0b4
>> interpret : ^mem mem# $CM ; : ^mmu mmu# $CM ;  ([1] -- [1])
>> handle_calls return: 00000000
>> claim(0x00300000, 1048576, 0) = 0x00300000
>> finddevice("/") = 0xfff56d28
>> getprop(0xfff56d28, "CODEGEN,vendor", 0x00232650, 256) = -1
>> getprop(0xfff56d28, "device_type", 0x00232650, 256) = 8
>> 0x00232650  62 6f 6f 74 72 6f 6d 00 __ __ __ __ __ __ __ __  bootrom.
>> getprop(0xfff56d28, "model", 0x00232650, 256) = 12
>> 0x00232650  50 6f 77 65 72 4d 61 63 33 2c 31 00 __ __ __ __  PowerMac3,1.
>> of_client_interface: interpret 0021e8b8
>> interpret " _screen-ihandle" $find if execute else 0 then ([1] -- [2])
>> interpret '" _screen-ihandle" $find if execute else 0 then': possible argument error (-1--2) got 2
>> handle_calls return: 00000000 00000000
>> instance-to-package(0x07c5b154) = 0xfff643f0
>> getprop(0xfff643f0, "device_type", 0x07de7b90, 32) = 7
>> 0x07de7b90  73 65 72 69 61 6c 00 __ __ __ __ __ __ __ __ __  serial.
>> open("screen") = 0x07c5b4c4
>> of_client_interface: call-method 0021eec4 07c5b4c4 00000000 00000000 00000000 00000000
>> call-method color! ([6] -- [1])
call-method color!: exception -21
>> call-method color! failed with error ffffffdf
>> of_client_interface: call-method 0021eec4 07c5b4c4 00000001 000000aa 00000000 00000000
>> call-method color! ([6] -- [1])
call-method color!: exception -21
>> call-method color! failed with error ffffffdf
>> of_client_interface: call-method 0021eec4 07c5b4c4 00000002 00000000 000000aa 00000000
>> call-method color! ([6] -- [1])
call-method color!: exception -21
>> call-method color! failed with error ffffffdf
>> of_client_interface: call-method 0021eec4 07c5b4c4 00000003 000000aa 000000aa 00000000
>> call-method color! ([6] -- [1])
call-method color!: exception -21
>> call-method color! failed with error ffffffdf
>> of_client_interface: call-method 0021eec4 07c5b4c4 00000004 00000000 00000000 000000aa
>> call-method color! ([6] -- [1])
call-method color!: exception -21
>> call-method color! failed with error ffffffdf
>> of_client_interface: call-method 0021eec4 07c5b4c4 00000005 000000aa 00000000 000000aa
>> call-method color! ([6] -- [1])
call-method color!: exception -21
>> call-method color! failed with error ffffffdf
>> of_client_interface: call-method 0021eec4 07c5b4c4 00000006 00000000 00000055 000000aa
>> call-method color! ([6] -- [1])
call-method color!: exception -21
>> call-method color! failed with error ffffffdf
>> of_client_interface: call-method 0021eec4 07c5b4c4 00000007 000000aa 000000aa 000000aa
>> call-method color! ([6] -- [1])
call-method color!: exception -21
>> call-method color! failed with error ffffffdf
>> of_client_interface: call-method 0021eec4 07c5b4c4 00000008 00000055 00000055 00000055
>> call-method color! ([6] -- [1])
call-method color!: exception -21
>> call-method color! failed with error ffffffdf
>> of_client_interface: call-method 0021eec4 07c5b4c4 00000009 000000ff 00000055 00000055
>> call-method color! ([6] -- [1])
call-method color!: exception -21
>> call-method color! failed with error ffffffdf
>> of_client_interface: call-method 0021eec4 07c5b4c4 0000000a 00000055 000000ff 00000055
>> call-method color! ([6] -- [1])
call-method color!: exception -21
>> call-method color! failed with error ffffffdf
>> of_client_interface: call-method 0021eec4 07c5b4c4 0000000b 000000ff 000000ff 00000055
>> call-method color! ([6] -- [1])
call-method color!: exception -21
>> call-method color! failed with error ffffffdf
>> of_client_interface: call-method 0021eec4 07c5b4c4 0000000c 00000055 00000055 000000ff
>> call-method color! ([6] -- [1])
call-method color!: exception -21
>> call-method color! failed with error ffffffdf
>> of_client_interface: call-method 0021eec4 07c5b4c4 0000000d 000000ff 00000055 000000ff
>> call-method color! ([6] -- [1])
call-method color!: exception -21
>> call-method color! failed with error ffffffdf
>> of_client_interface: call-method 0021eec4 07c5b4c4 0000000e 00000055 000000ff 000000ff
>> call-method color! ([6] -- [1])
call-method color!: exception -21
>> call-method color! failed with error ffffffdf
>> of_client_interface: call-method 0021eec4 07c5b4c4 0000000f 000000ff 000000ff 000000ff
>> call-method color! ([6] -- [1])
call-method color!: exception -21
>> call-method color! failed with error ffffffdf

>> getprop(0xfff57108, "bootargs", 0x002455ec, 1024) = 1
>> 0x002455ec  00 __ __ __ __ __ __ __ __ __ __ __ __ __ __ __  .
>> getprop(0xfff57108, "bootpath", 0x00244dec, 2048) = 54
>> 0x00244dec  2f 70 63 69 40 66 32 30 30 30 30 30 30 2f 6d 61  /pci@f2000000/ma
>> 0x00244dfc  63 2d 69 6f 40 63 2f 61 74 61 2d 33 40 32 31 30  c-io@c/ata-3@210
>> 0x00244e0c  30 30 2f 63 64 72 6f 6d 40 30 3a 32 2c 5c 5c 79  00/cdrom@0:2,\\y
>> 0x00244e1c  61 62 6f 6f 74 00 __ __ __ __ __ __ __ __ __ __  aboot.
>> getprop(0xfff57090, "ibm,client-architecture-support-reboot", 0x002305e4, 4) = -1
>> getprop(0xfff57090, "ibm,fw-nbr-reboots", 0x002305e4, 4) = -1
>> getprop(0xfff57090, "boot-once", 0x002449ec, 1024) = -1
>> setprop(0xfff57090, "boot-once", 0x00000000, 0)
>>  = 0
>> finddevice("/pci@f2000000/mac-io@c/ata-3@21000/cdrom@0:2,\\yaboot") = 0xfff6567c
>> getprop(0xfff6567c, "device_type", 0x07de7b08, 63) = 6
>> 0x07de7b08  62 6c 6f 63 6b 00 __ __ __ __ __ __ __ __ __ __  block.
>> finddevice("/pci@f2000000/mac-io@c/ata-3@21000/cdrom@0") = 0xfff6567c
>> getprop(0xfff6567c, "device_type", 0x07de7b38, 63) = 6
>> 0x07de7b38  62 6c 6f 63 6b 00 __ __ __ __ __ __ __ __ __ __  block.
>> finddevice("/pci@f2000000/mac-io@c/ata-3@21000/cdrom@0") = 0xfff6567c
>> getprop(0xfff6567c, "device_type", 0x07de7a78, 63) = 6
>> 0x07de7a78  62 6c 6f 63 6b 00 __ __ __ __ __ __ __ __ __ __  block.
>> open("/pci@f2000000/mac-io@c/ata-3@21000/cdrom@0:0") = 0x07c5b6b0
>> of_client_interface: call-method 0021ece0 07c5b6b0
>> call-method block-size ([2] -- [2])
>> handle_calls return: 00000000 00000200
>> of_client_interface: call-method 0021ece0 07c5b6b0
>> call-method block-size ([2] -- [2])
>> handle_calls return: 00000000 00000200
>> of_client_interface: call-method 0021ece0 07c5b6b0
>> call-method block-size ([2] -- [2])
>> handle_calls return: 00000000 00000200
>> of_client_interface: call-method 0021ece0 07c5b6b0
>> call-method block-size ([2] -- [2])
>> handle_calls return: 00000000 00000200
>> close(0x07c5b6b0)
>> open("/pci@f2000000/mac-io@c/ata-3@21000/cdrom@0:0") = 0x07c5b8c0
>> close(0x07c5b8c0)
>> open("/pci@f2000000/mac-io@c/ata-3@21000/cdrom@0:0") = 0x07c5bad0
>> close(0x07c5bad0)
>> open("/pci@f2000000/mac-io@c/ata-3@21000/cdrom@0:0") = 0x07c5bce0
>> close(0x07c5bce0)
>> open("/pci@f2000000/mac-io@c/ata-3@21000/cdrom@0:02,\\yaboot.conf") = 0x07c5bf80
Config file read, 485 bytes
>> close(0x07c5bf80)
>> finddevice("/pci@f2000000/mac-io@c/ata-3@21000/cdrom@0") = 0xfff6567c
>> getprop(0xfff6567c, "device_type", 0x07de7aa8, 63) = 6
>> 0x07de7aa8  62 6c 6f 63 6b 00 __ __ __ __ __ __ __ __ __ __  block.
>> of_client_interface: interpret 07de7b20
>> interpret 0 to background-color ([1] -- [1])
>> handle_calls return: 00000000

>> of_client_interface: interpret 07de7b20
>> interpret f to foreground-color ([1] -- [1])
>> handle_calls return: 00000000
>> finddevice("cd:") = 0xfff6567c
>> getprop(0xfff6567c, "device_type", 0x07de7618, 63) = 6
>> 0x07de7618  62 6c 6f 63 6b 00 __ __ __ __ __ __ __ __ __ __  block.
>> finddevice("cd") = 0xfff6567c
>> getprop(0xfff6567c, "device_type", 0x07de7618, 63) = 6
>> 0x07de7618  62 6c 6f 63 6b 00 __ __ __ __ __ __ __ __ __ __  block.
>> open("cd:0") = 0x07c5c170
>> of_client_interface: call-method 0021ece0 07c5c170
>> call-method block-size ([2] -- [2])
>> handle_calls return: 00000000 00000200
>> of_client_interface: call-method 0021ece0 07c5c170
>> call-method block-size ([2] -- [2])
>> handle_calls return: 00000000 00000200
>> of_client_interface: call-method 0021ece0 07c5c170
>> call-method block-size ([2] -- [2])
>> handle_calls return: 00000000 00000200
>> of_client_interface: call-method 0021ece0 07c5c170
>> call-method block-size ([2] -- [2])
>> handle_calls return: 00000000 00000200
>> close(0x07c5c170)
>> open("cd:0") = 0x07c5c380
>> close(0x07c5c380)
>> open("cd:0") = 0x07c5c590
>> close(0x07c5c590)
>> open("cd:0") = 0x07c5c7a0
>> close(0x07c5c7a0)
>> open("cd:02,\boot\ppc\boot.msg") = 0x07c5ca6c

Finnix version 110                                    http://www.finnix.org/
Copyright (C) 1999-2000, 2005-2014 Ryan Finnie        http://www.finnie.org/

Compiled: Thu May  1 04:13:20 PDT 2014
Available boot profiles:
  finnix (default), debug, finnix64, debug64

.
>> close(0x07c5ca6c)
Welcome to yaboot version 1.3.16
Enter "help" to get some basic usage information
>> finddevice("/pci@f2000000/mac-io@c/ata-3@21000/cdrom@0") = 0xfff6567c
>> getprop(0xfff6567c, "device_type", 0x07de7b18, 63) = 6
>> 0x07de7b18  62 6c 6f 63 6b 00 __ __ __ __ __ __ __ __ __ __  block.
>> open("/pci@f2000000/mac-io@c/ata-3@21000/cdrom@0:0") = 0x07c5cc2c
>> of_client_interface: call-method 0021ece0 07c5cc2c
>> call-method block-size ([2] -- [2])
>> handle_calls return: 00000000 00000200
>> of_client_interface: call-method 0021ece0 07c5cc2c
>> call-method block-size ([2] -- [2])
>> handle_calls return: 00000000 00000200
>> of_client_interface: call-method 0021ece0 07c5cc2c
>> call-method block-size ([2] -- [2])
>> handle_calls return: 00000000 00000200
>> of_client_interface: call-method 0021ece0 07c5cc2c
>> call-method block-size ([2] -- [2])
>> handle_calls return: 00000000 00000200
>> close(0x07c5cc2c)

WARNING: Bootstrap partition type is wrong: "Apple_HFS"
         type should be: "Apple_Bootstrap"

boot:

======

sooo ...it booted somehow to yaboot command prompt?

 

> and despite cpu number printed in banner it still only creates one cpu node?

Looks like it's hard coded in
openbios/atch/ppc/qemu/init.c::cpu_generic_init() which only adds one CPU.
But currently it likely stops before that could be a problem.

Regards,
BALATON Zoltan

reply via email to

[Prev in Thread] Current Thread [Next in Thread]