qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] PPC emulation, how?
@ 2004-04-13 18:08 Francisco José Cañizares Santofimia
  2004-04-13 18:56 ` Jocelyn Mayer
  0 siblings, 1 reply; 12+ messages in thread
From: Francisco José Cañizares Santofimia @ 2004-04-13 18:08 UTC (permalink / raw)
  To: qemu-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 742 bytes --]

Hi all.

Jocelyn said was trying to merge the sources into CVS. Today appears to be PPC emulation in CVS :), so, i've got a question about that.



The functions are the same as you specified in:

http://mail.gnu.org/archive/html/qemu-devel/2004-04/msg00092.html

That it's, we can run some linux distributions, but, 

waht ROM to use? Get it from a Mac (tried only oldworld macs, such as SheepShaver, although Jocelyn said not want to support it), or, get the Openfirmware (¿how?).



If not, what rom/type of rom we need, or it's a free rom (suchs as Bochs BIOS).





Many Thanks in advance :)

______________________________________________________
Get Paid... With Your Free Email at
http://www.zwallet.com/index.html?user=telefrancisco

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

* Re: [Qemu-devel] PPC emulation, how?
  2004-04-13 18:08 [Qemu-devel] PPC emulation, how? Francisco José Cañizares Santofimia
@ 2004-04-13 18:56 ` Jocelyn Mayer
  2004-04-14 14:25   ` Martin
  0 siblings, 1 reply; 12+ messages in thread
From: Jocelyn Mayer @ 2004-04-13 18:56 UTC (permalink / raw)
  To: qemu mailing list

On Tue, 2004-04-13 at 20:08, Francisco José Cañizares Santofimia wrote:
> Hi all.
> 
> Jocelyn said was trying to merge the sources into CVS. Today appears to be PPC emulation in CVS :), so, i've got a question about that.

Yes, thanks to Fabrice who did the merge.

> The functions are the same as you specified in:
> 
> http://mail.gnu.org/archive/html/qemu-devel/2004-04/msg00092.html
> 
> That it's, we can run some linux distributions, but, 
> 
> waht ROM to use? Get it from a Mac (tried only oldworld macs, such as SheepShaver, although Jocelyn said not want to support it), or, get the Openfirmware (¿how?).

For now, I don't use a ROM.
I only support booting Linux PREP kernels, using -kernel option.

For help, I put some infos, kernel and boot image here:
http://jocelyn.mayer.free.fr/qemu-ppc/index.htm

I'm far to emulate a real Mac, even far to emulate a real PREP:
we even don't have any kind of PCI support, which seems mandatory for
most PPC platforms...

I don't have a real boot-loader, just a few hacks that build a minimal
environment to run Linux PREP kernel without firmware support, no RTAS,
even no residual infos.
All those stuff will come later...

For now, I still have (many ?) bugs to fix in MMU and exception handling
to have a solid core emulation, then I will focus more on hardware &
firmware. My goal is to follow current MOL approach and use OpenBIOS
so qemu won't need any non-free binaries to run.

-- 
Jocelyn Mayer <l_indien@magic.fr>
Never organized

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

* Re: [Qemu-devel] PPC emulation, how?
  2004-04-13 18:56 ` Jocelyn Mayer
@ 2004-04-14 14:25   ` Martin
  2004-04-16 17:44     ` Jocelyn Mayer
  0 siblings, 1 reply; 12+ messages in thread
From: Martin @ 2004-04-14 14:25 UTC (permalink / raw)
  To: qemu-devel


> For help, I put some infos, kernel and boot image here:
> http://jocelyn.mayer.free.fr/qemu-ppc/index.htm
You say there:
To run qemu PPC emulation, I use the following command line:
 > qemu -S -kernel <my_kernel> -fda <my_floppy> -hda <my_disk> -cdrom 
<my_cdrom>

Is the -S a special new option or should this be -s

