Jump to content











Photo
- - - - -

Can any virtual machine directly run on BIOS?


  • Please log in to reply
25 replies to this topic

#1 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 11 May 2008 - 02:51 AM

qemu can be compiled for Linux/Windows and many other OSes, as well as for DOS+HXDOS.

Can qemu be compiled for running directly on BIOS?

#2 Brito

Brito

    Platinum Member

  • .script developer
  • 10616 posts
  • Location:boot.wim
  • Interests:I'm just a quiet simple person with a very quiet simple life living one day at a time..
  •  
    European Union

Posted 11 May 2008 - 05:13 PM

Not an easy task. (not sure if worth the coding effort)

You could likely aim to run FreeDOS and HX-DOS respectively under DOS first.

-------------------------------

*It is possible* to compile C programs to run inside the BIOS, using something like this:
http://www.rabbit.co..._tour/bios.html - and it seems that each board has it's own BIOS specifications.

Seems a sure thing that you wouldn't likely make a clean transition without doing heavy code modifications on qemu.

There are also some Linux OS's running entirely from the BIOS - which might be a good start for running qemu.

Also need to consider driver support - if you're planning on running OS's from the DISK - it won't be a piece of cake to add HDD support for SATA, RAID, IDE, etc.

Better go with Linux as they seem well developed on this area, try out the Petter Nordahl's linux boot disk for cleaning NT admin password - it comes with a good extent of support for SATA / NTFS and fits on a floppy.

http://home.eunet.no...rdahl/ntpasswd/

-----------------------------

Hope these ideas help you! :lol:

#3 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 11 May 2008 - 05:48 PM

Thanks nuno.

I think it is worth porting qemu to BIOS.

If anyone is interested(in working on this), please let me know.

#4 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 11 May 2008 - 07:42 PM

@tinybit

What would it be the use of such a tool (I mean running QEMU from BIOS)?

I know next to nothing about HOW something like that could be done, but if Fabrice Bellard (the author of Qemu) managed to produce his other (less known) project:
http://fabrice.bella...cc/tccboot.html

TCCBOOT is a boot loader able to compile and boot a Linux kernel directly from its source code.

TCCBOOT is only 138 KB big (uncompressed code) and it can compile and run a typical Linux kernel in less than 15 seconds on a 2.4 GHz Pentium 4.

TCCBOOT is based on the TinyCC compiler, assembler and linker. TinyCC is an experiment to produce a very small and simple C compiler compatible with the GNU C compiler and binary utilities.


my bet is that it can be done.

jaclaz

#5 sanbarrow

sanbarrow

    Silver Member

  • Developer
  • 788 posts
  • Location:Germany - Sauerland

Posted 11 May 2008 - 08:05 PM

Can any virtual machine directly run on BIOS?


I am not sure the question in itself makes sense - as soon as you call something a virtual machine there must be some kind of host that runs it.
Anyway - the closest match probably is VMware's ESX - latest 3.5i boots from USB-stick and then loads a big kernel that then can run VMs.
AFAIK footprint is about 32 MB in RAM.
ESX is very expensive and runs on limited server-class hardware only

#6 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 11 May 2008 - 08:29 PM

Can qemu be compiled for running directly on BIOS?

I'm most curious!
What do you think, is the advantage of a VM running straight on BIOS, compared to one running on an OS, or for that matter running the guestOS itself on the BIOS/hardware?


:lol:

#7 ispy

ispy

    Silver Member

  • Tutorial Writer
  • 646 posts
  • Location:PILGRIM

Posted 11 May 2008 - 08:49 PM


I am not sure the question in itself makes sense - as soon as you call something a virtual machine there must be some kind of host that runs it.
Anyway - the closest match probably is VMware's ESX - latest 3.5i boots from USB-stick and then loads a big kernel that then can run VMs.
AFAIK footprint is about 32 MB in RAM.
ESX is very expensive and runs on limited server-class hardware only


