Page 1 of 1

CPU Emulating Bootloader?

Posted: Fri Mar 25, 2011 5:58 pm
by wizoomer95
This is my first time posting here, and I think I have a great idea for an OS/bootloader! I just don't know how to go about it.
I was thinking, wouldn't it be nice to have an emulator with a supported OS as your main operating system on a standard x86 PC? Such a subject was discussed on a forum for PearPC, a PowerPC emulator for x86 targets, but as the main developer stopped developing, talk about it slowed down. However, what I'm looking for is something much more different! I am talking about one that uses regular hard drive and partitions to use as the hosting space for the OS rather than disk image files on a hard drive volume.
QEMU is a great processor emulator for not just x86, but many other different CPU platforms. QEMU user mode is already out there, which emulates necessary things for a program to do and emulate the architecture alone and run linux programs designed for one arcitecture for another. For example, let's say you're running a PowerPC computer running Linux, and you want to run a program that's only available for x86 Linux. QEMU user mode can emulate necessary things for an x86 processor, like the CPU and the IO system, and launch the program on it. It can even do it the other way around. While it can run x86 programs on non-x86 architectures, you can also use it to run non-x86 programs on the x86 architecture. I basically want the same idea (not code) to be used, but instead use it to boot an OS that would otherwise be incompatible with the architecture or even the CPU!
QEMU can also emulate in recent builds different models of the x86 CPU, like the Intel Core 2 Duo or an AMD Althon with this flag:

Code: Select all

-cpu $MODEL$
For example, you can use QEMU to emulate an Intel core 2 duo and boot IMAGE.img by typing:

Code: Select all

qemu -cpu core2duo IMAGE.img
This can allow you to start any customized PC hardware regardless of what PC your running!!
Anyway, back to the subject. I would like to bring all of QEMU's emulation power as a bootloader. Let's refer to an x86-compatible OS as OS-A and an OS for a different architecture as OS-B. I would like my bootloader to run OS-A via any CPU or hardware implimented through QEMU, and I would also like it to boot OS-B as an OS for any x86 PC. However, I would like a boot menu to allow to either boot from a disk image or a physical disk (like from the CD drive or installed hard drive partition).
First off, is my goal even possible? If so, how? Thanks!
Rico

Re: CPU Emulating Bootloader?

Posted: Sat Mar 26, 2011 8:47 am
by wizoomer95
berkus, what I am looking for is an operating system/bootloader that can emulate virtually any QEMU system, but will allow you to use regular disk partitions and physical CD drives, as well as disk images, pulling up a boot menu to select which one to boot from. In other words, I would like to build a bootloader that can emulate a different CPU with an IO system if necessary, but also boot from not just disk images, but also physical drives, like hard drive partitions and physical CD drives. How can I do that?

Re: CPU Emulating Bootloader?

Posted: Sat Mar 26, 2011 10:45 am
by Brynet-Inc
This would be slow and pointless, QEMU does indeed support several non-x86 emulation targets but there is a severe performance penalty.. using it for anything beyond testing and debugging is absurd.

As for virtualization, technologies like Xen/VMware ESX exist that generally run in a minimalist environment and run other OS's typically in parallel using disk partitions or filesystem backed images.

Obviously there is a need for a full fledged "host" kernel of some sort to implement drivers on the host system, for disk controllers.. networking.. graphics, et cetera.

There is nothing remotely innovate about virtualization, and quite frankly, you're better off with multiple systems running dedicated operating systems.