qemu-system-sparc in qemu 1.7.0 fails to boot with Sun ROM

Bug #1262081 reported by Peter Bartoli
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QEMU
Fix Released
Undecided
Unassigned

Bug Description

1.7.0 seems to have broken booting on SPARC ... at least with a Sun ROM. Everything fails with "data access exception." 1.6.{1,2} qemu-system-sparc binaries both boot the same images that 1.7.0 fails to boot.

Type help for more information
ok boot disk1
Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@1,0 File and args:
Data Access Exception

Starting with following command:

sudo qemu-system-sparc -m 256 -M SS-5 -nographic -bios /home/img/ROMs/sun/ss5-170.bin \
  -prom-env 'boot-device=disk1' -prom-env 'auto-boot?=true' \
  -drive file=/home/doc/VMs/slagheap/sd0.raw,if=scsi,bus=0,unit=3 \
  -drive file=/home/doc/VMs/slagheap/sd1.raw,if=scsi,bus=0,unit=1 \
  -drive file=/home/doc/VMs/slagheap/sd2.raw,if=scsi,bus=0,unit=2 \
  -net nic,macaddr=DE:EE:DD:FF:EE:DD,model=lance \
  -net tap,ifname=tap0,script=/home/doc/VMs/slagheap/ifup,downscript=/home/doc/VMs/slagheap/ifdown

Revision history for this message
Peter Bartoli (peterbartoli) wrote :
Revision history for this message
Mark Cave-Ayland (mark-cave-ayland) wrote :

Hi Peter,

Thanks for the bug report - it was caused by the FCode ROM containing some Forth that depended upon some specific OpenBIOS variables that weren't present in OBP.

If you replace the QEMU,tcx.bin from QEMU 1.7 with the one attached to this bug report then you should be able to boot your VM once again - please let me know if this resolves the problem for you.

ATB,

Mark.

Revision history for this message
Mark Cave-Ayland (mark-cave-ayland) wrote :
Revision history for this message
Peter Bartoli (peterbartoli) wrote : Re: [Bug 1262081] qemu-system-sparc in qemu 1.7.0 fails to boot with Sun ROM

Very welcome! Thanks for the awesome software. It's allowed me to put my SparcServer 5 out to pasture as a demonstration machine. Really, really hoping that it supports the tcx with OBP at some point soon ... that'd be very cool.

I filed a separate bug report on that before realizing that it didn't work quite by design/limitation; please pardon my ignorance.

-peter

On Dec 20, 2013, at 9:41 AM, Mark Cave-Ayland <email address hidden> wrote:
> Hi Peter,
>
> Thanks for the bug report - it was caused by the FCode ROM containing
> some Forth that depended upon some specific OpenBIOS variables that
> weren't present in OBP.
>
> If you replace the QEMU,tcx.bin from QEMU 1.7 with the one attached to
> this bug report then you should be able to boot your VM once again -
> please let me know if this resolves the problem for you.
>
>
> ATB,
>
> Mark.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1262081
>
> Title:
> qemu-system-sparc in qemu 1.7.0 fails to boot with Sun ROM
>
> Status in QEMU:
> New
>
> Bug description:
>
> 1.7.0 seems to have broken booting on SPARC ... at least with a Sun ROM. Everything fails with "data access exception." 1.6.{1,2} qemu-system-sparc binaries both boot the same images that 1.7.0 fails to boot.
>
> Type help for more information
> ok boot disk1
> Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@1,0 File and args:
> Data Access Exception
>
> Starting with following command:
>
> sudo qemu-system-sparc -m 256 -M SS-5 -nographic -bios /home/img/ROMs/sun/ss5-170.bin \
> -prom-env 'boot-device=disk1' -prom-env 'auto-boot?=true' \
> -drive file=/home/doc/VMs/slagheap/sd0.raw,if=scsi,bus=0,unit=3 \
> -drive file=/home/doc/VMs/slagheap/sd1.raw,if=scsi,bus=0,unit=1 \
> -drive file=/home/doc/VMs/slagheap/sd2.raw,if=scsi,bus=0,unit=2 \
> -net nic,macaddr=DE:EE:DD:FF:EE:DD,model=lance \
> -net tap,ifname=tap0,script=/home/doc/VMs/slagheap/ifup,downscript=/home/doc/VMs/slagheap/ifdown
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/qemu/+bug/1262081/+subscriptions