Here is a theoretical approach that I considered until the technicalities blew me out of the water. The idea was to find the smallest OS I could find preferably freeware then run Qemu from that, sorta one step up from running directly from the bios. The first consideration was Dos but due to Dos extenders being needed for 32 bit access the limitaions were too restrictive.

I then dropped onto MenuetOS A very small OS compiled exclusively in ASM assembler (Fits on a floppy) , the disadvantage was it does not seem to have a cmd.exe equivelant within it but it is capable of running QEMU with a bit of jiggery pockery as I believe gamers use it to run certain games.

Anyway I signed up on the MenuetOS forum 32bit vers & posted a question, it was replied to by Villemt, administrator, the details of which are here: http://menuet.2.foru...?showtopic=1261

The basic idea was to load MenuetOS from a floppy image file load Qemu then run a OS or whatever from QEMU. I'm afraid I didn't understand Villemts reply fully but he kindly provided a link to open source files that will amend MenuetOS to recognise QEMU?

Hope this helps?

ispy :lol:

#8 sanbarrow

sanbarrow

    Silver Member

  • Developer
  • 788 posts
  • Location:Germany - Sauerland

Posted 11 May 2008 - 09:19 PM

What do you think, is the advantage of a VM running straight on BIOS, compared to one running on an OS, or for that matter running the guestOS itself on the BIOS/hardware?


I doubt it makes sense if you plan to run a single VM only.
If you plan to run several VMs the advantage is performance - if you don't need any - or only very small resources for the "host-system" you can use almost all resources of the box for the VMs.
If you compare for example VMware ESX with the VMware workstation which runs on top of a regular OS - ESX-VMs performs much better.

#9 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 11 May 2008 - 09:41 PM

If you compare for example VMware ESX with the VMware workstation which runs on top of a regular OS - ESX-VMs performs much better.

See here is already the problem. Without a OS of any kind there will be no drivers, without drivers all that's usable is what BIOS provides and thats:
- Mouse (with low resolution)
- Keyboard (without Extensions)
- CD-Drive and HDD via Int13 (very slow)
- Grafik via VESA (really slow)

And since the drivers used to run the virtual devices can never perform better than the drivers that run the real hardware, one's really screwed here.


:lol:

#10 sanbarrow

sanbarrow

    Silver Member

  • Developer
  • 788 posts
  • Location:Germany - Sauerland

Posted 11 May 2008 - 10:03 PM

You are right - ESX works around this issues by including a very limited set of drivers in the kernel itself.
Also you can't view any of the VMs on the box itself - you actually always need a second box to do anything with the VMs

#11 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 12 May 2008 - 03:12 AM

@All

:lol: So many replies. What a pleasant surprise! Thank you!

I think I need to make it clear what I mean.

I have thought about this question, because at first I would like to implement a virtual machine for grub4dos.

Currently grub4dos also features virtual disk, but it is based on the BIOS, rather than a complete system simulation.

Although the BIOS is not an operating system, but it also can be considered a system.

Since the DOS can run on in the BIOS, then a virtual machine software may also run in the BIOS on.

A virtual machine software can be started up by BIOS, just as if the virtual machine software itself is a boot loader, and then the virtual machine read its configuration file for its system simulation tasks.

I think this can be achieved, if someone is willing to do so.

Thank you, my friends! Thank you again, everyone!

------------ My English is bad. I am posting with the help of Google Translation :thumbup:

#12 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 12 May 2008 - 11:48 AM

tinybit, you still havn't said what this special VM should be good for?
It would have inferior performance to all other VM.

Or is this one of those, i just wanna see if it can be done things?

:lol:

#13 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 12 May 2008 - 12:18 PM

See here is already the problem. Without a OS of any kind there will be no drivers, without drivers all that's usable is what BIOS provides and thats:
- Mouse (with low resolution)
- Keyboard (without Extensions)
- CD-Drive and HDD via Int13 (very slow)
- Grafik via VESA (really slow)

