Skip to contentSkip to conversation

PPC emulation on Qemu

Qemu-devel Manish Bansal 7 participants 21 messages Feb 15, 2004 – Feb 19, 2004

lore
Share & tools
lore
#0 lore raw

Hi,
How do we boot a PPC OS using Qemu? Do we need a separate BIOS ROM file for
that? Can we boot Mac OS X on it.

Thanks,
Manish.

#1 lore raw
Quoted 3 lines · Manish Bansal

Hi,
How do we boot a PPC OS using Qemu? Do we need a separate BIOS ROM file for
that? Can we boot Mac OS X on it.

Hello,
We can't boot any PPC OS with qemu for now.
The first OS targeted is Linux, MacOS will come next. We'll need more emulated devices, including PCI devices to make it run. Then, the good way would be to have an open-soure BIOS, the way it's done for x86 target.
I'm sorry you'll have to be patient...

Signature · 2 lines
J. Mayer <[email protected]>
Never organized
#2 lore raw

Hello,

Am Son, den 15.02.2004 schrieb J. Mayer um 15:07:

Quoted 2 lines

We can't boot any PPC OS with qemu for now.
I'm sorry you'll have to be patient...

I have heard on this list that you're working on that, the website says that PPC system emulation is in development, but I couldn't find any code in qemu CVS.

Just curious, but is there already any code?

Gabriel.

#3 lore raw
Quoted 11 lines · Gabriel Ebner

Hello,

Am Son, den 15.02.2004 schrieb J. Mayer um 15:07:

Quoted 2 lines

We can't boot any PPC OS with qemu for now.
I'm sorry you'll have to be patient...

I have heard on this list that you're working on that, the website says that PPC system emulation is in development, but I couldn't find any code in qemu CVS.

Just curious, but is there already any code?

The code to emulate supervisor mode and MMU is mostly commited. But the code to handle peripherals, emulate open-firmware (which is a poor approch, but...) and really launch a linux kernel isn't really usable for now.

Signature · 2 lines
J. Mayer <[email protected]>
Never organized
#4 lore raw
Quoted 11 lines · J. Mayer
Quoted 10 lines · Gabriel Ebner

Hello,

Am Son, den 15.02.2004 schrieb J. Mayer um 15:07:

Quoted 2 lines

We can't boot any PPC OS with qemu for now.
I'm sorry you'll have to be patient...

I have heard on this list that you're working on that, the website says that PPC system emulation is in development, but I couldn't find any code in qemu CVS.

Quoted 6 lines
Quoted 1 line

Just curious, but is there already any code?

The code to emulate supervisor mode and MMU is mostly commited. But the code to handle peripherals, emulate open-firmware (which is a poor approch, but...) and really launch a linux kernel isn't really usable for now.

Did you use some of MOL's code ? (MacOnLinus contains OF client interface emulation and some low level Mac hw emulation like interrupt controller, PCI host bridge, etc...)

Ben.

#5 lore raw
Quoted 14 lines · Benjamin Herrenschmidt
Quoted 13 lines · J. Mayer
Quoted 11 lines · Gabriel Ebner

Hello,

Am Son, den 15.02.2004 schrieb J. Mayer um 15:07:

Quoted 2 lines

We can't boot any PPC OS with qemu for now.
I'm sorry you'll have to be patient...

I have heard on this list that you're working on that, the website says that PPC system emulation is in development, but I couldn't find any code in qemu CVS.

Just curious, but is there already any code?

Quoted 8 lines
Quoted 4 lines

The code to emulate supervisor mode and MMU is mostly commited. But the code to handle peripherals, emulate open-firmware (which is a poor approch, but...) and really launch a linux kernel isn't really usable for now.

Did you use some of MOL's code ? (MacOnLinus contains OF client interface emulation and some low level Mac hw emulation like interrupt controller, PCI host bridge, etc...)