Revision history for this message
Mark Cave-Ayland (mark-cave-ayland) wrote : Re: [Qemu-devel] [Bug 1262081] qemu-system-sparc in qemu 1.7.0 fails to boot with Sun ROM

On 23/12/13 03:02, Peter Bartoli wrote:

Hi Peter,

> Very welcome! Thanks for the awesome software. It's allowed me to put my SparcServer 5 out to pasture as a demonstration machine. Really, really hoping that it supports the tcx with OBP at some point soon ... that'd be very cool.
>
> I filed a separate bug report on that before realizing that it didn't
> work quite by design/limitation; please pardon my ignorance.

Thanks for the feedback. Actually it does boot in TCX mode with the
FCode ROM attached to this bug report - well at least you can boot into
OBP. If you're running Solaris, then the problem is that their version
of X doesn't have a TCX driver and so boot hangs after "Starting
OpenWindows". Other OS such as Linux do have a TCX driver and so work fine.

I currently have patches for a CG3 framebuffer pending that will enable
you to boot Solaris into graphics mode, which I hope will be applied soon.

Also Artyom's blog is quite out of date with respect to OpenBIOS -
OpenBIOS has been able to boot my test Solaris 8 image for over 2 years
now so you may find that you can get by without the proprietary Sun ROM
(and avoid having to manually type a boot command into OBP every time
you restart). Unfortunately the OpenBIOS binaries for 1.7 also have a
bug that breaks booting from hard disks (CDROMs are fine), but the
updated binaries should be merged into git in time for the next 1.7.x
release.

HTH,

Mark.

Revision history for this message
Peter Bartoli (peterbartoli) wrote :

I can confirm, by the way, that the QEMU,tcx.bin replacement does indeed allow the

On Dec 23, 2013, at 12:05 AM, Mark Cave-Ayland <email address hidden> wrote:
> Thanks for the feedback. Actually it does boot in TCX mode with the
> FCode ROM attached to this bug report - well at least you can boot into
> OBP. If you're running Solaris, then the problem is that their version
> of X doesn't have a TCX driver and so boot hangs after "Starting
> OpenWindows". Other OS such as Linux do have a TCX driver and so work fine.

I could *definitely* build another version of X and start it after boot, but the problem I've had is that, at least on the Mac, I can't get QEMU to build w/ libSDL, and the Cocoa UI doesn't work when you use OBP. See bug #1260555 and https://trac.macports.org/ticket/41435 ...

> I currently have patches for a CG3 framebuffer pending that will enable
> you to boot Solaris into graphics mode, which I hope will be applied soon.

That is AWESOME news. Really, I'm hoping to just have a text-based console like on my SS5 with the old familiar Sun logo and to start

> Also Artyom's blog is quite out of date with respect to OpenBIOS -
> OpenBIOS has been able to boot my test Solaris 8 image for over 2 years
> now so you may find that you can get by without the proprietary Sun ROM
> (and avoid having to manually type a boot command into OBP every time
> you restart). Unfortunately the OpenBIOS binaries for 1.7 also have a
> bug that breaks booting from hard disks (CDROMs are fine), but the
> updated binaries should be merged into git in time for the next 1.7.x
> release.

Again, great news. I'm running Solaris 2.5.1 ... any clue if OpenBIOS might work for me?

If I may, do you know why qemu-system-sparc w/ OBP ignores the following prom-env options?

   -prom-env 'boot-device=disk1' -prom-env 'auto-boot?=true'

-peter

Revision history for this message
Mark Cave-Ayland (mark-cave-ayland) wrote : Re: [Qemu-devel] [Bug 1262081] Re: qemu-system-sparc in qemu 1.7.0 fails to boot with Sun ROM

On 23/12/13 21:00, Peter Bartoli wrote:

>> I currently have patches for a CG3 framebuffer pending that will enable
>> you to boot Solaris into graphics mode, which I hope will be applied soon.
>
> That is AWESOME news. Really, I'm hoping to just have a text-based
> console like on my SS5 with the old familiar Sun logo and to start

..X?

