PLOP VHD Loader - Some Queries

Started by Holmes.Sherlock, December 01, 2010, 02:59:06 AM

Previous topic - Next topic

Holmes.Sherlock



  • Quote
    The operating system on the VHD file must be Windows/Linux that is able to run nativ from a VHD file or DOS.
    When a VHD file is mapped to a physical HD, it should be transparent to the OS. Then how the question of "being able to boot natively" come in the picture?

  • When an OS like Windows/Linux enters into Protected mode, then it sets its own interupt handler. Does the VHD loader overwrites some of them to make the HD-mapped-VHD available to the OS?

  • Is the VHD image memory mapped?

Icecube

#1
You are almost answering your own questions:
Q:
QuoteWhen a VHD file is mapped to a physical HD, it should be transparent to the OS. Then how the question of "being able to boot natively" come in the picture?
A:
QuoteWhen an OS like Windows/Linux enters into Protected mode, then it sets its own interupt handler.
So in short, for protected mode OSes, you need a driver that understands the VHD format and must be aware of the location of the VHD file, so it can be mounted. If your protected mode OS doesn't understand the VHD format or doesn't know that it was booted from a VHD file (can't find the VHD file to mount), you are out of luck.
Note: sometimes it might be that your protected mode OS doesn't need any driver for VHD. This is the case when all necessary files the OS needs are read via INT13h access: first stage of Windows boot; or when the bootloader (Syslinux, grub4dos, ...) loads all necessary files for Linux based tools that only need a kernel and initrd/initramfs.

QuoteIs the VHD image memory mapped?
I don't think so, but I am not completely sure.

Elmar

Quote from: Holmes.Sherlock on December 01, 2010, 02:59:06 AM
Is the VHD image memory mapped?

no

Quote from: Icecube on December 01, 2010, 10:29:21 AM
So in short, for protected mode OSes, ....

it is not limited to protected mode OS. from the technical side, everything is affected (real or protected mode) that access the hard disk directly without using int13h. the protected mode system cannot use int13h (without switching to real mode and back to protected mode) but thats another topic.

best regards
elmar

Holmes.Sherlock

Quote from: Elmar on December 01, 2010, 20:25:06 PM
it is not limited to protected mode OS. from the technical side, everything is affected (real or protected mode) that access the hard disk directly without using int13h.

EXACTLY. I'm not sure whether the initial part of Windows booting uses INT13H but after it boots completely, it has to access registry & other system files physically residing on VHD @ every moment. Then how the VHD loader makes Windows able to access them?

Holmes.Sherlock

Quote from: Icecube on December 01, 2010, 10:29:21 AM
So in short, for protected mode OSes, you need a driver that understands the VHD format and must be aware of the location of the VHD file, so it can be mounted. If your protected mode OS doesn't understand the VHD format or doesn't know that it was booted from a VHD file (can't find the VHD file to mount), you are out of luck.
Note: sometimes it might be that your protected mode OS doesn't need any driver for VHD. This is the case when all necessary files the OS needs are read via INT13h access: first stage of Windows boot; or when the bootloader (Syslinux, grub4dos, ...) loads all necessary files for Linux based tools that only need a kernel and initrd/initramfs.

That's what I understand. But I'm asking that how the VHD loader handles the situation? Does it act as a VHD driver to Windows? In real mode, it's easier to HOOK INT 13H, but what about the P-Mode?

Elmar

Quote from: Holmes.Sherlock on December 01, 2010, 02:59:06 AM
The operating system on the VHD file must be Windows/Linux that is able to run nativ from a VHD file or DOS.

in this case, the native means, no virtual machine in the background.

Quote from: Holmes.Sherlock on December 02, 2010, 02:36:18 AM
EXACTLY. I'm not sure whether the initial part of Windows booting uses INT13H but after it boots completely, it has to access registry & other system files physically residing on VHD @ every moment. Then how the VHD loader makes Windows able to access them?

the initial part of windows is using int13h.

Quote from: Holmes.Sherlock on December 02, 2010, 02:46:25 AM
That's what I understand. But I'm asking that how the VHD loader handles the situation? Does it act as a VHD driver to Windows? In real mode, it's easier to HOOK INT 13H, but what about the P-Mode?

no, the vhd loader is no windows vhd driver. as soon as windows is using its own drivers to access hard disks, the vhd loader is useless. so windows/linux must be able to detect and access the used vhd file to finish booting.

regards
elmar

Icecube

@ Holmes.Sherlock
You can compare plpvhd booting of a VHD file, with booting a direct mapped image with grub4dos. You will need to add the WinVBlock or Firadisk driver to your Windows installation, so Windows is able to recognize the grub4dos direct mapped image as a device. For the VHD file image, you will need a similar driver, which understands the VHD format.

I think there where already some plans to add VHD support to WinVBlock and Firadisk.

Holmes.Sherlock

#7
Quote from: Elmar on December 02, 2010, 09:40:06 AM
no, the vhd loader is no windows vhd driver. as soon as windows is using its own drivers to access hard disks, the vhd loader is useless. so windows/linux must be able to detect and access the used vhd file to finish booting.

As Icecube nicely explained with the example of WinVBlock & Firadisk, we need a VHD driver. But either they are to be injected offline or the Windows installation has to be cloned from an existing installation having either of the drivers injected online. Windows 7 has native support for VHD. But is it true with Linux & Windows XP?

Icecube

I think you can use vdfuse to mount VHD (and other VM disk formats) in Linux (didn't try it though). You need to incorporate it in your initrd/initramfs of course (and add the necessary bash script line for mounting the image):
http://forums.virtualbox.org/viewtopic.php?f=7&t=14280&start=150

In Linux you don't need a driver for VHD support, just a tool that can mount the image.

Holmes.Sherlock

But how does VHD loader support XP also?

Elmar

#10
Quote from: Holmes.Sherlock on December 02, 2010, 13:34:16 PM
But how does VHD loader support XP also?

vhd loader inits the boot process and vboot is doing the rest, but i never tried vboot.