Well, I did look a lot MOL code but didn't use it for now. I won't reuse MOL OF code, because I don't want to have hardcoded stuffs, but something that acts really like the open-firmware and will be able to boot any OS, just like Bochs BIOS does for PC's.
But emulated hardware from MOL will be helpfull someday. For now, I want to concentrate on booting Linux for Prep hardware. Because it's mainly a PC with a PPC CPU, it's a real good target to debug CPU emulation problems without taking care of emulated hardware. Then, I want a standard and nowedays PPC platform, not only Macs, near OpenPPC standard. So I did an open-pic emulation, ... MOL code will be helpfull to emulate some Mac platforms, but as it says, it seems to me that's it's too much Mac & MacOS dedicated to help until I got full stable basics.

Signature · 2 lines
J. Mayer <[email protected]>
Never organized
#6 lore raw
Quoted 5 lines

Well, I did look a lot MOL code but didn't use it for now. I won't reuse MOL OF code, because I don't want to have hardcoded stuffs, but something that acts really like the open-firmware and will be able to boot any OS, just like Bochs BIOS does for PC's.

Latest "devel" tree from Samuel started integrating OpenBIOS in MOL (that is a full OF implementation).

Quoted 4 lines

But emulated hardware from MOL will be helpfull someday. For now, I want to concentrate on booting Linux for Prep hardware. Because it's mainly a PC with a PPC CPU, it's a real good target to debug CPU emulation problems without taking care of emulated hardware.

It's also the shitties PPC hardware out there ;) Instane memory map

Quoted 2 lines

Then, I want a standard and nowedays PPC platform, not only Macs, nea OpenPPC standard.

What is OpenPPC standard ? So far, the most "standard" PPCs are PowerMacs ;)

Quoted 4 lines

So I did an open-pic emulation, ... MOL code will be helpfull to emulate some Mac platforms, but as it says, it seems to me that's it's too much Mac & MacOS dedicated to help until I got full stable basics.

It can run the linux kernel as well. It's oriented toward emulation speed though. It has this nice "OSI" calls mecanism that allows cross call from within the emulated environment to the emulator linux-side. That along with host-side drivers using these calls allows significant perfs. improvements for things like disk access, sound, etc... but that's all optional.

Ben

#7 lore raw
Quoted 7 lines · Benjamin Herrenschmidt
Quoted 4 lines

Well, I did look a lot MOL code but didn't use it for now. I won't reuse MOL OF code, because I don't want to have hardcoded stuffs, but something that acts really like the open-firmware and will be able to boot any OS, just like Bochs BIOS does for PC's.

Latest "devel" tree from Samuel started integrating OpenBIOS in MOL (that is a full OF implementation).

OpenBios would be great, but it seems to be far from running. I got something nearly running, in host environment. But if OpenBios gets close to a full real Bios, I'd be glad to use it !

Quoted 6 lines
Quoted 4 lines

But emulated hardware from MOL will be helpfull someday. For now, I want to concentrate on booting Linux for Prep hardware. Because it's mainly a PC with a PPC CPU, it's a real good target to debug CPU emulation problems without taking care of emulated hardware.

It's also the shitties PPC hardware out there ;) Instane memory map

Yes, I know it's nearly a virtual platform, but, has I have some tests kernels that should run on it, it makes debug simpler. But I agree this emulation is just a step to a real complete hardware emulation...

Quoted 5 lines
Quoted 2 lines

Then, I want a standard and nowedays PPC platform, not only Macs, nea OpenPPC standard.

What is OpenPPC standard ? So far, the most "standard" PPCs are PowerMacs ;)

Well, G4 Macs are close to OpenPPC standard, which is an open platform which has been described by IBM. I like it has a reference because it's nearly Macs and because AIX, MacOS (X I suppose) and Linux should be able to run on it.

Quoted 11 lines
Quoted 4 lines

So I did an open-pic emulation, ... MOL code will be helpfull to emulate some Mac platforms, but as it says, it seems to me that's it's too much Mac & MacOS dedicated to help until I got full stable basics.

