Until r828 was in this way ... then somethink was wrong....
2010/9/13 Laurent Vivier Laurent@vivier.eu
Hi,
the last time I tried to boot AIX (6 or 7 monthes ago...), OpenBIOS was able to load the bootloader but as RTAS is not provided by OpenBIOS, bootloader failed and didn't go further. I think it was with the CHRP emulation.
Regards, Laurent
Hi,
I have tried qemu from 0.11 to latest git (as of 11/09/2010) with latest openbios inside, but if i want to use PREP PPC "machine" the error is the same:
qemu: hardware error: PowerPC 601 / 620 / 970 need a 1MB BIOS
CPU #0: NIP 00000000 LR 00000000 CTR 00000000 XER 00000000 MSR 00000000 HID0 00000000 HF 00000000 idx 0 TB 00000000 00000000 DECR ffffffff GPR00 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR04 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR08 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR12 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR16 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR20 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR24 0000000000000000 0000000000000000 0000000000000000 0000000000000000 GPR28 0000000000000000 0000000000000000 0000000000000000 0000000000000000 CR 00000000 [ - - - - - - - - ] RES 00000000 FPR00 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR04 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR08 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR12 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR16 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR20 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR24 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPR28 0000000000000000 0000000000000000 0000000000000000 0000000000000000 FPSCR 00000000 SRR0 00000000 SRR1 00000000 SDR1 00000000
How can I use openbios to start an AIX with qemu ?
-- Cordiali Saluti/Best Regards
Massimo Montecchi Modena - Italy
-- --------------------- Laurent@vivier.eu --------------------- "Tout ce qui est impossible reste à accomplir" Jules Verne "Things are only impossible until they're not" Jean-Luc Picard
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
Massimo Montecchi wrote:
Until r828 was in this way ... then somethink was wrong....
Thanks for the SVN revision information :)
So the main thing that changed in r828 was the handling of the bootargs and bootdevice properties to support multiple boot devices. This suggests that it could be related to the bootloader either finding a value it doesn't like in one of the boot properties, or the new boot order doesn't return correctly on invalid input.
If you load qemu with -prom-env 'auto-boot?=false', you should be able to manually come up with a "boot <device>" line that will invoke the AIX bootloader - any chance you could find out what it is? Also, what format is the AIX bootloader - is it an ELF executable?
ATB,
Mark.
I know the -prom-env 'auto-boot?=false', but from the openbios "console" I was not able to run nothing (if you can help me, please!!!) AFAIK the AIX bootloader is an ELF executable (see here http://www.ibm.com/developerworks/power/library/pa-spec12/ )
Ciao
2010/9/14 Mark Cave-Ayland mark.cave-ayland@siriusit.co.uk
Massimo Montecchi wrote:
Until r828 was in this way ... then somethink was wrong....
Thanks for the SVN revision information :)
So the main thing that changed in r828 was the handling of the bootargs and bootdevice properties to support multiple boot devices. This suggests that it could be related to the bootloader either finding a value it doesn't like in one of the boot properties, or the new boot order doesn't return correctly on invalid input.
If you load qemu with -prom-env 'auto-boot?=false', you should be able to manually come up with a "boot <device>" line that will invoke the AIX bootloader - any chance you could find out what it is? Also, what format is the AIX bootloader - is it an ELF executable?
ATB,
Mark.
-- Mark Cave-Ayland - Senior Technical Architect PostgreSQL - PostGIS Sirius Corporation plc - control through freedom http://www.siriusit.co.uk t: +44 870 608 0063
Sirius Labs: http://www.siriusit.co.uk/labs
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
Massimo Montecchi wrote:
I know the -prom-env 'auto-boot?=false', but from the openbios "console" I was not able to run nothing (if you can help me, please!!!) AFAIK the AIX bootloader is an ELF executable (see here http://www.ibm.com/developerworks/power/library/pa-spec12/ )
Ciao
Is the ELF executable on the CD? You can navigate around the CD using the dir command, e.g.
dir cd:,\ dir cd:,\ppc
etc. etc.
Then once you find the ELF executable, try and load it with:
load cd:,\ppc\path\to\file.elf go
HTH,
Mark.
Am 14.09.2010 um 11:36 schrieb Mark Cave-Ayland:
If you load qemu with -prom-env 'auto-boot?=false', you should be able to manually come up with a "boot <device>" line that will invoke the AIX bootloader - any chance you could find out what it is?
qemu-system-ppc64 w/ either stock QEMU OpenBIOS or r862 with OSX host and ppc MMU patches:
C>> annot manage 'OHCI USB controller' PCI device type 'usb':
106b 3f (c 3 10)
============================================================= OpenBIOS 1.0 [Aug 17 2010 14:41] Configuration device id QEMU version 1 machine id 3 CPUs: 1 Memory: 128M UUID: 00000000-0000-0000-0000-000000000000 CPU type PowerPC,970FX
Welcome to OpenBIOS v1.0 built on Aug 17 2010 14:41
0 > load cd:,\ppc\chrp\bootfile.exe ok 0 > go No valid state has been set by load or init-program ok 0 > boot cd:,\ppc\chrp\bootfile.exe No valid state has been set by load or init-program ok 0 > dir cd:,\ppc\chrp 2048 2007-07-03 17:39:44 .\ 2048 2007-07-03 17:32:05 ..\ 12487680 2007-07-03 17:39:24 bootfile.exe ok 0 >
Also, what format is the AIX bootloader - is it an ELF executable?
$ file /Volumes/CDROM/ppc/chrp/bootfile.exe /Volumes/CDROM/ppc/chrp/bootfile.exe: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), statically linked, corrupted section header size
Andreas
Andreas Färber wrote:
qemu-system-ppc64 w/ either stock QEMU OpenBIOS or r862 with OSX host and ppc MMU patches:
C>> annot manage 'OHCI USB controller' PCI device type 'usb':
106b 3f (c 3 10)
============================================================= OpenBIOS 1.0 [Aug 17 2010 14:41] Configuration device id QEMU version 1 machine id 3 CPUs: 1 Memory: 128M UUID: 00000000-0000-0000-0000-000000000000 CPU type PowerPC,970FX
Welcome to OpenBIOS v1.0 built on Aug 17 2010 14:41
0 > load cd:,\ppc\chrp\bootfile.exe ok 0 > go No valid state has been set by load or init-program ok 0 > boot cd:,\ppc\chrp\bootfile.exe No valid state has been set by load or init-program ok 0 > dir cd:,\ppc\chrp 2048 2007-07-03 17:39:44 .\ 2048 2007-07-03 17:32:05 ..\ 12487680 2007-07-03 17:39:24 bootfile.exe ok 0 >
Also, what format is the AIX bootloader - is it an ELF executable?
$ file /Volumes/CDROM/ppc/chrp/bootfile.exe /Volumes/CDROM/ppc/chrp/bootfile.exe: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), statically linked, corrupted section header size
Andreas
Right. So in the case that you see the message "No valid state has been set by load or init-program", this means that either the load failed or init-program failed to detect a valid ELF header for the current architecture.
First thing to check is that the executable is being loaded from disk, e.g.
load cd:,\ppc\chrp\bootfile.exe
then dump the first 200 bytes of memory to make sure an ELF header is present (i.e. the load from disk was successful):
load-base 200 dump
If the ELF header is present then it must be init-program which is failing. If the ELF header is not present, you'll need to take a look in either libopenbios/load.c and/or libopenbios/elf_load.c at elf_load() and elf_init_program().
The one thing that I did notice is that you are attempting to launch a PPC32 ELF file under a PPC64 Qemu, so perhaps it is the checks in is_elf() which are failing? Try taking a look at the relevant constants in include/arch/ppc/elf.h.
HTH,
Mark.
Mark, using your hints I was able to establish that the ELF header is not present. I will try (I'm not so expert in C) to take a look at the files you suggest me. Thanks, Ciao
2010/9/15 Mark Cave-Ayland mark.cave-ayland@siriusit.co.uk
Andreas Färber wrote:
qemu-system-ppc64 w/ either stock QEMU OpenBIOS or r862 with OSX host and
ppc MMU patches:
C>> annot manage 'OHCI USB controller' PCI device type 'usb':
106b 3f (c 3 10)
============================================================= OpenBIOS 1.0 [Aug 17 2010 14:41] Configuration device id QEMU version 1 machine id 3 CPUs: 1 Memory: 128M UUID: 00000000-0000-0000-0000-000000000000 CPU type PowerPC,970FX
Welcome to OpenBIOS v1.0 built on Aug 17 2010 14:41
0 > load cd:,\ppc\chrp\bootfile.exe ok 0 > go No valid state has been set by load or init-program ok 0 > boot cd:,\ppc\chrp\bootfile.exe No valid state has been set by load or init-program ok 0 > dir cd:,\ppc\chrp 2048 2007-07-03 17:39:44 .\ 2048 2007-07-03 17:32:05 ..\ 12487680 2007-07-03 17:39:24 bootfile.exe ok 0 >
Also, what format is the AIX bootloader - is it an ELF executable?
$ file /Volumes/CDROM/ppc/chrp/bootfile.exe /Volumes/CDROM/ppc/chrp/bootfile.exe: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), statically linked, corrupted section header size
Andreas
Right. So in the case that you see the message "No valid state has been set by load or init-program", this means that either the load failed or init-program failed to detect a valid ELF header for the current architecture.
First thing to check is that the executable is being loaded from disk, e.g.
load cd:,\ppc\chrp\bootfile.exe
then dump the first 200 bytes of memory to make sure an ELF header is present (i.e. the load from disk was successful):
load-base 200 dump
If the ELF header is present then it must be init-program which is failing. If the ELF header is not present, you'll need to take a look in either libopenbios/load.c and/or libopenbios/elf_load.c at elf_load() and elf_init_program().
The one thing that I did notice is that you are attempting to launch a PPC32 ELF file under a PPC64 Qemu, so perhaps it is the checks in is_elf() which are failing? Try taking a look at the relevant constants in include/arch/ppc/elf.h.
HTH,
Mark.
-- Mark Cave-Ayland - Senior Technical Architect PostgreSQL - PostGIS Sirius Corporation plc - control through freedom http://www.siriusit.co.uk t: +44 870 608 0063
Sirius Labs: http://www.siriusit.co.uk/labs
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
Am 15.09.2010 um 11:06 schrieb Mark Cave-Ayland:
Andreas Färber wrote:
qemu-system-ppc64 w/ either stock QEMU OpenBIOS or r862 with OSX host and ppc MMU patches: C>> annot manage 'OHCI USB controller' PCI device type 'usb':
106b 3f (c 3 10)
OpenBIOS 1.0 [Aug 17 2010 14:41] Configuration device id QEMU version 1 machine id 3 CPUs: 1 Memory: 128M UUID: 00000000-0000-0000-0000-000000000000 CPU type PowerPC,970FX
Welcome to OpenBIOS v1.0 built on Aug 17 2010 14:41 0 > load cd:,\ppc\chrp\bootfile.exe ok 0 > go No valid state has been set by load or init-program ok 0 > boot cd:,\ppc\chrp\bootfile.exe No valid state has been set by load or init-program ok 0 > dir cd:,\ppc\chrp 2048 2007-07-03 17:39:44 .\ 2048 2007-07-03 17:32:05 ..\ 12487680 2007-07-03 17:39:24 bootfile.exe ok 0 >
Also, what format is the AIX bootloader - is it an ELF executable?
$ file /Volumes/CDROM/ppc/chrp/bootfile.exe /Volumes/CDROM/ppc/chrp/bootfile.exe: ELF 32-bit MSB executable, PowerPC or cisco 4500, version 1 (SYSV), statically linked, corrupted section header size Andreas
Right. So in the case that you see the message "No valid state has been set by load or init-program", this means that either the load failed or init-program failed to detect a valid ELF header for the current architecture.
First thing to check is that the executable is being loaded from disk, e.g.
load cd:,\ppc\chrp\bootfile.exe
then dump the first 200 bytes of memory to make sure an ELF header is present (i.e. the load from disk was successful):
load-base 200 dump
If the ELF header is present then it must be init-program which is failing. If the ELF header is not present, you'll need to take a look in either libopenbios/load.c and/or libopenbios/elf_load.c at elf_load() and elf_init_program().
The one thing that I did notice is that you are attempting to launch a PPC32 ELF file under a PPC64 Qemu, so perhaps it is the checks in is_elf() which are failing? Try taking a look at the relevant constants in include/arch/ppc/elf.h.
If I can trust printk, I do not arrive in the C load() function (libopenbios/load.c) at all. According to `debug open-dev`, path-resolution returns 0 for "load cd:, \ppc\chrp\bootfile.exe" (forth/device/pathres.fs).
Any ideas?
Andreas
The following patch does wonders, it changes the ppc config to match sparc64 wrt ISO9660:
diff --git a/config/examples/cross-ppc_config.xml b/config/examples/ cross-ppc_config.xml index d658ac4..c180509 100644 --- a/config/examples/cross-ppc_config.xml +++ b/config/examples/cross-ppc_config.xml @@ -55,7 +55,7 @@ <option name="CONFIG_PC_PARTS" type="boolean" value="true"/> <option name="CONFIG_HFS" type="boolean" value="true"/> <option name="CONFIG_HFSP" type="boolean" value="true"/> - <option name="CONFIG_ISO9660" type="boolean" value="true"/> + <option name="CONFIG_ISO9660" type="boolean" value="false"/> <option name="CONFIG_EXT2" type="boolean" value="true"/> <option name="CONFIG_GRUBFS" type="boolean" value="true"/> <option name="CONFIG_FSYS_EXT2FS" type="boolean" value="false"/> @@ -65,7 +65,7 @@ <option name="CONFIG_FSYS_REISERFS" type="boolean" value="false"/> <option name="CONFIG_FSYS_XFS" type="boolean" value="false"/> <option name="CONFIG_FSYS_UFS" type="boolean" value="false"/> - <option name="CONFIG_FSYS_ISO9660" type="boolean" value="false"/> + <option name="CONFIG_FSYS_ISO9660" type="boolean" value="true"/> <option name="CONFIG_FSYS_FFS" type="boolean" value="false"/> <option name="CONFIG_FSYS_VSTAFS" type="boolean" value="false"/> <option name="CONFIG_FSYS_NTFS" type="boolean" value="false"/>
$ qemu-system-ppc64 -boot d -cdrom path/to/6.1.0-dvd.iso -nographic
C>> annot manage 'OHCI USB controller' PCI device type 'usb':
106b 3f (c 3 10)
============================================================= OpenBIOS 1.0 [Sep 25 2010 23:55] Configuration device id QEMU version 1 machine id 3 CPUs: 1 Memory: 128M UUID: 00000000-0000-0000-0000-000000000000 CPU type PowerPC,970FX
Welcome to OpenBIOS v1.0 built on Sep 25 2010 23:55 Trying cd:,\:tbxi... File not found Trying cd:,\ppc\bootinfo.txt...
------------------------------------------------------------------------------- Welcome to AIX. boot image timestamp: 01:75 2B/75 NULL ihandle The current time and date: 00:00:00 156828/00/0008 processor count: 0; memory size: 128MB; kernel size: 8391752 boot device: cd:\ppc\chrp\bootfile.exe NULL phandle Unexpected client interface exception: -1 NULL phandle Unexpected client interface exception: -1
ERROR: This system is incompatible with the 64 bit kernel.
EXIT 0 >
`dir cd:,\ppc\chrp` is unsupported in that configuration though.
Andreas
Andreas Färber wrote:
The following patch does wonders, it changes the ppc config to match sparc64 wrt ISO9660:
Ah wait a second - I think I know what's happening here. Several months ago I found a couple of bugs in fs/iso9660/* related to loading files from CD. I seem to recall:
i) The filenames all had to be in capital letters ii) Sometimes I had to put an extra . at the end
I found these bugs by stepping through iso9660_opendir() under gdb. So that is likely what's happening here - OpenBIOS is unable to locate the file from the filesystem at boot time.
`dir cd:,\ppc\chrp` is unsupported in that configuration though.
Yeah because while the grubfs iso9660 implementation doesn't have the case-sensitivity/period bugs, unfortunately the grub API doesn't provide a function to list files within a directory.
If you could provide a patch to fix these bugs in fs/iso9660/* then I would definitely apply it :)
ATB,
Mark.
Am 26.09.2010 um 14:12 schrieb Mark Cave-Ayland:
Andreas Färber wrote:
The following patch does wonders, it changes the ppc config to match sparc64 wrt ISO9660:
Ah wait a second - I think I know what's happening here. Several months ago I found a couple of bugs in fs/iso9660/* related to loading files from CD. I seem to recall:
i) The filenames all had to be in capital letters ii) Sometimes I had to put an extra . at the end
I found these bugs by stepping through iso9660_opendir() under gdb. So that is likely what's happening here - OpenBIOS is unable to locate the file from the filesystem at boot time.
iso9660_open() actually succeeds for lowercase \ppc\chrp\bootfile.exe. Replacing strcmp() with strcasecmp() in seek_name() made no visible difference. It probably depends on the case on the disk, some directories are uppercase here, some lowercase.
diff --git a/fs/iso9660/iso9660_opendir.c b/fs/iso9660/iso9660_opendir.c index 10cb89d..49eab4b 100644 --- a/fs/iso9660/iso9660_opendir.c +++ b/fs/iso9660/iso9660_opendir.c @@ -55,7 +55,7 @@ static struct iso_directory_record * seek_name(iso9660_VOLUME *volume, while ((idr = iso9660_readdir(dir)) != NULL) { iso9660_name(volume, idr, name_buf); - if (strcmp(name, name_buf) == 0) + if (strcasecmp(name, name_buf) == 0) { result = idr_new(idr); iso9660_closedir(dir);
Some random observations:
* Changing some file in fs/iso9660/ and re-running `make` in obj-ppc causes LD to fail with multiple/undefined symbols. Removing ./libfs.a first and then re-running `make` works fine.
* The ofmem_claim() hack I tried for Haiku does not help with AIX. AIX tries to claim 0x00200000 bytes at location 0x07e00000, which overlaps with OpenBIOS at rom_base()==0x07f00000. Haiku by comparison claims 0x00100000 bytes at 0x0 and ended up at a different location by my patch (0x07e00000 vs. 0x07f00000).
* The two AIX "NULL phandle" messages go away and the processor count is detected as 1 when running with -m 1024:
------------------------------------------------------------------------------- Welcome to AIX. boot image timestamp: 01:75 2B/75 NULL ihandle The current time and date: 00:00:00 156828/00/0008 processor count: 1; memory size: 1024MB; kernel size: 8391752 boot device: cd:\ppc\chrp\bootfile.exe Validation failed: the "/rtas" device node does not exist. EXIT 0 >
The "NULL ihandle" stems from call-method being called with 0x0 ihandle for get-time. This is caused by open for the rtc node returning 0x0 on ppc64. ppc output follows:
------------------------------------------------------------------------------- Welcome to AIX. boot image timestamp: 01:75 2B/75 The current time and date: 18:08:20 09/26/2010 processor count: 1; memory size: 1024MB; kernel size: 8391752 boot device: cd:\ppc\chrp\bootfile.exe
ERROR: This system is not supported for use with AIX 6.1. model: Power Macintosh processor: PowerPC,750
AIX 6.1 requires the POWER4 (or later) processor.
EXIT 0 >
Andreas
Am 26.09.2010 um 20:53 schrieb Andreas Färber:
- Changing some file in fs/iso9660/ and re-running `make` in obj-ppc
causes LD to fail with multiple/undefined symbols. Removing ./ libfs.a first and then re-running `make` works fine.
I believe this is caused by identically named .o files in target/fs/ hfs/ and target/fs/hfsplus/. It therefore doesn't affect the sparc targets. Should we rename the sources or always rm the archive first?
Andreas
On Mon, Oct 11, 2010 at 2:32 PM, Andreas Färber andreas.faerber@web.de wrote:
Am 26.09.2010 um 20:53 schrieb Andreas Färber:
- Changing some file in fs/iso9660/ and re-running `make` in obj-ppc
causes LD to fail with multiple/undefined symbols. Removing ./libfs.a first and then re-running `make` works fine.
I believe this is caused by identically named .o files in target/fs/hfs/ and target/fs/hfsplus/. It therefore doesn't affect the sparc targets. Should we rename the sources or always rm the archive first?
Rename, but does it actually make sense to enable both HFS and HFS+ support simultaneously? Is HFS+ able to read HFS volumes?