And since the drivers used to run the virtual devices can never perform better than the drivers that run the real hardware, one's really screwed here.


:lol:

:thumbup:

Consider such a situation: We want to install XP from an ISO. In this case we only need to virtualize the CDROM device, all other hardware can revert to the real one. We may not care about the performance, because it is only used to install the system. After the installation is complete, we will no longer need the virtual machine.

#14 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 12 May 2008 - 12:23 PM

tinybit, you still havn't said what this special VM should be good for?
It would have inferior performance to all other VM.

Or is this one of those, i just wanna see if it can be done things?

:lol:


Compared to other virtual machines, it should be lightweight.

#15 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 12 May 2008 - 12:37 PM

:lol:

Consider such a situation: We want to install XP from an ISO. In this case we only need to virtualize the CDROM device, all other hardware can revert to the real one. We may not care about the performance, because it is only used to install the system. After the installation is complete, we will no longer need the virtual machine.

So we've moved now from a virtual machine, to just a virtual drive and possibly even just boot loader support for images?
This is quite a different and much smaller task. And one that makes sense to me! :thumbup:

:thumbup:

#16 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 12 May 2008 - 02:13 PM

So we've moved now from a virtual machine, to just a virtual drive and possibly even just boot loader support for images?
This is quite a different and much smaller task. And one that makes sense to me! :lol:

:thumbup:


Although it may be only a virtual disk, but it needs a virtual layer from the hardware, not just from the software layer (i.e., not just from the BIOS INT CALL). So the virtualization is not too easy to accomplish, unless we use the code ready made from an existing virtual machine (for example, QEMU) .

#17 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 12 May 2008 - 02:37 PM

You're maybe overlooking that the BIOS itself already presents virtualizing capabilities.
ElTorine emulated Floppy boot and ElTorito emulated HDD boot.

:lol:

#18 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 13 May 2008 - 12:55 AM

You're maybe overlooking that the BIOS itself already presents virtualizing capabilities.
ElTorine emulated Floppy boot and ElTorito emulated HDD boot.


Those virtualizations are of INT CALL software based, not of hardware. So by using those virtualizations we can neither install nor boot Windows XP from the virtual disk.

INT call based virtualizations are only expected and designed to work with the old real-mode OSes(mainly DOS) and some well-designed protected OSes such as Windows98 and grub4dos(here we consider grub4dos as a simple 32-bit protected-mode "OS"), which are compatible with real-mode INT CALLs.

Windows NT family OSes and Linux and many other OSes are not totally compatible with real-mode INT CALLs, so the INT CALL based software virtualizations will not function on those OSes.

#19 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 13 May 2008 - 06:49 AM

@tinybit

Maybe this:
http://aebios.com/
http://groups.google...e023dc?lnk=raot
http://www.911cd.net...o...21157&st=21


Can be of some use. :lol:

jaclaz

#20 kcom

kcom

    Member

  • Members
  • 43 posts

Posted 15 May 2008 - 08:07 PM

1) Applications directly running inside legacy BIOS? Never heard it`s possible. Maybe it is possible. But what is the point? Compared to VMware ESX Server or Xen?

2) Are there any sample third party applications running inside legacy BIOS?

3) I wouldn`t recommend to mess with legacy BIOS... How you want to debug it? Flashing all over? Flashing a virtual BIOS all over? Then you flash your real BIOS and there is some error, trash the motherboard and make a new try?

4) Why not rather use the Extensible Firmware Interface? This needs to purchase a new motherboard but I think legacy BIOS really deserved to die and EFI is the future. EFI could be ready to this task and after a short look it seams that the extension you can program will not risky like ordinary BIOS flashing.

#21 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 16 May 2008 - 02:36 AM

@kcom

