* [Qemu-devel] Small powerpc system emulation problem with linux
@ 2009-01-14 16:21 Lennart Sorensen
2009-01-14 16:37 ` Aurelien Jarno
0 siblings, 1 reply; 9+ messages in thread
From: Lennart Sorensen @ 2009-01-14 16:21 UTC (permalink / raw)
To: qemu-devel
I did a subversion checkout of qemu last week and built it, and no
problems with that part so far.
I noticed it now supports using openbios-ppc32 instead of openhackware,
so I went looking for that and did a subversion checkout of openbios
and the fcode tools. I used the openbios-elf ppc object as openbios-ppc32
and qemu seems quite happy with that.
I then booted a debian 4.0 (etch) install cd, but the network interface
didn't work (it gave a dumb error about the PCI bar 0 which was clearly
wrong). I then grabbed a daily build of debian 5.0 (lenny) instead, and
booted that, and then networking worked fine. I installed debian, and
had no problems until I hit installing the bootloader.
Debian tried to isntall the quik boot loader for oldworld mac's since
that is what /proc/cpuinfo in linux claims to see, even though powermac
g3 blue&white boxes (I have one here) is newworld, as are all powermac's
using openfirmware 3. newworld systems should use yaboot, but of course
the installer had not setup the partitions for yaboot since it didn't
see a newworld machine, and yaboot's installer refused to run since it
wasn't a newworld machine. quik boot's installer also refused to run
since it wasn't a supported oldworld machine either.
So I managed to lie to yaboot enough to convince it to run the ofpath
tools and such as if it was a newworld machine, and that all worked
fine, other than failing to access some part of nvram as far as I can
tell.
On rebooting I found that yaboot loaded from the disk, but failed to
load the system. Turns out debian uses an ancient version of yaboot
that doesn't correctly work on some newer systems, and has issues with
initrd images. I found a newer binary for yaboot and replaced it in the
bootstrap partition using a loopback mount. After doing this, it
finally loaded and booted. I now have a working debian system on qemu.
So the main problems seem to be that the openbios firmware doesn't
include an entry for 'interrupt-controller' which is the entry the linux
kernel looks for to device a machine is newworld rather than oldworld in
the powermac setup. The other is that debian's yaboot is out of date.
The yaboot problem is being worked on.
So now I am wondering what has to be done to make qemu appear as a
newworld mac, since that is what the machine it claims to emulate is.
Is this simply a mistake in openbios for qemu or does qemu actually
emulate oldworld to some extent?
I tried adding an entry for 'interrupt-controller' following the pearpc
code in openbios, but that just resulted in a failure to boot the linux
kernel, probably because it tried to access the machine as a newworld
box, and couldn't find something it needed. I wish I knew how to dump
the openfirmware tree on the real powermac g3 to see what it has
compared to what qemu with openbios currently sees.
Any hints would be appreciated.
--
Len Sorensen
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] Small powerpc system emulation problem with linux
2009-01-14 16:21 [Qemu-devel] Small powerpc system emulation problem with linux Lennart Sorensen
@ 2009-01-14 16:37 ` Aurelien Jarno
2009-01-14 23:08 ` Lennart Sorensen
0 siblings, 1 reply; 9+ messages in thread
From: Aurelien Jarno @ 2009-01-14 16:37 UTC (permalink / raw)
To: qemu-devel
On Wed, Jan 14, 2009 at 11:21:40AM -0500, Lennart Sorensen wrote:
> I did a subversion checkout of qemu last week and built it, and no
> problems with that part so far.
>
> I noticed it now supports using openbios-ppc32 instead of openhackware,
> so I went looking for that and did a subversion checkout of openbios
> and the fcode tools. I used the openbios-elf ppc object as openbios-ppc32
> and qemu seems quite happy with that.
First of all, please retry with the current SVN, a lot of things have
been fixed.
> I then booted a debian 4.0 (etch) install cd, but the network interface
> didn't work (it gave a dumb error about the PCI bar 0 which was clearly
> wrong). I then grabbed a daily build of debian 5.0 (lenny) instead, and
> booted that, and then networking worked fine. I installed debian, and
> had no problems until I hit installing the bootloader.
This is a known problem, looks like there is a problem with IO ports. You
can workaround the problem by using an other card, like e1000.
> Debian tried to isntall the quik boot loader for oldworld mac's since
> that is what /proc/cpuinfo in linux claims to see, even though powermac
> g3 blue&white boxes (I have one here) is newworld, as are all powermac's
> using openfirmware 3. newworld systems should use yaboot, but of course
> the installer had not setup the partitions for yaboot since it didn't
> see a newworld machine, and yaboot's installer refused to run since it
> wasn't a newworld machine. quik boot's installer also refused to run
> since it wasn't a supported oldworld machine either.
The machine that is emulated is actually a g3beige, that is an OldWorld
machine. Installing quik on such machine is correct. Note that the
current version of debian installer installs a totally buggy quik.conf
file. It has to be fixed manually.
> So I managed to lie to yaboot enough to convince it to run the ofpath
> tools and such as if it was a newworld machine, and that all worked
> fine, other than failing to access some part of nvram as far as I can
> tell.
>
> On rebooting I found that yaboot loaded from the disk, but failed to
> load the system. Turns out debian uses an ancient version of yaboot
> that doesn't correctly work on some newer systems, and has issues with
> initrd images. I found a newer binary for yaboot and replaced it in the
> bootstrap partition using a loopback mount. After doing this, it
> finally loaded and booted. I now have a working debian system on qemu.
Quik is now working correctly with the current SVN.
> So the main problems seem to be that the openbios firmware doesn't
> include an entry for 'interrupt-controller' which is the entry the linux
> kernel looks for to device a machine is newworld rather than oldworld in
> the powermac setup. The other is that debian's yaboot is out of date.
No, this is actually normal, as an OldWorld machine is emulated.
> The yaboot problem is being worked on.
>
> So now I am wondering what has to be done to make qemu appear as a
> newworld mac, since that is what the machine it claims to emulate is.
> Is this simply a mistake in openbios for qemu or does qemu actually
> emulate oldworld to some extent?
The machine in ppc_oldworld.c is an OldWorld machine. There has been
some mistakes in both OpenBIOS and QEMU, that should now be fixed.
We plan to emulated a NewWorld machine using ppc_chrp.c as a basis when
all the problem with the OldWorld machine have been solved.
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' aurel32@debian.org | aurelien@aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] Small powerpc system emulation problem with linux
2009-01-14 16:37 ` Aurelien Jarno
@ 2009-01-14 23:08 ` Lennart Sorensen
2009-01-14 23:26 ` Aurelien Jarno
0 siblings, 1 reply; 9+ messages in thread
From: Lennart Sorensen @ 2009-01-14 23:08 UTC (permalink / raw)
To: qemu-devel
On Wed, Jan 14, 2009 at 05:37:16PM +0100, Aurelien Jarno wrote:
> First of all, please retry with the current SVN, a lot of things have
> been fixed.
But it has only been a couple of days. :)
> This is a known problem, looks like there is a problem with IO ports. You
> can workaround the problem by using an other card, like e1000.
Or using 2.6.26 worked too. Maybe 2.6.18 did something wrong.
> The machine that is emulated is actually a g3beige, that is an OldWorld
> machine. Installing quik on such machine is correct. Note that the
> current version of debian installer installs a totally buggy quik.conf
> file. It has to be fixed manually.
Ehm, linux kernel detected it as a g3blue&white. I wonder why it would
misdetect it that way.
> Quik is now working correctly with the current SVN.
Oh OK. I will try updating and then redoing the install with quik.
> No, this is actually normal, as an OldWorld machine is emulated.
Yeah so I noticed. Still made me confused since the machine type
detected by the linux kernel is supposed to be newworld, but it also
detects the machine as oldworld. So qemu bug or linux kernel bug?
> The machine in ppc_oldworld.c is an OldWorld machine. There has been
> some mistakes in both OpenBIOS and QEMU, that should now be fixed.
OK, I will try an update and see what happens.
> We plan to emulated a NewWorld machine using ppc_chrp.c as a basis when
> all the problem with the OldWorld machine have been solved.
Oh OK. Given the progress on ppc emulation since 0.9.1, I am sure it
won't be long before that is all working very well.
--
Len Sorensen
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] Small powerpc system emulation problem with linux
2009-01-14 23:08 ` Lennart Sorensen
@ 2009-01-14 23:26 ` Aurelien Jarno
2009-01-14 23:44 ` Laurent Vivier
2009-01-15 16:12 ` Lennart Sorensen
0 siblings, 2 replies; 9+ messages in thread
From: Aurelien Jarno @ 2009-01-14 23:26 UTC (permalink / raw)
To: qemu-devel
On Wed, Jan 14, 2009 at 06:08:38PM -0500, Lennart Sorensen wrote:
> On Wed, Jan 14, 2009 at 05:37:16PM +0100, Aurelien Jarno wrote:
> > First of all, please retry with the current SVN, a lot of things have
> > been fixed.
>
> But it has only been a couple of days. :)
A lot of changes have been done today...
> > This is a known problem, looks like there is a problem with IO ports. You
> > can workaround the problem by using an other card, like e1000.
>
> Or using 2.6.26 worked too. Maybe 2.6.18 did something wrong.
No, just that the 2.6.26 has both a 8139too and 8139cp driver. The
8139cp is able to use the card, given it only uses MMIO.
> > The machine that is emulated is actually a g3beige, that is an OldWorld
> > machine. Installing quik on such machine is correct. Note that the
> > current version of debian installer installs a totally buggy quik.conf
> > file. It has to be fixed manually.
>
> Ehm, linux kernel detected it as a g3blue&white. I wonder why it would
> misdetect it that way.
Because of a bug in OpenBIOS.
> > Quik is now working correctly with the current SVN.
>
> Oh OK. I will try updating and then redoing the install with quik.
>
> > No, this is actually normal, as an OldWorld machine is emulated.
>
> Yeah so I noticed. Still made me confused since the machine type
> detected by the linux kernel is supposed to be newworld, but it also
> detects the machine as oldworld. So qemu bug or linux kernel bug?
OpenBIOS bug, already fixed in the current SVN.
> > The machine in ppc_oldworld.c is an OldWorld machine. There has been
> > some mistakes in both OpenBIOS and QEMU, that should now be fixed.
>
> OK, I will try an update and see what happens.
>
> > We plan to emulated a NewWorld machine using ppc_chrp.c as a basis when
> > all the problem with the OldWorld machine have been solved.
>
> Oh OK. Given the progress on ppc emulation since 0.9.1, I am sure it
> won't be long before that is all working very well.
>
--
.''`. Aurelien Jarno | GPG: 1024D/F1BCDB73
: :' : Debian developer | Electrical Engineer
`. `' aurel32@debian.org | aurelien@aurel32.net
`- people.debian.org/~aurel32 | www.aurel32.net
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] Small powerpc system emulation problem with linux
2009-01-14 23:26 ` Aurelien Jarno
@ 2009-01-14 23:44 ` Laurent Vivier
2009-01-15 16:12 ` Lennart Sorensen
1 sibling, 0 replies; 9+ messages in thread
From: Laurent Vivier @ 2009-01-14 23:44 UTC (permalink / raw)
To: qemu-devel
Le 15 janv. 09 à 00:26, Aurelien Jarno a écrit :
>
>>> The machine that is emulated is actually a g3beige, that is an
>>> OldWorld
>>> machine. Installing quik on such machine is correct. Note that the
>>> current version of debian installer installs a totally buggy
>>> quik.conf
>>> file. It has to be fixed manually.
>>
>> Ehm, linux kernel detected it as a g3blue&white. I wonder why it
>> would
>> misdetect it that way.
>
> Because of a bug in OpenBIOS.
Can we call this a bug ?
In fact linux looks at the "model" and "compatible" properties of the
root node (.
Originally we put "PowerMac1,1" in "model" which is Blue&White, but
now according the product number of the mac-io device we put
"AAPL,PowerMac G3" in "compatible" which is Beige.
Regards,
Laurent
-------------------- laurent@lvivier.info --------------------
"Tout ce qui est impossible reste à accomplir" Jules Verne
"Things are only impossible until they're not" Jean-Luc Picard
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] Small powerpc system emulation problem with linux
2009-01-14 23:26 ` Aurelien Jarno
2009-01-14 23:44 ` Laurent Vivier
@ 2009-01-15 16:12 ` Lennart Sorensen
1 sibling, 0 replies; 9+ messages in thread
From: Lennart Sorensen @ 2009-01-15 16:12 UTC (permalink / raw)
To: qemu-devel
On Thu, Jan 15, 2009 at 12:26:05AM +0100, Aurelien Jarno wrote:
> A lot of changes have been done today...
Yeah apparently so. I see linux no longer thinks it is a g3blue&white,
but a g3 silk. Seems more likely to be correct.
> No, just that the 2.6.26 has both a 8139too and 8139cp driver. The
> 8139cp is able to use the card, given it only uses MMIO.
It appears to be emulating an rtl8029 not an 8139. The 8029 is
ne2k-pci. rtl8019 was ne2k isa. Nothing to do with 8139too and 8139cp.
--
Len Sorensen
^ permalink raw reply [flat|nested] 9+ messages in thread
* RE: [Qemu-devel] Small powerpc system emulation problem with linux
@ 2009-01-14 16:41 laurent
2009-01-14 23:05 ` Lennart Sorensen
0 siblings, 1 reply; 9+ messages in thread
From: laurent @ 2009-01-14 16:41 UTC (permalink / raw)
To: qemu-devel; +Cc: lsorense
[...]
>Debian tried to isntall the quik boot loader for oldworld mac's since
>that is what /proc/cpuinfo in linux claims to see, even though powermac
>g3 blue&white boxes (I have one here) is newworld, as are all powermac's
qemu emulates now by default a G3 beige (Silk), which is oldworld.
>using openfirmware 3. newworld systems should use yaboot, but of course
>the installer had not setup the partitions for yaboot since it didn't
>see a newworld machine, and yaboot's installer refused to run since it
>wasn't a newworld machine. quik boot's installer also refused to run
>since it wasn't a supported oldworld machine either.
In last openbios, I've managed to be able to boot with quik. But debian-installer doesn't create a correct quik.conf.
[...]
>So the main problems seem to be that the openbios firmware doesn't
>include an entry for 'interrupt-controller' which is the entry the linux
>kernel looks for to device a machine is newworld rather than oldworld in
>the powermac setup. The other is that debian's yaboot is out of date.
As qemu emulates a newworld machine, openbios doesn't create an entry for interrupt-controller.
>The yaboot problem is being worked on.
>
>So now I am wondering what has to be done to make qemu appear as a
>newworld mac, since that is what the machine it claims to emulate is.
>Is this simply a mistake in openbios for qemu or does qemu actually
>emulate oldworld to some extent?
use qemu with "-M mac99". But for the moment it doesn't support openbios.
>
>I tried adding an entry for 'interrupt-controller' following the pearpc
>code in openbios, but that just resulted in a failure to boot the linux
Bad Idea...
>kernel, probably because it tried to access the machine as a newworld
>box, and couldn't find something it needed. I wish I knew how to dump
>the openfirmware tree on the real powermac g3 to see what it has
>compared to what qemu with openbios currently sees.
lsprop /proc/device-tree
Regards,
Laurent
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] Small powerpc system emulation problem with linux
2009-01-14 16:41 laurent
@ 2009-01-14 23:05 ` Lennart Sorensen
2009-01-14 23:36 ` Laurent Vivier
0 siblings, 1 reply; 9+ messages in thread
From: Lennart Sorensen @ 2009-01-14 23:05 UTC (permalink / raw)
To: laurent; +Cc: qemu-devel
On Wed, Jan 14, 2009 at 05:41:19PM +0100, laurent@lvivier.info wrote:
> qemu emulates now by default a G3 beige (Silk), which is oldworld.
Hmm, I guess I got confused because the linux 2.6.26 kernel detects it
as type 66 (Blue&White G3). ANd of course I read somewhere that
openfirmware 3 was only ever used on newworld Macs, and that seems to be
what openbios implements.
> In last openbios, I've managed to be able to boot with quik. But debian-installer doesn't create a correct quik.conf.
I can't get quik to work, but yaboot works. Well after convincing it
that it was a newworld machine.
> As qemu emulates a newworld machine, openbios doesn't create an entry for interrupt-controller.
According to the powermac setup in the linux kernel, only newworld
machines have the entry for 'interrupt-controller' so you must mean qemu
emulates oldworld, which is what you said at the top.
> use qemu with "-M mac99". But for the moment it doesn't support openbios.
Yeah I noticed. So far mac99 didn't seem functional to me.
> Bad Idea...
So it seemed.
> lsprop /proc/device-tree
Hmm, OK. I will try that.
So for some reason I have it working with yaboot (which is supposedly
only for newworld machines) along with openbios. Hmm.
--
Len Sorensen
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Qemu-devel] Small powerpc system emulation problem with linux
2009-01-14 23:05 ` Lennart Sorensen
@ 2009-01-14 23:36 ` Laurent Vivier
0 siblings, 0 replies; 9+ messages in thread
From: Laurent Vivier @ 2009-01-14 23:36 UTC (permalink / raw)
To: Lennart Sorensen; +Cc: qemu-devel
Le 15 janv. 09 à 00:05, Lennart Sorensen a écrit :
> [...]
>> lsprop /proc/device-tree
>
> Hmm, OK. I will try that.
>
Look at this:
http://penguinppc.org/historical/dev-trees-html/
> So for some reason I have it working with yaboot (which is supposedly
> only for newworld machines) along with openbios. Hmm.
In fact oldworld machines have buggy openfirmware but linux detects
them by looking if there is an interrupt-controller.
Better way should to look at the openprom model property.
We have chosen to emulate an oldworld machine first, because hardware
is simpler, but we are using openbios which is a v3 openfirmware. So
we have an oldworld hardware with v3 openfirmware. To be able to boot
we add in the openbios device tree some "AAPL," properties linux uses
on oldworld machines.
Regards,
Laurent
-------------------- laurent@lvivier.info --------------------
"Tout ce qui est impossible reste à accomplir" Jules Verne
"Things are only impossible until they're not" Jean-Luc Picard
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2009-01-15 16:12 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-14 16:21 [Qemu-devel] Small powerpc system emulation problem with linux Lennart Sorensen
2009-01-14 16:37 ` Aurelien Jarno
2009-01-14 23:08 ` Lennart Sorensen
2009-01-14 23:26 ` Aurelien Jarno
2009-01-14 23:44 ` Laurent Vivier
2009-01-15 16:12 ` Lennart Sorensen
-- strict thread matches above, loose matches on Subject: below --
2009-01-14 16:41 laurent
2009-01-14 23:05 ` Lennart Sorensen
2009-01-14 23:36 ` Laurent Vivier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).