I tried your kernel image and debian install disk.
It does boot but I can't get networking to work
I can set the eth0 of the emulated client to 172.20.0.2 but am unable to 
ping the host (which is setup at 172.20.0.1 by /etc/qemu-ifup.sh) or the 
other way around.
Is networking not working at all yet or am I missing something

Also I use -nographic else the emulator crashes (stops)

Greetings,
Martin (nldudok1)

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

* Re: [Qemu-devel] PPC emulation, how?
  2004-04-14 14:25   ` Martin
@ 2004-04-16 17:44     ` Jocelyn Mayer
  2004-04-18 19:51       ` J. Mayer
                         ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Jocelyn Mayer @ 2004-04-16 17:44 UTC (permalink / raw)
  To: qemu mailing list; +Cc: qemumail

Hi, sorry for the delay...

On Wed, 2004-04-14 at 16:25, Martin wrote:
> > For help, I put some infos, kernel and boot image here:
> > http://jocelyn.mayer.free.fr/qemu-ppc/index.htm
> You say there:
> To run qemu PPC emulation, I use the following command line:
>  > qemu -S -kernel <my_kernel> -fda <my_floppy> -hda <my_disk> -cdrom 
> <my_cdrom>
> 
> Is the -S a special new option or should this be -s
> 

It's really '-S' . I added this option to tell to qemu not to launch the
emulated code. This way, you have some time to grab the serial port
output and be able to edit the kernel's command line at startup (PREP
kernel allow this...). You just have to type 'c' in qemu monitor then
the kernel waits one second with the current command line displayed,
then boots if no chars were received.

> I tried your kernel image and debian install disk.
> It does boot but I can't get networking to work
> I can set the eth0 of the emulated client to 172.20.0.2 but am unable to 
> ping the host (which is setup at 172.20.0.1 by /etc/qemu-ifup.sh) or the 
> other way around.
> Is networking not working at all yet or am I missing something
> 

It may not work: I didn't really test the network, just made sure that
the NE2000 was seen by the kernel. PPC system emulation is still very
experimental...

> Also I use -nographic else the emulator crashes (stops)

I never used this option, and it doesn't crash for me.
Could you try to launch it under gdb and send me a trace ?

Regards.

-- 
Jocelyn Mayer <l_indien@magic.fr>
Never organized

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

* Re: [Qemu-devel] PPC emulation, how?
  2004-04-16 17:44     ` Jocelyn Mayer
@ 2004-04-18 19:51       ` J. Mayer
  2004-04-19 18:05       ` Martin
       [not found]       ` <40830EDD.9080505@olifantasia.com>
  2 siblings, 0 replies; 12+ messages in thread
From: J. Mayer @ 2004-04-18 19:51 UTC (permalink / raw)
  To: qemu-devel

On Fri, 2004-04-16 at 19:44, Jocelyn Mayer wrote:
> Hi, sorry for the delay...
> 
> > I tried your kernel image and debian install disk.
> > It does boot but I can't get networking to work
> > I can set the eth0 of the emulated client to 172.20.0.2 but am unable to 
> > ping the host (which is setup at 172.20.0.1 by /etc/qemu-ifup.sh) or the 
> > other way around.
> > Is networking not working at all yet or am I missing something
> > 
> 
> It may not work: I didn't really test the network, just made sure that
> the NE2000 was seen by the kernel. PPC system emulation is still very
> experimental...

Here's a little patch in NE2000 emulation that makes network available
for PPC:
I can now ping my host machine, but failed to mount nfs exports...

Index: hw/ne2000.c
===================================================================
RCS file: /cvsroot/qemu/qemu/hw/ne2000.c,v
retrieving revision 1.5
diff -u -d -w -B -b -d -p -r1.5 ne2000.c
--- hw/ne2000.c	12 Apr 2004 20:39:29 -0000	1.5
+++ hw/ne2000.c	18 Apr 2004 19:47:23 -0000
@@ -368,8 +368,13 @@ static void ne2000_asic_ioport_write(voi
     p = s->mem + s->rsar;
     if (s->dcfg & 0x01) {
         /* 16 bit access */
+#ifdef TARGET_WORDS_BIGENDIAN
+        p[1] = val;
+        p[0] = val >> 8;
+#else
         p[0] = val;
         p[1] = val >> 8;
+#endif
         s->rsar += 2;
         s->rcnt -= 2;
     } else {
@@ -397,7 +402,11 @@ static uint32_t ne2000_asic_ioport_read(
     p = s->mem + s->rsar;
     if (s->dcfg & 0x01) {
         /* 16 bit access */
+#ifdef TARGET_WORDS_BIGENDIAN
+        ret = p[1] | (p[0] << 8);
+#else
         ret = p[0] | (p[1] << 8);
+#endif
         s->rsar += 2;
         s->rcnt -= 2;
     } else {


-- 
J. Mayer <l_indien@magic.fr>
Never organized

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

* Re: [Qemu-devel] PPC emulation, how?
  2004-04-16 17:44     ` Jocelyn Mayer
  2004-04-18 19:51       ` J. Mayer
@ 2004-04-19 18:05       ` Martin
  2004-04-19 18:34         ` Karel Gardas
       [not found]       ` <40830EDD.9080505@olifantasia.com>
  2 siblings, 1 reply; 12+ messages in thread
From: Martin @ 2004-04-19 18:05 UTC (permalink / raw)
  To: qemu-devel


>It's really '-S' . I added this option to tell to qemu not to launch the
>emulated code. This way, you have some time to grab the serial port
>output and be able to edit the kernel's command line at startup (PREP
>kernel allow this...). You just have to type 'c' in qemu monitor then
>the kernel waits one second with the current command line displayed,
>then boots if no chars were received.
>
>  
>
I didn't need this to edit the kernel commandline. If you just start
typing rightaway when the kernelcommandline appears you can edit it. I
did have to use a very wide console to get the whole commandline on one
line. The kernel spits out the commandline it got later on and that is
consistent with what I typed in.

>> Also I use -nographic else the emulator crashes (stops)
>  
>

>I never used this option, and it doesn't crash for me.
>Could you try to launch it under gdb and send me a trace ?

Ye4s, I will try to do this tuesday or wednesday.

>Here's a little patch in NE2000 emulation that makes network available
>for PPC:
>I can now ping my host machine, but failed to mount nfs exports...

Thanks, I will try this too tuesday or wednesday.
I have two goals for networking right now. The first is to mount a nfs
host from within the emulated prep machine. Then I can mount the root
filesystem from my real prep machine and chroot or even a root nfs boot
(dangerous, I know). This way I can find out very fast which command
work and which have problems without having to make huge diskimages first.
The second is telnet, ssh and/or x11 using the network.
Serial console and network card are the only two really needed hardware
components needed for an (emulated) linux machine. The rest you can do
over the network ;-)

A little offtopic maybe. Do you know how I can findout fast which
libraries are needed for a certain executable. I tried to make a small
diskimage with the basic command from my real prep machine and tried to
guess which libraries I needed (but guesses wrong ofcourse).  I copied
/bin /sbin /etc /lib and a subset of /usr/bin  and /usr/lib. /usr/lib is
very large and I know I only need some of the libs for the commands I
copied in /usr/bin but not which ones.

Greetings,
Martin DvH

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

