Index of /qemu/BartPE
Emulate Bart's mkbt.exe in Linux
Of course this has to do with Qemu. While setting up a bootable file image, I realized
that this filesystem needed a bootsector - specifically an XP MBR, along with an NTLDR bootsector.
Of course you can mount the bootable file in qemu as a usbdevice, open a Winxp VM and
run mkbt. I did this a few times and it works fine.
Here is the home page for mkbt. There he
explains the offset table where the bios values enter the superblock. I indexed udiffa.txt which is the bindiff results for 2 actual superblocks.
I've always wondered why I've never seen anyone hacking Linux do anything close to what
mkbt does. Many sites show a way to restore an MBR to a device, but not to a bootable file image.
You will find the dd calls to emulate mkbt in the script, script_bpe.sh.txt
For an ntfs partition do,
$sudo yum install ntfsprogs
Contents indexed:
udiffa.txt - is the output of Winxp's bindiff which compares pe2usb.bin with a working superblock
usbd.bin - is a known good Winxp MBR, taken from the results of using the HP USB format utility
usbd.bin.txt - is a hexdump of the binary usbd.bin
script_bpe.sh.txt - is a bash script which builds a bootable file image containing the 4 files needed to run Bartpe (in USB).
scr_ntfs.sh.txt - good example for scripting fdisk/ntfs; no superblock hack is needed for ntfs
Results of the script
-------------- file type --------
$ sudo file mini_vusb.img
mini_vusb.img: x86 boot sector, Microsoft Windows XP MBR, Serial 0x25d84; partition 1: ID=0xe,
active, starthead 1, startsector 32, 390496 sectors
--------------- unsnip -----------
How to Launch the image file in qemu
$sudo /usr/libexec/qemu-kvm -hda mini_vusb.img -m 784 -net nic,model=rtl8139 -net tap -vga cirrus -usb -localtime &