>> Also Artyom's blog is quite out of date with respect to OpenBIOS -
>> OpenBIOS has been able to boot my test Solaris 8 image for over 2 years
>> now so you may find that you can get by without the proprietary Sun ROM
>> (and avoid having to manually type a boot command into OBP every time
>> you restart). Unfortunately the OpenBIOS binaries for 1.7 also have a
>> bug that breaks booting from hard disks (CDROMs are fine), but the
>> updated binaries should be merged into git in time for the next 1.7.x
>> release.
>
> Again, great news. I'm running Solaris 2.5.1 ... any clue if OpenBIOS
> might work for me?

No idea - I don't have many Solaris images for testing at all, so just
try it and see. Although you need to wait for the fixed binaries to hit
the QEMU 1.7/master git repo to fix another outstanding SPARC boot bug.

> If I may, do you know why qemu-system-sparc w/ OBP ignores the following
> prom-env options?
>
> -prom-env 'boot-device=disk1' -prom-env 'auto-boot?=true'

That's because the boot parameters are passed to the PROM via a QEMU
custom FW interface (which OBP has no knowledge of) rather than by
having QEMU emulate the NVRAM in exactly the same way as real hardware.

ATB,

Mark.

Revision history for this message
Peter Bartoli (peterbartoli) wrote :

On Dec 24, 2013, at 6:22 AM, Mark Cave-Ayland <email address hidden> wrote:
> On 23/12/13 21:00, Peter Bartoli wrote:
>
>>> I currently have patches for a CG3 framebuffer pending that will enable
>>> you to boot Solaris into graphics mode, which I hope will be applied soon.
>>
>> That is AWESOME news. Really, I'm hoping to just have a text-based
>> console like on my SS5 with the old familiar Sun logo and to start
>
> ..X?

Sorry, yes ... to be able to start X on demand now and again would be awesome.

>>> Also Artyom's blog is quite out of date with respect to OpenBIOS -
>>> OpenBIOS has been able to boot my test Solaris 8 image for over 2 years
>>> now so you may find that you can get by without the proprietary Sun ROM
>>> (and avoid having to manually type a boot command into OBP every time
>>> you restart). Unfortunately the OpenBIOS binaries for 1.7 also have a
>>> bug that breaks booting from hard disks (CDROMs are fine), but the
>>> updated binaries should be merged into git in time for the next 1.7.x
>>> release.
>>
>> Again, great news. I'm running Solaris 2.5.1 ... any clue if OpenBIOS
>> might work for me?
>
> No idea - I don't have many Solaris images for testing at all, so just try it and see. Although you need to wait for the fixed binaries to hit the QEMU 1.7/master git repo to fix another outstanding SPARC boot bug.

Standing by and looking forward to it!

>> If I may, do you know why qemu-system-sparc w/ OBP ignores the following
>> prom-env options?
>>
>> -prom-env 'boot-device=disk1' -prom-env 'auto-boot?=true'
>
> That's because the boot parameters are passed to the PROM via a QEMU custom FW interface (which OBP has no knowledge of) rather than by having QEMU emulate the NVRAM in exactly the same way as real hardware.

Makes sense; thanks for clarifying!

-peter

Revision history for this message
Artyom Tarasenko (atar4qemu) wrote : Re: [Qemu-devel] [Bug 1262081] Re: qemu-system-sparc in qemu 1.7.0 fails to boot with Sun ROM

On Tue, Dec 24, 2013 at 3:22 PM, Mark Cave-Ayland
<email address hidden> wrote:
> On 23/12/13 21:00, Peter Bartoli wrote:
>
>>> I currently have patches for a CG3 framebuffer pending that will enable
>>> you to boot Solaris into graphics mode, which I hope will be applied
>>> soon.
>>
>>
>> That is AWESOME news. Really, I'm hoping to just have a text-based
>> console like on my SS5 with the old familiar Sun logo and to start
>
>
> ..X?
>
>
>>> Also Artyom's blog is quite out of date with respect to OpenBIOS -
>>> OpenBIOS has been able to boot my test Solaris 8 image for over 2 years
>>> now so you may find that you can get by without the proprietary Sun ROM
>>> (and avoid having to manually type a boot command into OBP every time
>>> you restart). Unfortunately the OpenBIOS binaries for 1.7 also have a
>>> bug that breaks booting from hard disks (CDROMs are fine), but the
>>> updated binaries should be merged into git in time for the next 1.7.x
>>> release.
>>
>>
>> Again, great news. I'm running Solaris 2.5.1 ... any clue if OpenBIOS
>> might work for me?
>
>
> No idea - I don't have many Solaris images for testing at all, so just try
> it and see. Although you need to wait for the fixed binaries to hit the QEMU
> 1.7/master git repo to fix another outstanding SPARC boot bug.
>
>
>> If I may, do you know why qemu-system-sparc w/ OBP ignores the following
>> prom-env options?
>>
>> -prom-env 'boot-device=disk1' -prom-env 'auto-boot?=true'
>
>
> That's because the boot parameters are passed to the PROM via a QEMU custom
> FW interface (which OBP has no knowledge of) rather than by having QEMU
> emulate the NVRAM in exactly the same way as real hardware.