It can run the linux kernel as well. It's oriented toward emulation speed though. It has this nice "OSI" calls mecanism that allows cross call from within the emulated environment to the emulator linux-side. That along with host-side drivers using these calls allows significant perfs. improvements for things like disk access, sound, etc... but that's all optional.

Yes I know it can run Linux, but what I wanted to point is that (if I'm not wrong) it's not able to run any OS (ie AIX or pegasos or, why not (?), BeOS or AmigaOS) like a real machine would.
I agree that MOL exactly intend to do this, and does it well, but I think qemu should really emulate the whole execution environment...

Does the OSI calls mechanism needs patched OS and/or firmware ?

Signature · 2 lines
J. Mayer <[email protected]>
Never organized
#8 lore raw
Quoted 8 lines
Quoted 3 lines

What is OpenPPC standard ? So far, the most "standard" PPCs are PowerMacs ;)

Well, G4 Macs are close to OpenPPC standard, which is an open platform which has been described by IBM. I like it has a reference because it's nearly Macs and because AIX, MacOS (X I suppose) and Linux should be able to run on it.

You mean CHRP ? Hrm... AIX ? hehe, I wouldn't bet on that :) OS X neither. But at least for OS X, you can write your own drivers, like MOL does.

Quoted 3 lines

Yes I know it can run Linux, but what I wanted to point is that (if I'm not wrong) it's not able to run any OS (ie AIX or pegasos or, why not (?), BeOS or AmigaOS) like a real machine would.

It could. All depends on which HW you emulate.

Quoted 4 lines

I agree that MOL exactly intend to do this, and does it well, but I think qemu should really emulate the whole execution environment...

Does the OSI calls mechanism needs patched OS and/or firmware ?

It's an addition. MOL can run without it, it's just an optimisation so you can load special drivers into the host OS to makes things much faster / more useable.

On MacOS, it makes a lot of sense since the drivers can be provided by the bootloader at boot or even in the ROM of some PCI cards, so MOL can transparently get those loaded into the host operating system when it's MacOS 9 or X.

Also, for OS X, MOL actually loads a special kext that patches the kernel to remove it's use of MMU split mode, which isn't necessary under emulation and actually very slow to emulate.

Ben.

#19 lore raw
In reply to J. Mayer

Hi,

Quoted 6 lines
Quoted 2 lines

Latest "devel" tree from Samuel started integrating OpenBIOS in MOL (that is a full OF implementation).

OpenBios would be great, but it seems to be far from running. I got something nearly running, in host environment. But if OpenBios gets close to a full real Bios, I'd be glad to use it !

And running BeOS? ;-)

Quoted 5 lines
Quoted 2 lines

What is OpenPPC standard ? So far, the most "standard" PPCs are PowerMacs ;)

Well, G4 Macs are close to OpenPPC standard, which is an open platform which has been described by IBM.

I believe only 7.5.2 + unreleased enabler was able to run on CHIRP platforms (Starmax 6000 or those with IBM LongTrail prototype boards). Or is the "OpenPPC standard" another thing?

Quoted 1 line

Does the OSI calls mechanism needs patched OS and/or firmware ?

I have not looked at MOL that much but OSI stands for Operating System Interface. i.e. a means that can communicate from the guest OS and the host OS through (here) "normal" syscalls. On the Mac side, specific drivers use those syscall to get/set variables in a fast way. Ben said it's all optional but useful performance wise. SheepShaver does a similar thing with EmulOps (major opcode = 6 on ppc), or direct TVECT patching on native PPC.

Bye,
Gwenole.

#20 lore raw
Quoted 10 lines · Gwenole Beauchesne
Quoted 1 line

Does the OSI calls mechanism needs patched OS and/or firmware ?

I have not looked at MOL that much but OSI stands for Operating System Interface. i.e. a means that can communicate from the guest OS and the host OS through (here) "normal" syscalls. On the Mac side, specific drivers use those syscall to get/set variables in a fast way. Ben said it's all optional but useful performance wise. SheepShaver does a similar thing with EmulOps (major opcode = 6 on ppc), or direct TVECT patching on native PPC.

