Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Running a kernel through an emulator.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Darexius
n00b
n00b


Joined: 29 Apr 2009
Posts: 21

PostPosted: Wed Apr 29, 2009 8:08 pm    Post subject: Running a kernel through an emulator. Reply with quote

I'm curious to know if it's possible to run an x86 kernel on another architecture through qemu much like you would if you installed Windows on a non-x86 arch?

The project revolves around running an x86 base on a PPC-based PS3. If you can run Wine via an emulated x86 system, you could maximize the amount of memory you have, and with the RSX being unlocked via new kernel modules, you could "in theory" run a rather solid system on the PS3.
Back to top
View user's profile Send private message
szczerb
Veteran
Veteran


Joined: 24 Feb 2007
Posts: 1709
Location: Poland => Lodz

PostPosted: Wed Apr 29, 2009 9:33 pm    Post subject: Reply with quote

From what I remember emulating a different arch is seriously slow.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55307
Location: 56N 3W

PostPosted: Wed Apr 29, 2009 10:54 pm    Post subject: Reply with quote

Darexius,

There is gentoo for the PS3, why bother with inter arch emulation which is seriously slow?

WINE is not an emulator. It gives windows programs full control of the CPU as if they were really running in windows.
When these windows programs make API calls, WINE mimics Windows behavior so the program gets the response it expects.
Hence WINE provides native or sometimes faster execution.

WINE is still only 32 bit, so can only usefully address 4Gb of RAM. You would not get the benefit of the PS3 64 bit CPU.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
boerKrelis
Apprentice
Apprentice


Joined: 01 Jul 2003
Posts: 241
Location: The Netherlands

PostPosted: Wed Apr 29, 2009 11:10 pm    Post subject: Reply with quote

AFAIK you can't run x86 win32 apps on a 32 bits ppc-compiled Wine, provided there is a non-experimental ppc Wine. x86 is little-endian. PPC is big-endian.

I've booted x86 win2k on a 1.13 Ghz G4 with qemu. Barely usable, but YMMV.
Back to top
View user's profile Send private message
Darexius
n00b
n00b


Joined: 29 Apr 2009
Posts: 21

PostPosted: Thu Apr 30, 2009 12:54 am    Post subject: Reply with quote

The reason why I would need to emulate the arch is to take advantage of Wine. Like the previous post stated, you can't use wine on the PPC. It only translates system calls, not emulates them. While Gentoo has a PS3 build, it won't help trying to run x86 apps. It's painfully slow, but YMMV. Instead of emulating Windows, if I just emulated a linux subsystem it would use less memory and should execute somewhat faster than it's doze counterpart. That'll allow for more memory to be used for x86 apps, albeit they'll process slowly.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 10023
Location: almost Mile High in the USA

PostPosted: Fri May 01, 2009 9:03 pm    Post subject: Reply with quote

Still don't understand what's the point of this project (what specifically are you trying to do?)... It is possible to totally emulate a cpu (and peripherals) with another, with or without dynamic translation, but it would be slow either way. But once you emulate the CPU, if you can run a native kernel in that environment, you can also run native wine and apps that normally run under x86/wine should work fine under ps3 emulated x86/wine..

But it will not be any faster than simply running windows in the emulator. Memory will not be your bottleneck, translation will be. Other than for a cute demonstration of running some windows program on your ps3 (maybe this is specifically your intent?), you're better off running on real hardware...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Darexius
n00b
n00b


Joined: 29 Apr 2009
Posts: 21

PostPosted: Sat May 02, 2009 1:27 pm    Post subject: Reply with quote

eccerr0r wrote:
Still don't understand what's the point of this project (what specifically are you trying to do?)... It is possible to totally emulate a cpu (and peripherals) with another, with or without dynamic translation, but it would be slow either way. But once you emulate the CPU, if you can run a native kernel in that environment, you can also run native wine and apps that normally run under x86/wine should work fine under ps3 emulated x86/wine..

But it will not be any faster than simply running windows in the emulator. Memory will not be your bottleneck, translation will be. Other than for a cute demonstration of running some windows program on your ps3 (maybe this is specifically your intent?), you're better off running on real hardware...


Well that's entirely it. If I can run an x86 system, albeit Windows or Linux (wouldn't Windows have more overhead to worry about, though?), you can run x86 apps on your PS3 or any PPC system. This project started when I was discussing a port to a specific game, FFXI, to the PS3, and since the PS3 is nolonger backwards compatible, the only other viable solution to playing FFXI on the PS3 is running it through emulation. The intent isn't to get blazing graphics or anything, it's just to make it playable.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 55307
Location: 56N 3W

PostPosted: Sat May 02, 2009 2:57 pm    Post subject: Reply with quote

Darexius,

Look at what PearPC does. Its a PPC emulator for x86 CPUs. The idea is to run Apple PPC code on Intel based hardware.
I relaise you want to go the other way but it will give some indication of what is involved.

They use two approaches, instruction by instruction emulation, which is very slow. Each instruction is emulated every time its encontered. The other approach they use is to emulate once and store the native code, so that next time the instruction sequence is encountered, the emulation is already complete. From memory, this produces speeds approaching 1/40 of native.

Also look at mame. Mame emulates lots of processors on x86 (again, the wrong way for you) but you may learn something useful.

Emulating the CPU is usually the easy bit. Emulating the I/O is much harder.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum