qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] endianness and network emulation for PowerPC
@ 2008-02-18 20:57 Hollis Blanchard
  2008-02-19 18:05 ` [Qemu-devel] " Rob Landley
  0 siblings, 1 reply; 2+ messages in thread
From: Hollis Blanchard @ 2008-02-18 20:57 UTC (permalink / raw)
  To: Rob Landley; +Cc: firmware, qemu-devel

I've been debugging network problems in qemu for a week or two, and
there seem to be some pervasive misunderstandings about endianness. I'm
trying to use a big-endian target on a big-endian guest, and this has
exposed a lot of breakage, including qemu's pci-host.h, isa_mmio.c,
rtl8139.c and ne2000.c.

Rob, I noticed that you're using Linux's "ne.c" in your PowerPC PReP
kernel build for qemu, and to my surprise it actually works for me on a
big-endian host! I'm wondering if you chose ne.c because you found the
other network drivers to be broken?

(Actually I believe this is also working by accident: outsw() in Linux
writes big-endian data, which is incorrectly swapped in isa_mmio.c, and
then incorrectly swapped again in ne2000.c.)

-- 
Hollis Blanchard
IBM Linux Technology Center

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Qemu-devel] Re: endianness and network emulation for PowerPC
  2008-02-18 20:57 [Qemu-devel] endianness and network emulation for PowerPC Hollis Blanchard
@ 2008-02-19 18:05 ` Rob Landley
  0 siblings, 0 replies; 2+ messages in thread
From: Rob Landley @ 2008-02-19 18:05 UTC (permalink / raw)
  To: Hollis Blanchard; +Cc: firmware, qemu-devel

On Monday 18 February 2008 14:57:57 Hollis Blanchard wrote:
> I've been debugging network problems in qemu for a week or two, and
> there seem to be some pervasive misunderstandings about endianness. I'm
> trying to use a big-endian target on a big-endian guest, and this has
> exposed a lot of breakage, including qemu's pci-host.h, isa_mmio.c,
> rtl8139.c and ne2000.c.
>
> Rob, I noticed that you're using Linux's "ne.c" in your PowerPC PReP
> kernel build for qemu, and to my surprise it actually works for me on a
> big-endian host! I'm wondering if you chose ne.c because you found the
> other network drivers to be broken?

Probably.  I sometimes have to hunt around for a bit to find a network card 
emulation that works on a given platform.  (Generally on a platform where I'm 
using an rtl8139, it means the default ne2k didn't work when I tried it.  I 
remember arm didn't have PIO working back in 0.9.0...)

I haven't tried to do a little endian PPC yet.  (Nor have I gotten arm big 
endian to work yet.  Or gotten super hitachi to successfully do _anything_.)

I'm doing http://landley.net/code/firmware in part to get coverage of as many 
qemu platforms as possible, and get basic Linux systems up and running 
on 'em.  (If I get really bored, I'll try X and see what the framebuffers 
do... :)  However, I do tend to declare victory and move on once I've gotten 
it to boot to userspace with a serial console, hard drive, network card, and 
realtime clock.  That's enough to do native builds with distcc calling out to 
the cross compiler for a speed boost...

Rob
-- 
"One of my most productive days was throwing away 1000 lines of code."
  - Ken Thompson.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-19 18:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-18 20:57 [Qemu-devel] endianness and network emulation for PowerPC Hollis Blanchard
2008-02-19 18:05 ` [Qemu-devel] " Rob Landley

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).