Actually QEMU does set variables in NVRAM (hw/sparc/sun4m.c:151), and
afaik uses the layout of open-sourced OBP. The problem is that earlier
versions of OBP seemed to have a different layout, or maybe just a
magic constant is missing somewhere.

Artyom

--
Regards,
Artyom Tarasenko

linux/sparc and solaris/sparc under qemu blog:
http://tyom.blogspot.com/search/label/qemu

Revision history for this message
Artyom Tarasenko (atar4qemu) wrote : Re: [Qemu-devel] [Bug 1262081] qemu-system-sparc in qemu 1.7.0 fails to boot with Sun ROM

> Also Artyom's blog is quite out of date with respect to OpenBIOS - OpenBIOS
> has been able to boot my test Solaris 8 image for over 2 years now so you
> may find that you can get by without the proprietary Sun ROM (and avoid
> having to manually type a boot command into OBP every time you restart).

Point taken. Added lists of Solaris kernels known to boot and not to
boot with OpenBIOS.
Feel free to submit yours if it's not in the lists yet. ;-)

Artyom
--
Regards,
Artyom Tarasenko

linux/sparc and solaris/sparc under qemu blog:
http://tyom.blogspot.com/search/label/qemu

Revision history for this message
Mark Cave-Ayland (mark-cave-ayland) wrote :

On 28/12/13 17:30, Artyom Tarasenko wrote:

>> Also Artyom's blog is quite out of date with respect to OpenBIOS - OpenBIOS
>> has been able to boot my test Solaris 8 image for over 2 years now so you
>> may find that you can get by without the proprietary Sun ROM (and avoid
>> having to manually type a boot command into OBP every time you restart).
>
> Point taken. Added lists of Solaris kernels known to boot and not to
> boot with OpenBIOS.
> Feel free to submit yours if it's not in the lists yet. ;-)

Hi Artyom,

Thanks for this - it looks great! Some minor things I've noticed:

1) In the OpenBIOS section, the 2 SunOS 5.9 releases are listed together
on the same line (missing line break?)

2) You don't need to use -prom-env 'auto-boot?=false' when booting from
a cdrom with OpenBIOS. Just use '-boot d' to make sure that QEMU tells
OpenBIOS that it wants to boot from cdrom or '-boot c' to boot from a
disk image using the FW_CFG interface.

(Perhaps the bug here is that if no boot device is explicitly specified
then QEMU should try and set a sensible default based upon the current
device tree? But adding an explicit '-boot x' to the QEMU command line
should always work, regardless of how the boot ordering code changes in
future)

Also you can add my Solaris 8 test image to your OpenBIOS compatibility
list which displays as "SunOS Release 5.8 Version Generic_108528-09
32-bit" on boot (or is the -29 suffix a typing error?)

ATB,

Mark.

Revision history for this message
Artyom Tarasenko (atar4qemu) wrote :

On Sat, Dec 28, 2013 at 6:52 PM, Mark Cave-Ayland
<email address hidden> wrote:
> On 28/12/13 17:30, Artyom Tarasenko wrote:
>
>>> Also Artyom's blog is quite out of date with respect to OpenBIOS -
>>> OpenBIOS
>>> has been able to boot my test Solaris 8 image for over 2 years now so you
>>> may find that you can get by without the proprietary Sun ROM (and avoid
>>> having to manually type a boot command into OBP every time you restart).
>>
>>
>> Point taken. Added lists of Solaris kernels known to boot and not to
>> boot with OpenBIOS.
>> Feel free to submit yours if it's not in the lists yet. ;-)
>
>
> Hi Artyom,
>
> Thanks for this - it looks great! Some minor things I've noticed:
>
> 1) In the OpenBIOS section, the 2 SunOS 5.9 releases are listed together on
> the same line (missing line break?)
>
> 2) You don't need to use -prom-env 'auto-boot?=false' when booting from a
> cdrom with OpenBIOS. Just use '-boot d' to make sure that QEMU tells
> OpenBIOS that it wants to boot from cdrom or '-boot c' to boot from a disk
> image using the FW_CFG interface.
>
> (Perhaps the bug here is that if no boot device is explicitly specified then
> QEMU should try and set a sensible default based upon the current device
> tree? But adding an explicit '-boot x' to the QEMU command line should
> always work, regardless of how the boot ordering code changes in future)
>
> Also you can add my Solaris 8 test image to your OpenBIOS compatibility list
> which displays as "SunOS Release 5.8 Version Generic_108528-09 32-bit" on
> boot (or is the -29 suffix a typing error?)

