Nick - do you think you could do a quick test on this one?
This patch for the scsi_options seems to work fine - system boots with the patch applied and with the line removed from /etc/system.
-Nick
-------- This e-mail may contain confidential and privileged material for the sole use of the intended recipient. If this email is not intended for you, or you are not responsible for the delivery of this message to the intended recipient, please note that this message may contain SEAKR Engineering (SEAKR) Privileged/Proprietary Information. In such a case, you are strictly prohibited from downloading, photocopying, distributing or otherwise using this message, its contents or attachments in any way. If you have received this message in error, please notify us immediately by replying to this e-mail and delete the message from your mailbox. Information contained in this message that does not relate to the business of SEAKR is neither endorsed by nor attributable to SEAKR.
Date: Tue, 26 Apr 2011 17:02:34 -0600 From: Nick.Couchman@seakr.com To: openbios@openbios.org Subject: Re: [OpenBIOS] Solaris anyone?
Nick - do you think you could do a quick test on this one?
This patch for the scsi_options seems to work fine - system boots with the patch applied and with the line removed from /etc/system.
-Nick
Mark, thank you for your hard work on this! It's very exciting!
I've built the latest openbios and qemu, but get the following error when I try and use it:
nathan@redwall:/usr/local/build/qemu$ sparc-softmmu/qemu-system-sparc -nographic -bios openbios-builtin.elf
Configuration device id QEMU version 16777216 machine id 8192 Incompatible configuration device version, freezing QEMU: Terminated
I built openbios on a SPARC Ultra60, and QEMU on x86. Could that be the reason the version and machine ID got swapped?
Thanks, Nathan
On 27/04/11 16:58, Nathan Kunkee wrote:
Mark, thank you for your hard work on this! It's very exciting!
I've built the latest openbios and qemu, but get the following error when I try and use it:
nathan@redwall:/usr/local/build/qemu$ sparc-softmmu/qemu-system-sparc -nographic -bios openbios-builtin.elf
Configuration device id QEMU version 16777216 machine id 8192 Incompatible configuration device version, freezing QEMU: Terminated
I built openbios on a SPARC Ultra60, and QEMU on x86. Could that be the reason the version and machine ID got swapped?
Gosh - that definitely looks like some kind of build error. Which compiler did you use? Here I cross-compile on 64-bit x86 using GCC 4.5.
I've uploaded a fresh build of SVN trunk SPARC32 OpenBIOS to http://www.siriusit.co.uk/tmp/openbios-sparc32 for people to experiment with in the window before this makes the upstream QEMU git repository.
ATB,
Mark.
Date: Wed, 27 Apr 2011 20:28:15 +0100 From: mark.cave-ayland@siriusit.co.uk To: openbios@openbios.org Subject: Re: [OpenBIOS] Solaris anyone?
On 27/04/11 16:58, Nathan Kunkee wrote:
Mark, thank you for your hard work on this! It's very exciting!
[..snip..]
I built openbios on a SPARC Ultra60, and QEMU on x86. Could that be the reason the version and machine ID got swapped?
Gosh - that definitely looks like some kind of build error. Which compiler did you use? Here I cross-compile on 64-bit x86 using GCC 4.5.
I've uploaded a fresh build of SVN trunk SPARC32 OpenBIOS to http://www.siriusit.co.uk/tmp/openbios-sparc32 for people to experiment with in the window before this makes the upstream QEMU git repository.
ATB,
Mark.
I built that on opensolaris (so sparc64) with gcc 4.5.2. No cross-compiler needed, although the config script thinks I'm using one.
Thank you for posting the link. That image does load, which is better than I managed, but somehow isn't seeing my solaris 9 cd or iso. BTW, QEMU crashes nicely when you boot from an empty cd device.
Next I'm trying to compare what you built with my image as I'm not sure how those values are getting byte-swapped.
Thanks, Nathan
On 27/04/11 23:01, Nathan Kunkee wrote:
I built that on opensolaris (so sparc64) with gcc 4.5.2. No cross-compiler needed, although the config script thinks I'm using one.
Ah that will probably be the problem - config/script/switch-arch contains the logic which detects how NATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH and SWAP_ENDIANNESS should be set and adds them to CFLAGS in Makefile.target as appropriate.
Thank you for posting the link. That image does load, which is better than I managed, but somehow isn't seeing my solaris 9 cd or iso. BTW, QEMU crashes nicely when you boot from an empty cd device.
Strange. Can you show us the command line you are using? From your previous email:
nathan@redwall:/usr/local/build/qemu$ sparc-softmmu/qemu-system-sparc -nographic -bios openbios-builtin.elf
You are definitely missing the "-boot d" option to force boot from cdrom, although this is just a guess as you have shown us any error messages :(
ATB,
Mark.
On 04/28/11 04:00 AM, Mark Cave-Ayland wrote:
On 27/04/11 23:01, Nathan Kunkee wrote:
I built that on opensolaris (so sparc64) with gcc 4.5.2. No cross-compiler needed, although the config script thinks I'm using one.
Ah that will probably be the problem - config/script/switch-arch contains the logic which detects how NATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH and SWAP_ENDIANNESS should be set and adds them to CFLAGS in Makefile.target as appropriate.
OK. I'll start looking to see how to change that for by build environment.
Thank you for posting the link. That image does load, which is better than I managed, but somehow isn't seeing my solaris 9 cd or iso. BTW, QEMU crashes nicely when you boot from an empty cd device.
Strange. Can you show us the command line you are using? From your previous email:
nathan@redwall:/usr/local/build/qemu$ sparc-softmmu/qemu-system-sparc -nographic -bios openbios-builtin.elf
You are definitely missing the "-boot d" option to force boot from cdrom, although this is just a guess as you have shown us any error messages :(
Oops; it seemed obvious when I wrote it. The trick is that the cd device is empty, or is full of 0. Running your sparc32 image:
nathan@fangorn:/usr/local/build/qemu$ sparc-softmmu/qemu-system-sparc -nographic -bios openbios-sparc32-mark Configuration device id QEMU version 1 machine id 32 CPUs: 1 x FMI,MB86904 UUID: 00000000-0000-0000-0000-000000000000 Welcome to OpenBIOS v1.0 built on Apr 27 2011 19:13 Type 'help' for detailed information Trying disk... No valid state has been set by load or init-program
0 > boot cdrom: Unhandled Exception 0x0000002a PC = 0xffd1101c NPC = 0xffd11020 Stopping execution QEMU 0.14.50 monitor - type 'help' for more information (qemu) info block scsi0-cd2: type=cdrom removable=1 locked=0 [not inserted] floppy0: type=floppy removable=1 locked=0 [not inserted] sd0: type=floppy removable=1 locked=0 [not inserted] (qemu) quit
Looking at it again, OpenBIOS is bombing out rather than QEMU. I found this by accident trying to get the right path to my host cdrom drive. So, '-boot d -cdrom /dev/null' on the command line produces the same error at the same place. I'm not sure why a zero device would cause this when a missing hard disk does not.
Hard drive full of 0: nathan@fangorn:/usr/local/build/qemu$ sparc-softmmu/qemu-system-sparc -nographic -bios openbios-sparc32-mark -hda /dev/null
Configuration device id QEMU version 1 machine id 32 CPUs: 1 x FMI,MB86904 UUID: 00000000-0000-0000-0000-000000000000 Welcome to OpenBIOS v1.0 built on Apr 27 2011 19:13 Type 'help' for detailed information Trying disk... Unhandled Exception 0x0000002a PC = 0xffd1101c NPC = 0xffd11020 Stopping execution QEMU 0.14.50 monitor - type 'help' for more information (qemu) info block scsi0-hd0: type=hd removable=0 file=/dev/null ro=0 drv=raw encrypted=0 scsi0-cd2: type=cdrom removable=1 locked=0 [not inserted] floppy0: type=floppy removable=1 locked=0 [not inserted] sd0: type=floppy removable=1 locked=0 [not inserted] (qemu) quit
And the happy path I usually see, just a missing hard drive: nathan@fangorn:/usr/local/build/qemu$ sparc-softmmu/qemu-system-sparc -nographic -bios openbios-sparc32-mark
Configuration device id QEMU version 1 machine id 32 CPUs: 1 x FMI,MB86904 UUID: 00000000-0000-0000-0000-000000000000 Welcome to OpenBIOS v1.0 built on Apr 27 2011 19:13 Type 'help' for detailed information Trying disk... No valid state has been set by load or init-program
0 > boot Trying disk... No valid state has been set by load or init-program ok 0 >
Let me know if you need more information on this.
Thanks, Nathan
On 28/04/11 13:52, Nathan Kunkee wrote:
Ah that will probably be the problem - config/script/switch-arch contains the logic which detects how NATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH and SWAP_ENDIANNESS should be set and adds them to CFLAGS in Makefile.target as appropriate.
OK. I'll start looking to see how to change that for by build environment.
Great - thanks!
Thank you for posting the link. That image does load, which is better than I managed, but somehow isn't seeing my solaris 9 cd or iso. BTW, QEMU crashes nicely when you boot from an empty cd device.
Strange. Can you show us the command line you are using? From your previous email:
nathan@redwall:/usr/local/build/qemu$ sparc-softmmu/qemu-system-sparc -nographic -bios openbios-builtin.elf
You are definitely missing the "-boot d" option to force boot from cdrom, although this is just a guess as you have shown us any error messages :(
Oops; it seemed obvious when I wrote it. The trick is that the cd device is empty, or is full of 0. Running your sparc32 image:
nathan@fangorn:/usr/local/build/qemu$ sparc-softmmu/qemu-system-sparc -nographic -bios openbios-sparc32-mark Configuration device id QEMU version 1 machine id 32 CPUs: 1 x FMI,MB86904 UUID: 00000000-0000-0000-0000-000000000000 Welcome to OpenBIOS v1.0 built on Apr 27 2011 19:13 Type 'help' for detailed information Trying disk... No valid state has been set by load or init-program
0 > boot cdrom: Unhandled Exception 0x0000002a PC = 0xffd1101c NPC = 0xffd11020 Stopping execution
But you're still missing "-boot d" on the command line so it won't default to the cdrom. If you want to boot from the cdrom using the OpenBIOS command line manually, you also need to give the slice (d) and so the command you need is:
boot cdrom:d
HTH,
Mark.
On 04/28/11 11:08 AM, Mark Cave-Ayland wrote:
On 28/04/11 13:52, Nathan Kunkee wrote:
Ah that will probably be the problem - config/script/switch-arch contains the logic which detects how NATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH and SWAP_ENDIANNESS should be set and adds them to CFLAGS in Makefile.target as appropriate.
OK. I'll start looking to see how to change that for by build environment.
Great - thanks!
I figured it out!
/bin/sh, the default choice if you just run switch-arch, on OpenSolaris is ksh93, which silently fails on the $...bigendian tests. If I run switch-arch with /usr/xpg4/bin/sh or bash, it works fine and my builds from x86 and sparc are now correct and load. It looks like testing for $KSH_VERSION would be a way to find out if the shell isn't going to work, but I don't know if this would come up enough to warrant adding logic to check it.
Thanks, Nathan
On Sat, Apr 30, 2011 at 4:55 AM, Nathan Kunkee nkunkee42@hotmail.com wrote:
On 04/28/11 11:08 AM, Mark Cave-Ayland wrote:
On 28/04/11 13:52, Nathan Kunkee wrote:
Ah that will probably be the problem - config/script/switch-arch contains the logic which detects how NATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH and SWAP_ENDIANNESS should be set and adds them to CFLAGS in Makefile.target as appropriate.
OK. I'll start looking to see how to change that for by build environment.
Great - thanks!
I figured it out!
/bin/sh, the default choice if you just run switch-arch, on OpenSolaris is ksh93, which silently fails on the $...bigendian tests. If I run switch-arch with /usr/xpg4/bin/sh or bash, it works fine and my builds from x86 and sparc are now correct and load. It looks like testing for $KSH_VERSION would be a way to find out if the shell isn't going to work, but I don't know if this would come up enough to warrant adding logic to check it.
Maybe we have a bashism somewhere (should be fixed), or more likely since ksh93 is not fully Posix compatible, we use some Posix features which are not implemented by ksh93 (maybe avoidable). Please send again the output from sh -x for the bigendian test.
Ah that will probably be the problem - config/script/switch-arch contains the logic which detects how NATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH and SWAP_ENDIANNESS should be set and adds them to CFLAGS in Makefile.target as appropriate.
OK. I'll start looking to see how to change that for by build environment.
Great - thanks!
I figured it out!
/bin/sh, the default choice if you just run switch-arch, on OpenSolaris is ksh93, which silently fails on the $...bigendian tests. If I run switch-arch with /usr/xpg4/bin/sh or bash, it works fine and my builds from x86 and sparc are now correct and load. It looks like testing for $KSH_VERSION would be a way to find out if the shell isn't going to work, but I don't know if this would come up enough to warrant adding logic to check it.
Maybe we have a bashism somewhere (should be fixed), or more likely since ksh93 is not fully Posix compatible, we use some Posix features which are not implemented by ksh93 (maybe avoidable). Please send again the output from sh -x for the bigendian test.
As run on my Ultra60 which should set CONFIG_BIG_ENDIAN:
nathan@valhalla:/export/home/nathan/openbios-devel$ LANG=C /bin/sh -x ./config/scripts/switch-arch sparc32 + MOLPATH=/export/home/nathan//mol-0.9.71 + [ xsparc32 = x -o sparc32 = -help ] + test -f utils/dist/debian/rules + chmod 755 utils/dist/debian/rules + chmod 755 config/scripts/switch-arch + chmod 755 config/scripts/reldir + test x = x + archname + sed -e s/i.86/x86/ -e s/i86pc/x86/ -e s/sun4u/sparc64/ -e 's/sparc$/sparc32/' -e 's/arm.*/arm/' -e s/sa110/arm/ -e s/x86_64/amd64/ -e 's/Power Macintosh/ppc/' + uname -m + HOSTARCH=sparc64 + head VERSION + VERSION=1.0 + echo 'Configuring OpenBIOS on sparc64 for sparc32' Configuring OpenBIOS on sparc64 for sparc32 + target_list='' + target_list=' builtin-sparc32 unix-sparc32' + arch_list='' + sed 's/.*-//g' + echo builtin-sparc32 + arch=sparc32 + test -f config/examples/sparc32_config.xml + grep -q sparc32 + echo + arch_list=' sparc32' + sed 's/.*-//g' + echo unix-sparc32 + arch=sparc32 + test -f config/examples/sparc32_config.xml + grep -q sparc32 + echo sparc32 + unix=no + builtin=no + plain=no + mol=no + briq=no + pearpc=no + qemu=no + xbox=no + cross=no + : + builtin=yes + : + [ sparc32 != sparc64 ] + continue + BASEARCH=sparc32 + select_prefix sparc + whence -v sparc-linux-gnu-gcc + 1> /dev/null 2>& 1 + whence -v sparc-linux-gcc + 1> /dev/null 2>& 1 + whence -v sparc-elf-gcc + 1> /dev/null 2>& 1 + whence -v sparc-eabi-gcc + 1> /dev/null 2>& 1 + whence -v sparc-sun-solaris2.11-gcc + 1> /dev/null 2>& 1 + return + CFLAGS='-Wa,-xarch=v8 -Wa,-32 -m32 -mcpu=supersparc -fno-builtin' + AS_FLAGS='-Wa,-xarch=v8 -Wa,-32' + uname -s + [ sparc32 != sparc64 -o SunOS = Darwin ] + cross=yes + crosscflags sparc64 sparc32 + local host=sparc64 ./config/scripts/switch-arch[22]: local: not found [No such file or directory] + local target=sparc32 ./config/scripts/switch-arch[23]: local: not found [No such file or directory] + test '' = powerpc -o '' = ppc -o '' = mips -o '' = s390 -o '' = sparc32 -o '' = sparc64 -o '' = m68k -o '' = armv4b + hostbigendian=no + test '' = sparc64 -o '' = ia64 -o '' = amd64 -o '' = x86_64 -o '' = alpha + hostlongbits=32 + test unix-sparc32 = powerpc -o unix-sparc32 = ppc -o unix-sparc32 = powerpc64 -o unix-sparc32 = ppc64 -o unix-sparc32 = mips -o unix-sparc32 = s390 -o unix-sparc32 = sparc32 -o unix-sparc32 = sparc64 -o unix-sparc32 = m68k -o unix-sparc32 = armv4b + targetbigendian=no + test unix-sparc32 = sparc64 -o unix-sparc32 = ia64 -o unix-sparc32 = amd64 -o unix-sparc32 = x86_64 -o unix-sparc32 = powerpc64 -o unix-sparc32 = ppc64 -o unix-sparc32 = alpha + targetlongbits=32 + echo 'test same endian -target -host ' no no test same endian -target -host no no + test no = no + cflags=-USWAP_ENDIANNESS + test 32 = 32 + cflags='-USWAP_ENDIANNESS -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH' + test unix-sparc32 = sparc64 -o unix-sparc32 = ia64 -o unix-sparc32 = amd64 -o unix-sparc32 = x86_64 -o unix-sparc32 = alpha + CROSSCFLAGS='-USWAP_ENDIANNESS -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH' + OBJDIR=obj-sparc32 + printf 'Initializing build tree obj-sparc32...' Initializing build tree obj-sparc32...+ rm -rf obj-sparc32 + mkdir obj-sparc32 + mkdir -p obj-sparc32/target + mkdir -p obj-sparc32/target/include + mkdir -p obj-sparc32/target/arch + mkdir -p obj-sparc32/target/arch/unix + mkdir -p obj-sparc32/target/arch/sparc32 + mkdir -p obj-sparc32/target/libgcc + mkdir -p obj-sparc32/target/kernel + mkdir -p obj-sparc32/target/libopenbios + mkdir -p obj-sparc32/target/packages + mkdir -p obj-sparc32/target/fs + mkdir -p obj-sparc32/target/fs/grubfs + mkdir -p obj-sparc32/target/fs/hfs + mkdir -p obj-sparc32/target/fs/hfsplus + mkdir -p obj-sparc32/target/fs/iso9660 + mkdir -p obj-sparc32/target/fs/ext2 + mkdir -p obj-sparc32/target/drivers + mkdir -p obj-sparc32/target/libc + mkdir -p obj-sparc32/host/include + mkdir -p obj-sparc32/host/kernel + mkdir -p obj-sparc32/forth + ln -s ../../../include/arch/sparc32 obj-sparc32/target/include/asm + [ no = yes ] + [ no = yes ] + [ no = yes ] + [ no = yes ] + [ no = yes ] + echo ok. ok. + cd obj-sparc32 + SRCDIR=.. + ODIR=. + printf 'Creating target Makefile...' Creating target Makefile...+ echo ARCH=sparc32 + 1> ./config.mak + [ yes = yes ] + echo TARGET=sparc-sun-solaris2.11- + 1>> ./config.mak + echo CFLAGS='-Wa,-xarch=v8 -Wa,-32 -m32 -mcpu=supersparc -fno-builtin' + 1>> ./config.mak + echo AS_FLAGS='-Wa,-xarch=v8 -Wa,-32' + 1>> ./config.mak + echo 'HOSTARCH?=sparc64' + 1>> ./config.mak + echo CROSSCFLAGS='-USWAP_ENDIANNESS -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH' + 1>> ./config.mak + echo VERSION='"1.0"' + 1>> ./config.mak + ln -s ../config/xml/rules.xml ./rules.xml + echo '<?xml version="1.0"?><config>' + 1> ./config.xml + config_set_boolean CONFIG_sparc32 + 1>> ./config.xml + echo CONFIG_sparc32 + tr a-z A-Z + option=CONFIG_SPARC32 + echo '<option name="CONFIG_SPARC32" type="boolean" value="true" />' + [ sparc32 != sparc32 ] + [ no = yes ] + [ no = yes ] + [ no = yes ] + [ no = yes ] + [ no = yes ] + echo 'config test -target ' no config test -target no + [ no = yes ] + config_set_boolean CONFIG_LITTLE_ENDIAN + 1>> ./config.xml + echo CONFIG_LITTLE_ENDIAN + tr a-z A-Z + option=CONFIG_LITTLE_ENDIAN + echo '<option name="CONFIG_LITTLE_ENDIAN" type="boolean" value="true" />' + [ no = yes ] + [ yes = yes ] + config_set_boolean CONFIG_IMAGE_ELF_EMBEDDED + 1>> ./config.xml + echo CONFIG_IMAGE_ELF_EMBEDDED + tr a-z A-Z + option=CONFIG_IMAGE_ELF_EMBEDDED + echo '<option name="CONFIG_IMAGE_ELF_EMBEDDED" type="boolean" value="true" />' + [ no = yes ] + cat ../config/examples/sparc32_config.xml + 1>> ./config.xml + echo '</config>' + 1>> ./config.xml + ln -s ../Makefile.target ./Makefile + xsltproc ../config/xml/xinclude.xsl ../build.xml + 1> ./build-full.xml + xsltproc ../config/xml/makefile.xsl ./build-full.xml + 1> ./rules.mak + echo ok. ok. + printf 'Creating config files...' Creating config files...+ xsltproc ../config/xml/config-c.xsl ./config.xml + 1> ./host/include/autoconf.h + xsltproc ../config/xml/config-c.xsl ./config.xml + 1> ./target/include/autoconf.h + xsltproc ../config/xml/config-forth.xsl ./config.xml + 1> ./forth/config.fs + echo ok. ok. + cd ..
Nathan
Am 02.05.2011 um 18:20 schrieb Nathan Kunkee:
/bin/sh, the default choice if you just run switch-arch, on OpenSolaris is ksh93, which silently fails on the $...bigendian tests. If I run switch-arch with /usr/xpg4/bin/sh or bash, it works fine and my builds from x86 and sparc are now correct and load. It looks like testing for $KSH_VERSION would be a way to find out if the shell isn't going to work, but I don't know if this would come up enough to warrant adding logic to check it.
Maybe we have a bashism somewhere (should be fixed), or more likely since ksh93 is not fully Posix compatible, we use some Posix features which are not implemented by ksh93 (maybe avoidable). Please send again the output from sh -x for the bigendian test.
As run on my Ultra60 which should set CONFIG_BIG_ENDIAN:
nathan@valhalla:/export/home/nathan/openbios-devel$ LANG=C /bin/sh - x ./config/scripts/switch-arch sparc32
- MOLPATH=/export/home/nathan//mol-0.9.71
- [ xsparc32 = x -o sparc32 = -help ]
- test -f utils/dist/debian/rules
- chmod 755 utils/dist/debian/rules
- chmod 755 config/scripts/switch-arch
- chmod 755 config/scripts/reldir
- test x = x
- archname
- sed -e s/i.86/x86/ -e s/i86pc/x86/ -e s/sun4u/sparc64/ -e 's/sparc
$/sparc32/' -e 's/arm.*/arm/' -e s/sa110/arm/ -e s/x86_64/amd64/ -e 's/Power Macintosh/ppc/'
- uname -m
- HOSTARCH=sparc64
- head VERSION
- VERSION=1.0
- echo 'Configuring OpenBIOS on sparc64 for sparc32'
Configuring OpenBIOS on sparc64 for sparc32
- target_list=''
- target_list=' builtin-sparc32 unix-sparc32'
- arch_list=''
- sed 's/.*-//g'
- echo builtin-sparc32
- arch=sparc32
- test -f config/examples/sparc32_config.xml
- grep -q sparc32
- echo
- arch_list=' sparc32'
- sed 's/.*-//g'
- echo unix-sparc32
- arch=sparc32
- test -f config/examples/sparc32_config.xml
- grep -q sparc32
- echo sparc32
- unix=no
- builtin=no
- plain=no
- mol=no
- briq=no
- pearpc=no
- qemu=no
- xbox=no
- cross=no
- :
- builtin=yes
- :
- [ sparc32 != sparc64 ]
- continue
- BASEARCH=sparc32
- select_prefix sparc
- whence -v sparc-linux-gnu-gcc
- 1> /dev/null 2>& 1
- whence -v sparc-linux-gcc
- 1> /dev/null 2>& 1
- whence -v sparc-elf-gcc
- 1> /dev/null 2>& 1
- whence -v sparc-eabi-gcc
- 1> /dev/null 2>& 1
- whence -v sparc-sun-solaris2.11-gcc
- 1> /dev/null 2>& 1
- return
- CFLAGS='-Wa,-xarch=v8 -Wa,-32 -m32 -mcpu=supersparc -fno-builtin'
- AS_FLAGS='-Wa,-xarch=v8 -Wa,-32'
- uname -s
- [ sparc32 != sparc64 -o SunOS = Darwin ]
- cross=yes
- crosscflags sparc64 sparc32
- local host=sparc64
./config/scripts/switch-arch[22]: local: not found [No such file or directory]
;-)
----- Original Message -----
From: Nathan Kunkee nkunkee42@hotmail.com To: The OpenBIOS Mailinglist openbios@openbios.org Cc: Sent: Monday, May 2, 2011 12:20 PM Subject: Re: [OpenBIOS] Solaris anyone? Q2
Ah that will probably be the problem - config/script/switch-arch contains the logic which detects how NATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH and SWAP_ENDIANNESS should be set and adds them to CFLAGS in Makefile.target as appropriate.
OK. I'll start looking to see how to change that for by build environment.
Great - thanks!
I figured it out!
/bin/sh, the default choice if you just run switch-arch, on OpenSolaris is ksh93, which silently fails on the $...bigendian tests. If I run switch-arch with /usr/xpg4/bin/sh or bash, it works fine and my builds from x86 and sparc are now correct and load. It looks like testing for $KSH_VERSION would be a way to find out if the shell isn't going to work, but I don't know if this would come up enough to warrant adding logic to check it.
Maybe we have a bashism somewhere (should be fixed), or more likely since ksh93 is not fully Posix compatible, we use some Posix features which are not implemented by ksh93 (maybe avoidable). Please send again the output from sh -x for the bigendian test.
As run on my Ultra60 which should set CONFIG_BIG_ENDIAN:
nathan@valhalla:/export/home/nathan/openbios-devel$ LANG=C /bin/sh -x ./config/scripts/switch-arch sparc32 + MOLPATH=/export/home/nathan//mol-0.9.71 + [ xsparc32 = x -o sparc32 = -help ] + test -f utils/dist/debian/rules + chmod 755 utils/dist/debian/rules + chmod 755 config/scripts/switch-arch + chmod 755 config/scripts/reldir + test x = x + archname + sed -e s/i.86/x86/ -e s/i86pc/x86/ -e s/sun4u/sparc64/ -e 's/sparc$/sparc32/' -e 's/arm.*/arm/' -e s/sa110/arm/ -e s/x86_64/amd64/ -e 's/Power Macintosh/ppc/' + uname -m + HOSTARCH=sparc64 + head VERSION + VERSION=1.0 + echo 'Configuring OpenBIOS on sparc64 for sparc32' Configuring OpenBIOS on sparc64 for sparc32 + target_list='' + target_list=' builtin-sparc32 unix-sparc32' + arch_list='' + sed 's/.*-//g' + echo builtin-sparc32 + arch=sparc32 + test -f config/examples/sparc32_config.xml + grep -q sparc32 + echo + arch_list=' sparc32' + sed 's/.*-//g' + echo unix-sparc32 + arch=sparc32 + test -f config/examples/sparc32_config.xml + grep -q sparc32 + echo sparc32 + unix=no + builtin=no + plain=no + mol=no + briq=no + pearpc=no + qemu=no + xbox=no + cross=no + : + builtin=yes + : + [ sparc32 != sparc64 ] + continue + BASEARCH=sparc32 + select_prefix sparc + whence -v sparc-linux-gnu-gcc + 1> /dev/null 2>& 1 + whence -v sparc-linux-gcc + 1> /dev/null 2>& 1 + whence -v sparc-elf-gcc + 1> /dev/null 2>& 1 + whence -v sparc-eabi-gcc + 1> /dev/null 2>& 1 + whence -v sparc-sun-solaris2.11-gcc + 1> /dev/null 2>& 1 + return + CFLAGS='-Wa,-xarch=v8 -Wa,-32 -m32 -mcpu=supersparc -fno-builtin' + AS_FLAGS='-Wa,-xarch=v8 -Wa,-32' + uname -s + [ sparc32 != sparc64 -o SunOS = Darwin ] + cross=yes + crosscflags sparc64 sparc32 + local host=sparc64 ./config/scripts/switch-arch[22]: local: not found [No such file or directory] + local target=sparc32 ./config/scripts/switch-arch[23]: local: not found [No such file or directory] + test '' = powerpc -o '' = ppc -o '' = mips -o '' = s390 -o '' = sparc32 -o '' = sparc64 -o '' = m68k -o '' = armv4b + hostbigendian=no + test '' = sparc64 -o '' = ia64 -o '' = amd64 -o '' = x86_64 -o '' = alpha + hostlongbits=32 + test unix-sparc32 = powerpc -o unix-sparc32 = ppc -o unix-sparc32 = powerpc64 -o unix-sparc32 = ppc64 -o unix-sparc32 = mips -o unix-sparc32 = s390 -o unix-sparc32 = sparc32 -o unix-sparc32 = sparc64 -o unix-sparc32 = m68k -o unix-sparc32 = armv4b + targetbigendian=no + test unix-sparc32 = sparc64 -o unix-sparc32 = ia64 -o unix-sparc32 = amd64 -o unix-sparc32 = x86_64 -o unix-sparc32 = powerpc64 -o unix-sparc32 = ppc64 -o unix-sparc32 = alpha + targetlongbits=32 + echo 'test same endian -target -host ' no no test same endian -target -host no no + test no = no + cflags=-USWAP_ENDIANNESS + test 32 = 32 + cflags='-USWAP_ENDIANNESS -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH' + test unix-sparc32 = sparc64 -o unix-sparc32 = ia64 -o unix-sparc32 = amd64 -o unix-sparc32 = x86_64 -o unix-sparc32 = alpha + CROSSCFLAGS='-USWAP_ENDIANNESS -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH' + OBJDIR=obj-sparc32 + printf 'Initializing build tree obj-sparc32...' Initializing build tree obj-sparc32...+ rm -rf obj-sparc32 + mkdir obj-sparc32 + mkdir -p obj-sparc32/target + mkdir -p obj-sparc32/target/include + mkdir -p obj-sparc32/target/arch + mkdir -p obj-sparc32/target/arch/unix + mkdir -p obj-sparc32/target/arch/sparc32 + mkdir -p obj-sparc32/target/libgcc + mkdir -p obj-sparc32/target/kernel + mkdir -p obj-sparc32/target/libopenbios + mkdir -p obj-sparc32/target/packages + mkdir -p obj-sparc32/target/fs + mkdir -p obj-sparc32/target/fs/grubfs + mkdir -p obj-sparc32/target/fs/hfs + mkdir -p obj-sparc32/target/fs/hfsplus + mkdir -p obj-sparc32/target/fs/iso9660 + mkdir -p obj-sparc32/target/fs/ext2 + mkdir -p obj-sparc32/target/drivers + mkdir -p obj-sparc32/target/libc + mkdir -p obj-sparc32/host/include + mkdir -p obj-sparc32/host/kernel + mkdir -p obj-sparc32/forth + ln -s ../../../include/arch/sparc32 obj-sparc32/target/include/asm + [ no = yes ] + [ no = yes ] + [ no = yes ] + [ no = yes ] + [ no = yes ] + echo ok. ok. + cd obj-sparc32 + SRCDIR=.. + ODIR=. + printf 'Creating target Makefile...' Creating target Makefile...+ echo ARCH=sparc32 + 1> ./config.mak + [ yes = yes ] + echo TARGET=sparc-sun-solaris2.11- + 1>> ./config.mak + echo CFLAGS='-Wa,-xarch=v8 -Wa,-32 -m32 -mcpu=supersparc -fno-builtin' + 1>> ./config.mak + echo AS_FLAGS='-Wa,-xarch=v8 -Wa,-32' + 1>> ./config.mak + echo 'HOSTARCH?=sparc64' + 1>> ./config.mak + echo CROSSCFLAGS='-USWAP_ENDIANNESS -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH' + 1>> ./config.mak + echo VERSION='"1.0"' + 1>> ./config.mak + ln -s ../config/xml/rules.xml ./rules.xml + echo '<?xml version="1.0"?><config>' + 1> ./config.xml + config_set_boolean CONFIG_sparc32 + 1>> ./config.xml + echo CONFIG_sparc32 + tr a-z A-Z + option=CONFIG_SPARC32 + echo '<option name="CONFIG_SPARC32" type="boolean" value="true" />' + [ sparc32 != sparc32 ] + [ no = yes ] + [ no = yes ] + [ no = yes ] + [ no = yes ] + [ no = yes ] + echo 'config test -target ' no config test -target no + [ no = yes ] + config_set_boolean CONFIG_LITTLE_ENDIAN + 1>> ./config.xml + echo CONFIG_LITTLE_ENDIAN + tr a-z A-Z + option=CONFIG_LITTLE_ENDIAN + echo '<option name="CONFIG_LITTLE_ENDIAN" type="boolean" value="true" />' + [ no = yes ] + [ yes = yes ] + config_set_boolean CONFIG_IMAGE_ELF_EMBEDDED + 1>> ./config.xml + echo CONFIG_IMAGE_ELF_EMBEDDED + tr a-z A-Z + option=CONFIG_IMAGE_ELF_EMBEDDED + echo '<option name="CONFIG_IMAGE_ELF_EMBEDDED" type="boolean" value="true" />' + [ no = yes ] + cat ../config/examples/sparc32_config.xml + 1>> ./config.xml + echo '</config>' + 1>> ./config.xml + ln -s ../Makefile.target ./Makefile + xsltproc ../config/xml/xinclude.xsl ../build.xml + 1> ./build-full.xml + xsltproc ../config/xml/makefile.xsl ./build-full.xml + 1> ./rules.mak + echo ok. ok. + printf 'Creating config files...' Creating config files...+ xsltproc ../config/xml/config-c.xsl ./config.xml + 1> ./host/include/autoconf.h + xsltproc ../config/xml/config-c.xsl ./config.xml + 1> ./target/include/autoconf.h + xsltproc ../config/xml/config-forth.xsl ./config.xml + 1> ./forth/config.fs + echo ok. ok. + cd ..
Nathan
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
This would fix the script to work on Solaris:
--- switch-arch.orig 2011-05-02 20:54:43.312500000 -0400 +++ switch-arch 2011-05-02 20:56:05.093750000 -0400 @@ -19,8 +19,8 @@ crosscflags() { - local host=$1 - local target=$2 + host=$1 + target=$2 if test "$host" = "powerpc" -o "$host" = "ppc" \ -o "$host" = "mips" -o "$host" = "s390" \
Ken
This would fix the script to work on Solaris:
--- switch-arch.orig 2011-05-02 20:54:43.312500000 -0400 +++ switch-arch 2011-05-02 20:56:05.093750000 -0400 @@ -19,8 +19,8 @@
crosscflags() {
- local host=$1
- local target=$2
host=$1
target=$2
if test "$host" = "powerpc" -o "$host" = "ppc" \ -o "$host" = "mips" -o "$host" = "s390" \
Ken
Confirmed; this produces the correct result with /bin/sh (ksh93), bash, and /usr/xpg4/bin/sh.
Thanks, Nathan
crosscflags() {
- local host=$1
- local target=$2
- host=$1
- target=$2
Confirmed; this produces the correct result with /bin/sh (ksh93), bash, and /usr/xpg4/bin/sh.
Have you tried separating the declaration and the definition. i.e.:
local host host=$1
IIRC there are sometimes issues when you combine the two.
Paul
----- Original Message -----
From: Paul Brook paul@nowt.org To: openbios@openbios.org Cc: Nathan Kunkee nkunkee42@hotmail.com Sent: Wednesday, May 4, 2011 7:19 PM Subject: Re: [OpenBIOS] Solaris anyone? Q2
crosscflags() {
- local host=$1 - local target=$2 + host=$1 + target=$2
Confirmed; this produces the correct result with /bin/sh (ksh93), bash, and /usr/xpg4/bin/sh.
Have you tried separating the declaration and the definition. i.e.:
local host host=$1
IIRC there are sometimes issues when you combine the two.
Paul
On Sun, May 22, 2011 at 2:11 AM, Kenneth Salerno kennethsalerno@yahoo.com wrote:
----- Original Message -----
From: Paul Brook paul@nowt.org To: openbios@openbios.org Cc: Nathan Kunkee nkunkee42@hotmail.com Sent: Wednesday, May 4, 2011 7:19 PM Subject: Re: [OpenBIOS] Solaris anyone? Q2
crosscflags() {
- local host=$1 - local target=$2 + host=$1 + target=$2
Confirmed; this produces the correct result with /bin/sh (ksh93), bash, and /usr/xpg4/bin/sh.
Have you tried separating the declaration and the definition. i.e.:
local host host=$1
IIRC there are sometimes issues when you combine the two.
Paul
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
Yes, I have tried that. Korn Shell '93 (ksh93) does not include the builtin "local", that is bash/zsh-specific:
kens@sunos:~$ ken() {
local kenny kenny=1 }
kens@sunos:~$ ken /bin/sh[2]: local: not found [No such file or directory] kens@sunos:~$ type local /bin/sh: whence: local: not found kens@sunos:~$ ^D 11:04 PM kens@sunos$ type local local is a shell builtin
Also there really is no need to rename the variables from host and target because they're not used for any unrelated purposes elsewhere in switch-arch.
The patch I had submitted is valid.
It looks like 'local' is a non-standard extension: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
Please submit the patch with a description and Signed-off-by: line.
----- Original Message -----
From: Blue Swirl blauwirbel@gmail.com To: The OpenBIOS Mailinglist openbios@openbios.org Cc: Sent: Sunday, May 22, 2011 5:39 AM Subject: Re: [OpenBIOS] Solaris anyone? Q2
On Sun, May 22, 2011 at 2:11 AM, Kenneth Salerno kennethsalerno@yahoo.com wrote:
----- Original Message -----
From: Paul Brook paul@nowt.org To: openbios@openbios.org Cc: Nathan Kunkee nkunkee42@hotmail.com Sent: Wednesday, May 4, 2011 7:19 PM Subject: Re: [OpenBIOS] Solaris anyone? Q2
crosscflags() {
- local host=$1 - local target=$2 + host=$1 + target=$2
Confirmed; this produces the correct result with /bin/sh (ksh93), bash, and /usr/xpg4/bin/sh.
Have you tried separating the declaration and the definition. i.e.:
local host host=$1
IIRC there are sometimes issues when you combine the two.
Paul
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
Yes, I have tried that. Korn Shell '93 (ksh93) does not include the builtin "local", that is bash/zsh-specific:
kens@sunos:~$ ken() {
local kenny kenny=1 }
kens@sunos:~$ ken /bin/sh[2]: local: not found [No such file or directory] kens@sunos:~$ type local /bin/sh: whence: local: not found kens@sunos:~$ ^D 11:04 PM kens@sunos$ type local local is a shell builtin
Also there really is no need to rename the variables from host and target because they're not used for any unrelated purposes elsewhere in switch-arch.
The patch I had submitted is valid.
It looks like 'local' is a non-standard extension: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
Please submit the patch with a description and Signed-off-by: line.
On Sun, May 22, 2011 at 7:05 PM, Kenneth Salerno kennethsalerno@yahoo.com wrote:
----- Original Message -----
From: Blue Swirl blauwirbel@gmail.com To: The OpenBIOS Mailinglist openbios@openbios.org Cc: Sent: Sunday, May 22, 2011 5:39 AM Subject: Re: [OpenBIOS] Solaris anyone? Q2
On Sun, May 22, 2011 at 2:11 AM, Kenneth Salerno kennethsalerno@yahoo.com wrote:
----- Original Message -----
From: Paul Brook paul@nowt.org To: openbios@openbios.org Cc: Nathan Kunkee nkunkee42@hotmail.com Sent: Wednesday, May 4, 2011 7:19 PM Subject: Re: [OpenBIOS] Solaris anyone? Q2
crosscflags() {
- local host=$1 - local target=$2 + host=$1 + target=$2
Confirmed; this produces the correct result with /bin/sh (ksh93), bash, and /usr/xpg4/bin/sh.
Have you tried separating the declaration and the definition. i.e.:
local host host=$1
IIRC there are sometimes issues when you combine the two.
Paul
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
Yes, I have tried that. Korn Shell '93 (ksh93) does not include the builtin "local", that is bash/zsh-specific:
kens@sunos:~$ ken() {
local kenny kenny=1 }
kens@sunos:~$ ken /bin/sh[2]: local: not found [No such file or directory] kens@sunos:~$ type local /bin/sh: whence: local: not found kens@sunos:~$ ^D 11:04 PM kens@sunos$ type local local is a shell builtin
Also there really is no need to rename the variables from host and target because they're not used for any unrelated purposes elsewhere in switch-arch.
The patch I had submitted is valid.
It looks like 'local' is a non-standard extension: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
Please submit the patch with a description and Signed-off-by: line.
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
Description: removes the non-standard "local" keyword from within the crosscflags() function. This was not necessary since the variables "host" and "target" were not clobbered anywhere outside of the function, but the real motivation is to support shells such as ksh93 that do not have the "local" builtin like bash.
Thanks, applied.
In the future, please submit the patches separately without the previous discussions. The idea is that it should be possible to use 'git am' without editing the message at all and the result should look like a proper commit with a subject line and commit description.
Signed-off-by: Kenneth Salerno kennethsalerno@yahoo.com
--- switch-arch.orig 2011-05-02 20:54:43.312500000 -0400 +++ switch-arch 2011-05-02 20:56:05.093750000 -0400 @@ -19,8 +19,8 @@
crosscflags() { - local host=$1 - local target=$2 + host=$1 + target=$2
if test "$host" = "powerpc" -o "$host" = "ppc" \ -o "$host" = "mips" -o "$host" = "s390" \
--
Thanks, Ken
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
I've been trying to get solaris 8 to install, but I've been running into problems.
After creating/formatting a disk in single-user mode, I reboot and start the install. It copies the installer to /dev/c0t0d0s1 and reboots. On startup, it gets to "Running in command line mode" then seems to endlessly do nothing.
Is how long should I wait before I can safely assume it isn't going to continue/succeed?
For reference, I'm running qemu with:
./qemu-system-sparc -cdrom solaris8_install.iso -nographic -prom-env 'auto-boot?=false' -m 256 -L . -bios openbios-sparc32_artyom.bin -hda /scratch/qemu-images/solaris2.8.qcow2
... and booting with:
boot disk0:b
Usually I use the -v, but I forgot it for the current attempt. Unfortunately, I can't copy logs over from the airgapped network, but if needs be I can manually type up relevant portions.
I'm unsure whether it would help, but when I attempt to install with the SS-5 bios image I get the following:
(...) SunOS Release 5.8 Versio nGeneric_108528-29 32-bit Copyright 1983-2003 Sun Microsystems, Inc. All rights reserved. Cannot assemble drivers for root /iommu@0,10000000/sbus@0,10001000/espdma@5,84000000/esp@5,88000000/sd@0,0:b Cannot mount root on /iommu@0,10000000/sbus@0,10001000/espdma@5,84000000/esp@5,88000000/sd@0,0:b fstype ufs
panic[cpu0]/thread=f0244020: vfs_mountroot: cannot mount root
(...)
... which is followed by 4 lines of stuff that looks somewhat like a stack dump.
So, I suppose what I'm looking for is: how patient should I be before I decide that the installation with openbios won't succeed?
-Brian
On 2011-May-23 19:51 , Brian Vandenberg wrote:
Cannot assemble drivers for root /iommu@0,10000000/sbus@0,10001000/espdma@5,84000000/esp@5,88000000/sd@0,0:b Cannot mount root on /iommu@0,10000000/sbus@0,10001000/espdma@5,84000000/esp@5,88000000/sd@0,0:b fstype ufs
panic[cpu0]/thread=f0244020: vfs_mountroot: cannot mount root
(...)
... which is followed by 4 lines of stuff that looks somewhat like a stack dump.
So, I suppose what I'm looking for is: how patient should I be before I decide that the installation with openbios won't succeed?
Once you get "cannot assemble drivers for root", it's over. That error is fatal. A few lines later you see a panic "vfs_mountroot: cannot mount root" which is the normal endpoint for driver/hardware mismatch.
[...]
Once you get "cannot assemble drivers for root", it's over.
And I just failed the reading comprehension test. Sorry, that was not the case you were asking about:
After creating/formatting a disk in single-user mode, I reboot and start the install. It copies the installer to /dev/c0t0d0s1 and reboots. On startup, it gets to "Running in command line mode" then seems to endlessly do nothing.
Is how long should I wait before I can safely assume it isn't going to continue/succeed?
I can't directly answer the "how long" question, but the above seems to indicate that you might have your console directed to somewhere unexpected. Are you expecting the output to come to the video console or the serial port? Be aware that Solaris doesn't always make the same decision OBP does on this.
Once you get "cannot assemble drivers for root", it's over. That error is fatal. A few lines later you see a panic "vfs_mountroot: cannot mount root" which is the normal endpoint for driver/hardware mismatch.
hrm. Any pointers/tips on how to proceed?
If I'm able to get it to the "Running in command line mode" point with openbios, and it seems to hang there, is this just silently having related problems or do I just need to wait longer?
-Brian
On Tue, May 3, 2011 at 3:57 AM, Kenneth Salerno kennethsalerno@yahoo.com wrote:
----- Original Message -----
From: Nathan Kunkee nkunkee42@hotmail.com To: The OpenBIOS Mailinglist openbios@openbios.org Cc: Sent: Monday, May 2, 2011 12:20 PM Subject: Re: [OpenBIOS] Solaris anyone? Q2
Ah that will probably be the problem - config/script/switch-arch contains the logic which detects how NATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH and SWAP_ENDIANNESS should be set and adds them to CFLAGS in Makefile.target as appropriate.
OK. I'll start looking to see how to change that for by build environment.
Great - thanks!
I figured it out!
/bin/sh, the default choice if you just run switch-arch, on OpenSolaris is ksh93, which silently fails on the $...bigendian tests. If I run switch-arch with /usr/xpg4/bin/sh or bash, it works fine and my builds from x86 and sparc are now correct and load. It looks like testing for $KSH_VERSION would be a way to find out if the shell isn't going to work, but I don't know if this would come up enough to warrant adding logic to check it.
Maybe we have a bashism somewhere (should be fixed), or more likely since ksh93 is not fully Posix compatible, we use some Posix features which are not implemented by ksh93 (maybe avoidable). Please send again the output from sh -x for the bigendian test.
As run on my Ultra60 which should set CONFIG_BIG_ENDIAN:
nathan@valhalla:/export/home/nathan/openbios-devel$ LANG=C /bin/sh -x ./config/scripts/switch-arch sparc32
- MOLPATH=/export/home/nathan//mol-0.9.71
- [ xsparc32 = x -o sparc32 = -help ]
- test -f utils/dist/debian/rules
- chmod 755 utils/dist/debian/rules
- chmod 755 config/scripts/switch-arch
- chmod 755 config/scripts/reldir
- test x = x
- archname
- sed -e s/i.86/x86/ -e s/i86pc/x86/ -e s/sun4u/sparc64/ -e 's/sparc$/sparc32/' -e 's/arm.*/arm/' -e s/sa110/arm/ -e s/x86_64/amd64/ -e 's/Power Macintosh/ppc/'
- uname -m
- HOSTARCH=sparc64
- head VERSION
- VERSION=1.0
- echo 'Configuring OpenBIOS on sparc64 for sparc32'
Configuring OpenBIOS on sparc64 for sparc32
- target_list=''
- target_list=' builtin-sparc32 unix-sparc32'
- arch_list=''
- sed 's/.*-//g'
- echo builtin-sparc32
- arch=sparc32
- test -f config/examples/sparc32_config.xml
- grep -q sparc32
- echo
- arch_list=' sparc32'
- sed 's/.*-//g'
- echo unix-sparc32
- arch=sparc32
- test -f config/examples/sparc32_config.xml
- grep -q sparc32
- echo sparc32
- unix=no
- builtin=no
- plain=no
- mol=no
- briq=no
- pearpc=no
- qemu=no
- xbox=no
- cross=no
- :
- builtin=yes
- :
- [ sparc32 != sparc64 ]
- continue
- BASEARCH=sparc32
- select_prefix sparc
- whence -v sparc-linux-gnu-gcc
- 1> /dev/null 2>& 1
- whence -v sparc-linux-gcc
- 1> /dev/null 2>& 1
- whence -v sparc-elf-gcc
- 1> /dev/null 2>& 1
- whence -v sparc-eabi-gcc
- 1> /dev/null 2>& 1
- whence -v sparc-sun-solaris2.11-gcc
- 1> /dev/null 2>& 1
- return
- CFLAGS='-Wa,-xarch=v8 -Wa,-32 -m32 -mcpu=supersparc -fno-builtin'
- AS_FLAGS='-Wa,-xarch=v8 -Wa,-32'
- uname -s
- [ sparc32 != sparc64 -o SunOS = Darwin ]
- cross=yes
- crosscflags sparc64 sparc32
- local host=sparc64
./config/scripts/switch-arch[22]: local: not found [No such file or directory]
- local target=sparc32
./config/scripts/switch-arch[23]: local: not found [No such file or directory]
- test '' = powerpc -o '' = ppc -o '' = mips -o '' = s390 -o '' = sparc32 -o '' = sparc64 -o '' = m68k -o '' = armv4b
- hostbigendian=no
- test '' = sparc64 -o '' = ia64 -o '' = amd64 -o '' = x86_64 -o '' = alpha
- hostlongbits=32
- test unix-sparc32 = powerpc -o unix-sparc32 = ppc -o unix-sparc32 = powerpc64 -o unix-sparc32 = ppc64 -o unix-sparc32 = mips -o unix-sparc32 = s390 -o unix-sparc32 = sparc32 -o unix-sparc32 = sparc64 -o unix-sparc32 = m68k -o unix-sparc32 = armv4b
- targetbigendian=no
- test unix-sparc32 = sparc64 -o unix-sparc32 = ia64 -o unix-sparc32 = amd64 -o unix-sparc32 = x86_64 -o unix-sparc32 = powerpc64 -o unix-sparc32 = ppc64 -o unix-sparc32 = alpha
- targetlongbits=32
- echo 'test same endian -target -host ' no no
test same endian -target -host no no
- test no = no
- cflags=-USWAP_ENDIANNESS
- test 32 = 32
- cflags='-USWAP_ENDIANNESS -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH'
- test unix-sparc32 = sparc64 -o unix-sparc32 = ia64 -o unix-sparc32 = amd64 -o unix-sparc32 = x86_64 -o unix-sparc32 = alpha
- CROSSCFLAGS='-USWAP_ENDIANNESS -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH'
- OBJDIR=obj-sparc32
- printf 'Initializing build tree obj-sparc32...'
Initializing build tree obj-sparc32...+ rm -rf obj-sparc32
- mkdir obj-sparc32
- mkdir -p obj-sparc32/target
- mkdir -p obj-sparc32/target/include
- mkdir -p obj-sparc32/target/arch
- mkdir -p obj-sparc32/target/arch/unix
- mkdir -p obj-sparc32/target/arch/sparc32
- mkdir -p obj-sparc32/target/libgcc
- mkdir -p obj-sparc32/target/kernel
- mkdir -p obj-sparc32/target/libopenbios
- mkdir -p obj-sparc32/target/packages
- mkdir -p obj-sparc32/target/fs
- mkdir -p obj-sparc32/target/fs/grubfs
- mkdir -p obj-sparc32/target/fs/hfs
- mkdir -p obj-sparc32/target/fs/hfsplus
- mkdir -p obj-sparc32/target/fs/iso9660
- mkdir -p obj-sparc32/target/fs/ext2
- mkdir -p obj-sparc32/target/drivers
- mkdir -p obj-sparc32/target/libc
- mkdir -p obj-sparc32/host/include
- mkdir -p obj-sparc32/host/kernel
- mkdir -p obj-sparc32/forth
- ln -s ../../../include/arch/sparc32 obj-sparc32/target/include/asm
- [ no = yes ]
- [ no = yes ]
- [ no = yes ]
- [ no = yes ]
- [ no = yes ]
- echo ok.
ok.
- cd obj-sparc32
- SRCDIR=..
- ODIR=.
- printf 'Creating target Makefile...'
Creating target Makefile...+ echo ARCH=sparc32
- 1> ./config.mak
- [ yes = yes ]
- echo TARGET=sparc-sun-solaris2.11-
- 1>> ./config.mak
- echo CFLAGS='-Wa,-xarch=v8 -Wa,-32 -m32 -mcpu=supersparc -fno-builtin'
- 1>> ./config.mak
- echo AS_FLAGS='-Wa,-xarch=v8 -Wa,-32'
- 1>> ./config.mak
- echo 'HOSTARCH?=sparc64'
- 1>> ./config.mak
- echo CROSSCFLAGS='-USWAP_ENDIANNESS -DNATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH'
- 1>> ./config.mak
- echo VERSION='"1.0"'
- 1>> ./config.mak
- ln -s ../config/xml/rules.xml ./rules.xml
- echo '<?xml version="1.0"?><config>'
- 1> ./config.xml
- config_set_boolean CONFIG_sparc32
- 1>> ./config.xml
- echo CONFIG_sparc32
- tr a-z A-Z
- option=CONFIG_SPARC32
- echo '<option name="CONFIG_SPARC32" type="boolean" value="true" />'
- [ sparc32 != sparc32 ]
- [ no = yes ]
- [ no = yes ]
- [ no = yes ]
- [ no = yes ]
- [ no = yes ]
- echo 'config test -target ' no
config test -target no
- [ no = yes ]
- config_set_boolean CONFIG_LITTLE_ENDIAN
- 1>> ./config.xml
- echo CONFIG_LITTLE_ENDIAN
- tr a-z A-Z
- option=CONFIG_LITTLE_ENDIAN
- echo '<option name="CONFIG_LITTLE_ENDIAN" type="boolean" value="true" />'
- [ no = yes ]
- [ yes = yes ]
- config_set_boolean CONFIG_IMAGE_ELF_EMBEDDED
- 1>> ./config.xml
- echo CONFIG_IMAGE_ELF_EMBEDDED
- tr a-z A-Z
- option=CONFIG_IMAGE_ELF_EMBEDDED
- echo '<option name="CONFIG_IMAGE_ELF_EMBEDDED" type="boolean" value="true" />'
- [ no = yes ]
- cat ../config/examples/sparc32_config.xml
- 1>> ./config.xml
- echo '</config>'
- 1>> ./config.xml
- ln -s ../Makefile.target ./Makefile
- xsltproc ../config/xml/xinclude.xsl ../build.xml
- 1> ./build-full.xml
- xsltproc ../config/xml/makefile.xsl ./build-full.xml
- 1> ./rules.mak
- echo ok.
ok.
- printf 'Creating config files...'
Creating config files...+ xsltproc ../config/xml/config-c.xsl ./config.xml
- 1> ./host/include/autoconf.h
- xsltproc ../config/xml/config-c.xsl ./config.xml
- 1> ./target/include/autoconf.h
- xsltproc ../config/xml/config-forth.xsl ./config.xml
- 1> ./forth/config.fs
- echo ok.
ok.
- cd ..
Nathan
-- OpenBIOS http://openbios.org/ Mailinglist: http://lists.openbios.org/mailman/listinfo Free your System - May the Forth be with you
This would fix the script to work on Solaris:
--- switch-arch.orig 2011-05-02 20:54:43.312500000 -0400 +++ switch-arch 2011-05-02 20:56:05.093750000 -0400 @@ -19,8 +19,8 @@
crosscflags() { - local host=$1 - local target=$2 + host=$1 + target=$2
This happens to work because variable $target (used in some for loops) is not used after the call to crosscflags. It's a bit fragile though. Considering the various uses of $target, I'd rename $host to $host_cpu and $target to $target_cpu in crosscflags.
On Thu, Apr 28, 2011 at 3:52 PM, Nathan Kunkee nkunkee42@hotmail.com wrote:
On 04/28/11 04:00 AM, Mark Cave-Ayland wrote:
On 27/04/11 23:01, Nathan Kunkee wrote:
I built that on opensolaris (so sparc64) with gcc 4.5.2. No cross-compiler needed, although the config script thinks I'm using one.
Ah that will probably be the problem - config/script/switch-arch contains the logic which detects how NATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH and SWAP_ENDIANNESS should be set and adds them to CFLAGS in Makefile.target as appropriate.
OK. I'll start looking to see how to change that for by build environment.
What does 'uname -m' report on your machine? We only check for sun4u/sparc64 or sparc/sparc32.
I built that on opensolaris (so sparc64) with gcc 4.5.2. No cross-compiler needed, although the config script thinks I'm using one.
Ah that will probably be the problem - config/script/switch-arch contains the logic which detects how NATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH and SWAP_ENDIANNESS should be set and adds them to CFLAGS in Makefile.target as appropriate.
OK. I'll start looking to see how to change that for by build environment.
What does 'uname -m' report on your machine? We only check for sun4u/sparc64 or sparc/sparc32.
nathan@valhalla:/export/home/nathan/$ uname -m sun4u nathan@valhalla:/export/home/nathan/$ uname -mpi sun4u sparc sun4u
From SVN, the switch-arch script thinks it has to use a cross-compiler:
nathan@valhalla:/export/home/nathan/openbios-devel$ env LANG=C sh -x ./config/scripts/switch-arch sparc32 + MOLPATH=/export/home/nathan//mol-0.9.71 + [ xsparc32 = x -o sparc32 = -help ] + test -f utils/dist/debian/rules + chmod 755 utils/dist/debian/rules + chmod 755 config/scripts/switch-arch + chmod 755 config/scripts/reldir + test x = x + archname + + head VERSION VERSION=1.0 + echo Configuring OpenBIOS on sparc64 for sparc32 Configuring OpenBIOS on sparc64 for sparc32 + target_list= + target_list= builtin-sparc32 unix-sparc32 + arch_list= + + echo builtin-sparc32 + sed s/.*-//g arch=sparc32 + test -f config/examples/sparc32_config.xml + grep -q sparc32 + echo + arch_list= sparc32 + + echo unix-sparc32 + sed s/.*-//g arch=sparc32 + test -f config/examples/sparc32_config.xml + grep -q sparc32 + echo sparc32 + unix=no + builtin=no + plain=no + mol=no + briq=no + pearpc=no + qemu=no + xbox=no + cross=no + : + builtin=yes + : + [ sparc32 != sparc64 ] + continue + BASEARCH=sparc32 + select_prefix sparc ERROR: no sparc cross-compiler found !
I got around that by adding the suffix my build of gcc is using:
--- config/scripts/switch-arch Thu Apr 28 17:18:40 2011 +++ config/scripts/switch-arch-works Sat Apr 23 20:21:29 2011 @@ -97,7 +101,7 @@
select_prefix() { - for TARGET in ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi- + for TARGET in ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi- ${1}-sun-solaris2.11- do if type ${TARGET}gcc > /dev/null 2>&1 then
I'm not sure if that is the best way to get it to use the native compiler. I can't think of a reason my sparc64 build tools couldn't build the sparc32 image.
Thanks, Nathan
On Fri, Apr 29, 2011 at 1:26 AM, Nathan Kunkee nkunkee42@hotmail.com wrote:
I built that on opensolaris (so sparc64) with gcc 4.5.2. No cross-compiler needed, although the config script thinks I'm using one.
Ah that will probably be the problem - config/script/switch-arch contains the logic which detects how NATIVE_BITWIDTH_EQUALS_HOST_BITWIDTH and SWAP_ENDIANNESS should be set and adds them to CFLAGS in Makefile.target as appropriate.
OK. I'll start looking to see how to change that for by build environment.
What does 'uname -m' report on your machine? We only check for sun4u/sparc64 or sparc/sparc32.
nathan@valhalla:/export/home/nathan/$ uname -m sun4u nathan@valhalla:/export/home/nathan/$ uname -mpi sun4u sparc sun4u
From SVN, the switch-arch script thinks it has to use a cross-compiler:
nathan@valhalla:/export/home/nathan/openbios-devel$ env LANG=C sh -x ./config/scripts/switch-arch sparc32
- MOLPATH=/export/home/nathan//mol-0.9.71
- [ xsparc32 = x -o sparc32 = -help ]
- test -f utils/dist/debian/rules
- chmod 755 utils/dist/debian/rules
- chmod 755 config/scripts/switch-arch
- chmod 755 config/scripts/reldir
- test x = x
- archname
- head VERSION
VERSION=1.0
- echo Configuring OpenBIOS on sparc64 for sparc32
Configuring OpenBIOS on sparc64 for sparc32
- target_list=
- target_list= builtin-sparc32 unix-sparc32
- arch_list=
- echo builtin-sparc32
- sed s/.*-//g
arch=sparc32
- test -f config/examples/sparc32_config.xml
- grep -q sparc32
- echo
- arch_list= sparc32
- echo unix-sparc32
- sed s/.*-//g
arch=sparc32
- test -f config/examples/sparc32_config.xml
- grep -q sparc32
- echo sparc32
- unix=no
- builtin=no
- plain=no
- mol=no
- briq=no
- pearpc=no
- qemu=no
- xbox=no
- cross=no
- :
- builtin=yes
- :
- [ sparc32 != sparc64 ]
- continue
- BASEARCH=sparc32
- select_prefix sparc
ERROR: no sparc cross-compiler found !
I got around that by adding the suffix my build of gcc is using:
--- config/scripts/switch-arch Thu Apr 28 17:18:40 2011 +++ config/scripts/switch-arch-works Sat Apr 23 20:21:29 2011 @@ -97,7 +101,7 @@
select_prefix() { - for TARGET in ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi- + for TARGET in ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi- ${1}-sun-solaris2.11- do if type ${TARGET}gcc > /dev/null 2>&1 then
I'm not sure if that is the best way to get it to use the native compiler. I can't think of a reason my sparc64 build tools couldn't build the sparc32 image.
This actually happens with OpenBSD/sparc64, the compiler can't produce 32 bit binaries at all: $ gcc -v Reading specs from /usr/lib/gcc-lib/sparc64-unknown-openbsd4.8/4.2.1/specs Target: sparc64-unknown-openbsd4.8 Configured with: OpenBSD/sparc64 system compiler Thread model: posix gcc version 4.2.1 20070719 $ touch empty.c $ gcc -m32 -c empty.c empty.c:1: error: -m32 is not supported by this configuration
But I think that this is not so common setup. So we should add logic for trying -m32 or -m64 if the host has a compatible CPU except for word size, or a cross compiler for wrong word size is found.
On 27/04/11 00:02, Nick Couchman wrote:
This patch for the scsi_options seems to work fine - system boots with the patch applied and with the line removed from /etc/system.
-Nick
That's great - thanks for testing!
ATB,
Mark.