Sidenote: Perhaps if OSI could be made available in both PPC and
X86 qemu system emulators we could keep a patch against 2.6.x with drivers to use those calls to make running Linux faster on x86 as well. Combined with the latest work Fabrice is doing getting rid of slow PIO for hard drives would be a good thing.

- Chad

#9 lore raw
In reply to Benjamin Herrenschmidt
Quoted 12 lines · Benjamin Herrenschmidt
Quoted 7 lines
Quoted 2 lines

What is OpenPPC standard ? So far, the most "standard" PPCs are PowerMacs ;)

Well, G4 Macs are close to OpenPPC standard, which is an open platform which has been described by IBM. I like it has a reference because it's nearly Macs and because AIX, MacOS (X I suppose) and Linux should be able to run on it.

You mean CHRP ? Hrm... AIX ? hehe, I wouldn't bet on that :) OS X neither. But at least for OS X, you can write your own drivers, like MOL does.

No, I meant OpenPPC, but it seems that IBM doesn't promote it anymore:
the pages disapeared from their site.... So maybe it's now another virtual standard platform :-(

Quoted 5 lines
Quoted 3 lines

Yes I know it can run Linux, but what I wanted to point is that (if I'm not wrong) it's not able to run any OS (ie AIX or pegasos or, why not (?), BeOS or AmigaOS) like a real machine would.

It could. All depends on which HW you emulate.

Yes, I'd like qemu to be able to emulate the largest combination of hw... I don't really know if I will ever try to emulate Amiga, but as the main use of PPC is embedded hardwares, it sounds good to have an easily "hw" tunable emulator...

Quoted 8 lines
Quoted 4 lines

I agree that MOL exactly intend to do this, and does it well, but I think qemu should really emulate the whole execution environment...

Does the OSI calls mechanism needs patched OS and/or firmware ?

It's an addition. MOL can run without it, it's just an optimisation so you can load special drivers into the host OS to makes things much faster / more useable.

All right, it seems to me that you can not always patch the emulated system for different reasons...

Quoted 4 lines

On MacOS, it makes a lot of sense since the drivers can be provided by the bootloader at boot or even in the ROM of some PCI cards, so MOL can transparently get those loaded into the host operating system when it's MacOS 9 or X.

OK, seems a good way for proceeding.

Quoted 3 lines

Also, for OS X, MOL actually loads a special kext that patches the kernel to remove it's use of MMU split mode, which isn't necessary under emulation and actually very slow to emulate.

This, I'd like to avoid, as I'd like to keep the system in the state it is... But I may change my mind.

I just rsync'ed the latest mol, and it appears to me that openbios isn't inside. It seems that it's only available through proprietary bk software...
Is there a way to get it using a standard open mechanism (ie rsync or CVS ?). It would be glad, as I cannot and never want to use any proprietary software on my linux boxes...

Signature · 2 lines
J. Mayer <[email protected]>
Never organized
#10 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line

Yes I know it can run Linux, but what I wanted to point is that (if

I'm

Quoted 10 lines
Quoted 4 lines
Quoted 2 lines

not wrong) it's not able to run any OS (ie AIX or pegasos or, why not (?), BeOS or AmigaOS) like a real machine would.

It could. All depends on which HW you emulate.

Yes, I'd like qemu to be able to emulate the largest combination of hw... I don't really know if I will ever try to emulate Amiga, but as the main use of PPC is embedded hardwares, it sounds good to have an easily "hw" tunable emulator...

Regarding emulation of all PPC systems:
Would it be possible to switch the system to little endian mode inside the qemu process? That way, one could run Windows NT, which I always wanted to try (but couldn't, because I don't have the necessary hardware).

This could also (with a slightly different approach) bring better speeds for i386 computations.

Quoted 8 lines

I just rsync'ed the latest mol, and it appears to me that openbios isn't inside. It seems that it's only available through proprietary bk software...
Is there a way to get it using a standard open mechanism (ie rsync or CVS ?). It would be glad, as I cannot and never want to use any proprietary software on my linux boxes...

I had to bite the bullet a month ago and install Bitkeeper (precisely for MOL),
and I can't say I like it. It's really sad that there seems no other way to get
up-to-date MOL sources.

J. Fortmann
Lurker

Signature · 2 lines
GMX ProMail (250 MB Mailbox, 50 FreeSMS, Virenschutz, 2,99 EUR/Monat...)
jetzt 3 Monate GRATIS + 3x DER SPIEGEL +++ http://www.gmx.net/derspiegel +++
#11 lore raw
Quoted 13 lines · J. Fortmann
Quoted 1 line
Quoted 1 line
Quoted 1 line

Yes I know it can run Linux, but what I wanted to point is that (if

I'm

Quoted 10 lines
Quoted 4 lines
Quoted 2 lines

not wrong) it's not able to run any OS (ie AIX or pegasos or, why not (?), BeOS or AmigaOS) like a real machine would.

It could. All depends on which HW you emulate.

Yes, I'd like qemu to be able to emulate the largest combination of hw... I don't really know if I will ever try to emulate Amiga, but as the main use of PPC is embedded hardwares, it sounds good to have an easily "hw" tunable emulator...

Quoted 7 lines

Regarding emulation of all PPC systems:
Would it be possible to switch the system to little endian mode inside the qemu process? That way, one could run Windows NT, which I always wanted to try (but couldn't, because I don't have the necessary hardware).

This could also (with a slightly different approach) bring better speeds for i386 computations.

In theory, we could do that.
But it needs deep kernel patch as I think Linux never uses little-endian pages on PPC. Maybe with a kind a mmap flag ? :-)
But, I don't think you can control endian mode for each page, but only for 128 Mb large areas...