At post #11 above, I have had an explanation. We don't touch BIOS, but run on top of BIOS(or maybe I should say "run under BIOS". Sorry I have a poor English). A boot loader can run on BIOS. And DOS runs on BIOS. So a virtual machine is also possible to run on BIOS.

VMware ESX Server or Xen? Sorry I have no idea because I have never used them.

------------------------

At present we can use DOS+HXDOS+QEMU instead. We may try this way for example:

1. by using grub4dos or memdisk, we boot a virtual floppy(i.e., an Image file) with DOS+HXDOS+QEMU already installed into the image before hand.

2. Run QEMU to virtualize the CDROM. It uses an ISO file on a hard drive, e.g., for installing XP or Win98.

3. We may install the OS(i.e., the XP or Win98) now. Although the OS is installed under QEMU, it is installed onto your real hard drive. Complete the installation.

4. Reboot. This time we needn't use the virtualization. We simply boot the real machine, and see if it is OK.

#22 tinybit

tinybit

    Gold Member

  • Developer
  • 1175 posts
  •  
    China

Posted 16 May 2008 - 03:19 AM

@tinybit

Maybe this:
http://aebios.com/
http://groups.google...e023dc?lnk=raot
http://www.911cd.net...o...21157&st=21


Can be of some use. ;)

jaclaz


Thank you. But I am also unsure what we can do by those.

#23 was_jaclaz

was_jaclaz

    Finder

  • Advanced user
  • 7101 posts
  • Location:Gone in the mist
  •  
    Italy

Posted 16 May 2008 - 08:35 AM

Thank you. But I am also unsure what we can do by those.


Mike Gonta, the author, has recently joined both 911CD and boot-land, I hope that as soon as he has some time/gets the hang of the place he will be willing to share some more info:
http://www.911cd.net...showtopic=21525

From the very little I can understand, the idea is very similar to HXdos, which is a DOS extender.

Aebios should be a BIOS extender and could provide some of what you need for your idea. ;)

jaclaz

#24 kcom

kcom

    Member

  • Members
  • 43 posts

Posted 16 May 2008 - 01:41 PM

Ok, I got it. Isn`t really planed to run inside BIOS but before the operating system.

new way: BIOS -> Virtualizer -> OS
old way: BIOS -> OS - Virtualizer -> OS

I can tell you. It`s very worth to try out:
- VMware Workstation: There you can mount a real harddrive as raw disk. You simply move a real harddisk as a virtual harddisk. This works very well. I installed once Windows XP on a raw disk (in real it was an external USB harddrive). Later I was able to boot this USB harddrive on bare metal. (Some Windows specific tricks where needed to get USB running but overall it worked well.)
I think qemu has also such a raw disk feature but I am not sure.
- Xen: is a virtualizer with hypervisor. It`s also a layer between BIOS and OS. Very high performance and it`s possible to give virtual machines access to physical devices.
- VMware ESX Server: similar to Xen. ESX is also a layer between BIOS and OS.
Just check out the related sites in wikipedia. ;)

Techniques like Xen are the future of virtualizing. If you want so, them are running directly after BIOS.

If you are a programmer I advise you:
- Either contribute to the Xen project. Newer (adjusted) operating systems work very well in Xen but legacy OS not. Hope that hyper-v features of cpu`s will spread soon.
- Or get involved into EFI (Extensible Firmeware Interface) and hope boards with EFI will be widespread soon.

Porting qemu to bare metal isn`t wise. You need the implement the whole hardware abstraction layer and kernel stuff from scratch again. While you end up with doing so it would be much more wise to modify the linux kernel for this task. Oh well, some guys already done it. It`s called linux kvm (see also wikipedia).

:thumbup:

#25 kickarse

kickarse

    Member

  • Members
  • 67 posts
  • Location:USA
  •  
    United States

Posted 13 June 2008 - 09:27 PM

There's also OpenVZ which aims to work as well as ESX. Just not as user friendly. It does have something similar to the clustering and "vmotion" ability.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users