Hi Mark,

Done. Thanks for the feedback!

Artyom

--
Regards,
Artyom Tarasenko

linux/sparc and solaris/sparc under qemu blog:
http://tyom.blogspot.com/search/label/qemu

Revision history for this message
Peter Bartoli (peterbartoli) wrote : Re: [Qemu-devel] [Bug 1262081] Re: qemu-system-sparc in qemu 1.7.0 fails to boot with Sun ROM

On Dec 28, 2013, at 2:00 AM, Artyom Tarasenko <email address hidden> wrote:
> Actually QEMU does set variables in NVRAM (hw/sparc/sun4m.c:151), and
> afaik uses the layout of open-sourced OBP. The problem is that earlier
> versions of OBP seemed to have a different layout, or maybe just a
> magic constant is missing somewhere.

Is there a specific version of OBP that you're aware of that works? That'd sure be nice.

-peter

Revision history for this message
Artyom Tarasenko (atar4qemu) wrote :

On Tue, Dec 31, 2013 at 2:43 AM, Peter Bartoli <email address hidden> wrote:
>
> On Dec 28, 2013, at 2:00 AM, Artyom Tarasenko <email address hidden> wrote:
>
> Actually QEMU does set variables in NVRAM (hw/sparc/sun4m.c:151), and
> afaik uses the layout of open-sourced OBP. The problem is that earlier
> versions of OBP seemed to have a different layout, or maybe just a
> magic constant is missing somewhere.
>
>
> Is there a specific version of OBP that you're aware of that works? That'd
> sure be nice.

No, not that I know of. In theory the 4.x versions should work, but I
never saw one for a sun4m machine.

Artyom

--
Regards,
Artyom Tarasenko

linux/sparc and solaris/sparc under qemu blog:
http://tyom.blogspot.com/search/label/qemu

Revision history for this message
Peter Bartoli (peterbartoli) wrote :

Thanks, Artyom.

Heads up: Solaris 2.5.1 doesn't boot with OpenBIOS. I'll be happy to help with some regression testing, if you like.

-peter

On Dec 31, 2013, at 8:02 AM, Artyom Tarasenko <email address hidden> wrote:
> On Tue, Dec 31, 2013 at 2:43 AM, Peter Bartoli <email address hidden> wrote:
>>
>> On Dec 28, 2013, at 2:00 AM, Artyom Tarasenko <email address hidden> wrote:
>>
>> Actually QEMU does set variables in NVRAM (hw/sparc/sun4m.c:151), and
>> afaik uses the layout of open-sourced OBP. The problem is that earlier
>> versions of OBP seemed to have a different layout, or maybe just a
>> magic constant is missing somewhere.
>>
>>
>> Is there a specific version of OBP that you're aware of that works? That'd
>> sure be nice.
>
> No, not that I know of. In theory the 4.x versions should work, but I
> never saw one for a sun4m machine.
>
> Artyom
>
> --
> Regards,
> Artyom Tarasenko
>
> linux/sparc and solaris/sparc under qemu blog:
> http://tyom.blogspot.com/search/label/qemu

Revision history for this message
Mark Cave-Ayland (mark-cave-ayland) wrote :

Hi Peter,

Just to add that the updated OpenBIOS images attached above are now in QEMU git master. I've CC'd qemu-stable so they should get merged into the next 1.7.x release too.

ATB,

Mark.

Revision history for this message
Mark Cave-Ayland (mark-cave-ayland) wrote :

Marking as "Fix released" as qemu 1.7.1 with the updated OpenBIOS images is now available.

ATB,

Mark.

Changed in qemu:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.