Quoted 8 lines
Quoted 7 lines

I just rsync'ed the latest mol, and it appears to me that openbios isn't inside. It seems that it's only available through proprietary bk software...
Is there a way to get it using a standard open mechanism (ie rsync or CVS ?). It would be glad, as I cannot and never want to use any proprietary software on my linux boxes...

Quoted 5 lines

I had to bite the bullet a month ago and install Bitkeeper (precisely for MOL),
and I can't say I like it. It's really sad that there seems no other way to get
up-to-date MOL sources.

Well, you can get MOL sources via rsync, but not their openbios repository. You can get the "official" openbios via cvs, but there is no support for PPC...

Signature · 2 lines
Jocelyn Mayer <[email protected]>
Never organized
#12 lore raw
Quoted 6 lines

In theory, we could do that.
But it needs deep kernel patch as I think Linux never uses little-endian pages on PPC. Maybe with a kind a mmap flag ? :-)
But, I don't think you can control endian mode for each page, but only for 128 Mb large areas...

Endian control depends on the CPU type (BookE has per page E bit, 6xx/7xx desktops have a global endian mode, and G5s don't have little endian support at all).

It's useless but for old versions of Windows NT, which means it's useless, period. :)

Quoted 3 lines

Well, you can get MOL sources via rsync, but not their openbios repository. You can get the "official" openbios via cvs, but there is no support for PPC...

If you look at the MOL bk web front end, you'll see an openbios dir in there)

Ben.

#13 lore raw
Quoted 9 lines · Benjamin Herrenschmidt
Quoted 5 lines

In theory, we could do that.
But it needs deep kernel patch as I think Linux never uses little-endian pages on PPC. Maybe with a kind a mmap flag ? :-)
But, I don't think you can control endian mode for each page, but only for 128 Mb large areas...

Endian control depends on the CPU type (BookE has per page E bit, 6xx/7xx desktops have a global endian mode, and G5s don't have little endian support at all).

Well, it doesn't seem to be usable...

Quoted 2 lines

It's useless but for old versions of Windows NT, which means it's useless, period. :)

It could improve performance for little-endian architectures emulation, but l<n>brx & st<n>brx may be as efficient as this mode, so let's forget about it...