* Re: [Qemu-devel] PPC emulation, how?
       [not found]         ` <1082363002.29001.41.camel@rapid>
@ 2004-04-19 18:12           ` Martin
  2004-04-19 21:16             ` J. Mayer
  0 siblings, 1 reply; 12+ messages in thread
From: Martin @ 2004-04-19 18:12 UTC (permalink / raw)
  To: qemu-devel


>Is your host your PREP machine ?
>If so, it may be (one more) endianness related bug. I will check on a
>mac, one of these days...
>
>  
>
No, My host is an x86 machine (AMD duron 800) running a linux 2.6 
kernel. This also might cause problems related to the 1000 Hz  kernel 
ticks in 2.6 in stead of 100Hz kernel ticks in 2.4.
I haven't tried to run my prep machine as a host yet. It is not that 
fast a machine (200 Mhz 604e)

>>A little offtopic maybe. Do you know how I can findout fast which 
>>libraries are needed for a certain executable. I tried to make a small 
>>diskimage with the basic command from my real prep machine and tried to 
>>guess which libraries I needed (but guesses wrong ofcourse).  I copied 
>>/bin /sbin /etc /lib and a subset of /usr/bin  and /usr/lib. /usr/lib is 
>>very large and I know I only need some of the libs for the commands I 
>>copied in /usr/bin but not which ones.
>>    
>>
>
>Well, it seems that ldd or just /lib/ld.so.1 are the tool you need to
>use:
>  
>
>> /lib/ld.so.1 --list /bin/ls
>>    
>>
>        libpthread.so.0 => /lib/libpthread.so.0 (0x0ff8f000)
>        librt.so.1 => /lib/librt.so.1 (0x0ff5d000)
>        libc.so.6 => /lib/libc.so.6 (0x0fe03000)
>        /lib/ld.so.1 => /lib/ld.so.1 (0x08000000)
>  
>
Thanks,  this is what I needed,

Martin

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

* Re: [Qemu-devel] PPC emulation, how?
  2004-04-19 18:05       ` Martin
@ 2004-04-19 18:34         ` Karel Gardas
  0 siblings, 0 replies; 12+ messages in thread
From: Karel Gardas @ 2004-04-19 18:34 UTC (permalink / raw)
  To: qemu-devel

On Mon, 19 Apr 2004, Martin wrote:

> A little offtopic maybe. Do you know how I can findout fast which
> libraries are needed for a certain executable.

ldd <executable>

Cheers,
Karel
--
Karel Gardas                  kgardas@objectsecurity.com
ObjectSecurity Ltd.           http://www.objectsecurity.com

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

* Re: [Qemu-devel] PPC emulation, how?
  2004-04-19 18:12           ` Martin
@ 2004-04-19 21:16             ` J. Mayer
  2004-04-19 22:41               ` Carlos Valiente
  0 siblings, 1 reply; 12+ messages in thread
From: J. Mayer @ 2004-04-19 21:16 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemumail

On Mon, 2004-04-19 at 20:12, Martin wrote:
> >Is your host your PREP machine ?
> >If so, it may be (one more) endianness related bug. I will check on a
> >mac, one of these days...
> >
> No, My host is an x86 machine (AMD duron 800) running a linux 2.6 
> kernel. This also might cause problems related to the 1000 Hz  kernel 
> ticks in 2.6 in stead of 100Hz kernel ticks in 2.4.

I don't think it's directly related to this point, as I've been using
Linux 2.6 for several monthes on an Athlon XP.
Maybe the gdb trace will say more...

> I haven't tried to run my prep machine as a host yet. It is not that 
> fast a machine (200 Mhz 604e)

Well, I'd better test on a faster Mac, so :-)

-- 
J. Mayer <l_indien@magic.fr>
Never organized

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

* Re: [Qemu-devel] PPC emulation, how?
  2004-04-19 21:16             ` J. Mayer
@ 2004-04-19 22:41               ` Carlos Valiente
  2004-04-20 23:26                 ` Martin
  0 siblings, 1 reply; 12+ messages in thread
From: Carlos Valiente @ 2004-04-19 22:41 UTC (permalink / raw)
  To: qemu-devel

On Mon, 2004-04-19 at 22:16, J. Mayer wrote:
> > I haven't tried to run my prep machine as a host yet. It is not that 
> > fast a machine (200 Mhz 604e)
> 
> Well, I'd better test on a faster Mac, so :-)

Hi! I'm running qemu (i386 emulation only, haven't tried ppc yet) on an
iBook2 500 MHz. Not the fastest machine under the Sun, but I'd gladly
help with any testing that you may need.

Cheers, 

Carlos <yo@virutass.net>

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

* Re: [Qemu-devel] PPC emulation, how?
  2004-04-19 22:41               ` Carlos Valiente
