As I stated in my question I want to place Windows XP ISO into one of the partitions in my USB stick to run it at boot to install XP just in case. After searching for a while on the net I learned that it's not that easy. I needed to extract XP ISO into folder then apply winvblock driver and edit a few files in extracted folder, and then pack folder into bootable XP ISO again
In order to boot from CDs, it needs boot sectors to be detected by BIOS. A bootable CDROM actually contains an image of floppy disk. https://superuser.com/questions/476415/what-does-a-bootable-cdrom-usb-floppy-disk-contain-exactly
When you extract a bootable ISO file into a folder, you can't just reassamble it into a ISO file (like mkisofs -o /tmp/cd.iso /tmp/directory/
) and preserve boot functionality unless you apply a boot sector patch.
mkisofs
helps apply that patch while it is creating "Bootable ISO Image" from folder. It's possible for both Windows and Linux.
For Windows XP you need to place bootsect.bin in root of folder then from root of folder in terminal run:
mkisofs -b bootsect.bin -no-emul-boot -boot-load-seg 1984 -boot-load-size 4 -iso-level 2 -J -l -D -N -joliet-long -relaxed-filenames -V "WINSP" -o ../winsp.iso .
That's all. You have a bootable XP.ISO
For Linux you need isolinux.bin
and boot.cat
and issue command:
mkisofs -o output.iso -b isolinux isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table CD_root
Some time ago a guy asked similar question for Ubuntu here How can I create a bootable iso from an extracted Ubuntu 13.04 iso?
It's possible with syslinux http://www.syslinux.org/wiki/index.php/ISOLINUX
I tested my modified XP ISO in Virtualbox, it runs well.
bootsect.bin
for XP cd then runmkisofs -b bootsect.bin -no-emul-boot -boot-load-seg 1984 -boot-load-size 4 -iso-level 2 -J -l -D -N -joliet-long -relaxed-filenames -V "WINSP" -o ../winsp.iso .
It works well, I tested ISO on Virtualbox. – kenn Feb 26 '14 at 16:59bootsect.bin
to extracted ISO folder then opened terminal in that folder and issued the above long liner command – kenn Feb 26 '14 at 17:06