Quoted 6 lines
Quoted 3 lines

Well, you can get MOL sources via rsync, but not their openbios repository. You can get the "official" openbios via cvs, but there is no support for PPC...

If you look at the MOL bk web front end, you'll see an openbios dir in there)

Yep, I've already seen it, but I can't get the a copy of this repository. But I saw it's a copy of a CVS tree. Is this tree available somewhere ?

Signature · 2 lines
J. Mayer <[email protected]>
Never organized
#14 lore raw
Quoted 7 lines
Quoted 3 lines

If you look at the MOL bk web front end, you'll see an openbios dir in there)

Yep, I've already seen it, but I can't get the a copy of this repository. But I saw it's a copy of a CVS tree. Is this tree available somewhere ?

I don't know about CVS. What's wrong with bk clone ?

Ben.

#15 lore raw
Quoted 8 lines · Benjamin Herrenschmidt
Quoted 6 lines
Quoted 2 lines

If you look at the MOL bk web front end, you'll see an openbios dir in there)

Yep, I've already seen it, but I can't get the a copy of this repository. But I saw it's a copy of a CVS tree. Is this tree available somewhere ?

I don't know about CVS. What's wrong with bk clone ?

No sources, no specs...
Cannot compile it => cannot install to use it,
neither can I write a free client...
Want to keep my machine and my mind safe and free from those kind of softwares...

Signature · 2 lines
J. Mayer <[email protected]>
Never organized
#16 lore raw
Quoted 11 lines · J. Mayer
Quoted 8 lines · Benjamin Herrenschmidt
Quoted 6 lines
Quoted 2 lines

If you look at the MOL bk web front end, you'll see an openbios dir in there)

Yep, I've already seen it, but I can't get the a copy of this repository. But I saw it's a copy of a CVS tree. Is this tree available somewhere ?

I don't know about CVS. What's wrong with bk clone ?

No sources, no specs...

Do bk -r get once you have cloned the tree to checkout the files

Quoted 4 lines

Cannot compile it => cannot install to use it,
neither can I write a free client...
Want to keep my machine and my mind safe and free from those kind of softwares...

Heh... There may be an rsync mirror, I don't know

Ben.

#17 lore raw
Quoted 13 lines · Benjamin Herrenschmidt
Quoted 11 lines · J. Mayer
Quoted 8 lines · Benjamin Herrenschmidt
Quoted 6 lines
Quoted 2 lines

If you look at the MOL bk web front end, you'll see an openbios dir in there)

Yep, I've already seen it, but I can't get the a copy of this repository. But I saw it's a copy of a CVS tree. Is this tree available somewhere ?

I don't know about CVS. What's wrong with bk clone ?

No sources, no specs...

Quoted 8 lines

Do bk -r get once you have cloned the tree to checkout the files

Quoted 4 lines

Cannot compile it => cannot install to use it,
neither can I write a free client...
Want to keep my machine and my mind safe and free from those kind of softwares...

Heh... There may be an rsync mirror, I don't know

I hope ! That's what I'm looking for !
There's a CVS at openbios.org, but it's not up-to-date, for PPC support. And:
\> rsync -avz rsync.penguinppc.org::

linux-2.4-benh  Ben's 2.4 Tree (aka, the PowerMac tree)
mol             Mac-On-Linux Source
libmol          Binary MOL Support Files
yaboot          Yaboot 1.3.x Development Tree (yaboot--devel--1.3)

yaboot-unstable Yaboot 1.99 Development Tree (yaboot--devel--1.99)
prom-libc Prom-libc 1.0 Development Tree (prom-libc--devel--1.0)
No luck, no open-bios there...

Signature · 2 lines
J. Mayer <[email protected]>
Never organized
#18 lore raw
Quoted 5 lines

I hope ! That's what I'm looking for !
There's a CVS at openbios.org, but it's not up-to-date, for PPC support. And:

Just mail samuel and ask him

Ben.