@ 2004-04-20 23:26                 ` Martin
  2004-04-21  0:34                   ` J. Mayer
  0 siblings, 1 reply; 12+ messages in thread
From: Martin @ 2004-04-20 23:26 UTC (permalink / raw)
  To: qemu-devel

IWith the ne2000 patch I can ping from host to qemu and from qemu to host.
nfsmount doesn't work yet.
I also tried a few tests with wget.
It fails on some and succeeds on other tests. The good thing is that you 
can stop wget with ctrl-C (mount and ping from the debianinstalldisk 
just stop reacting if they fail in qemu)

I think there are more endianess problems because wget fails on all 
files which are odd sized.
I made a few testfiles (less than 1 kb) and put them on my httpserver of 
the host.
a text file of 907 bytes fails 906 bytes succeeds 905 bytes fails.
Fails in this case means the download doesn't even start.

If I try to download the default apache homepage index.html then the 
download starts but it stoppes at 87 % and says -stalled-
I think this file needs more packets (it is 4410 bytes)


I am still not sure how to use the -S option and/or the gdb debugger 
with qemu.

greetings,
Martin

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

* Re: [Qemu-devel] PPC emulation, how?
  2004-04-20 23:26                 ` Martin
@ 2004-04-21  0:34                   ` J. Mayer
  0 siblings, 0 replies; 12+ messages in thread
From: J. Mayer @ 2004-04-21  0:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemumail

On Wed, 2004-04-21 at 01:26, Martin wrote:
> IWith the ne2000 patch I can ping from host to qemu and from qemu to host.
> nfsmount doesn't work yet.
> I also tried a few tests with wget.
> It fails on some and succeeds on other tests. The good thing is that you 
> can stop wget with ctrl-C (mount and ping from the debianinstalldisk 
> just stop reacting if they fail in qemu)

Just try to use ping -c <count>
so you'll get the shell back...

> I think there are more endianess problems because wget fails on all 
> files which are odd sized.
> I made a few testfiles (less than 1 kb) and put them on my httpserver of 
> the host.
> a text file of 907 bytes fails 906 bytes succeeds 905 bytes fails.
> Fails in this case means the download doesn't even start.

I didn't test wget, because it's used to crash when I try to launch
it...
I'm not sure those are endian problems. It may be timer problem or worse
(MMU...).
I have a new implementation of time-base/decrementer which makes Linux
guest timings to be connected to reality.
This also boosts the emulation by a factor of 2 or 3. I'm reworking
exception management, which is not well implemented and may be buggy.
This will also improve speed and (I hope) solve some emulation problems.

> I am still not sure how to use the -S option and/or the gdb debugger 
> with qemu.

'-S' option is really simple: it just stops qemu just before starting
the emulation. You then have to enter the 'c' command in qemu monitor to
let it run.
You now have a PPC register dump in the monitor, too with 'info
registers'
The use of gdb is not easy when you emulate the whole system. I only use
it to solve kernel problems. For userland problems,
the best way may be to launch gdb in the guest system  :-)

-- 
J. Mayer <l_indien@magic.fr>
Never organized

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

end of thread, other threads:[~2004-04-21  0:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-13 18:08 [Qemu-devel] PPC emulation, how? Francisco José Cañizares Santofimia
2004-04-13 18:56 ` Jocelyn Mayer
2004-04-14 14:25   ` Martin
2004-04-16 17:44     ` Jocelyn Mayer
2004-04-18 19:51       ` J. Mayer
2004-04-19 18:05       ` Martin
2004-04-19 18:34         ` Karel Gardas
     [not found]       ` <40830EDD.9080505@olifantasia.com>
     [not found]         ` <1082363002.29001.41.camel@rapid>
2004-04-19 18:12           ` Martin
2004-04-19 21:16             ` J. Mayer
2004-04-19 22:41               ` Carlos Valiente
2004-04-20 23:26                 ` Martin
2004-04-21  0:34                   ` J. Mayer

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