While scripting a syslinux bootimage with a menu and miscellaneous utilities, I found a virtualization platform called QEMU. It can be called directly from the script to verify the functionality and is very convenient for the purpose.
Script to create and launch the .ISO:
1 2 3 4 5 6 7 8 9 10 11 12 |
set isofile=boot.iso set tooldir=tool del %isofile% REM --- Generate ISO-image with MKISOFS --- mkisofs -no-bak -iso-level 4 -no-emul-boot -boot-load-size 4 -hide boot.catalog -allow-lowercase -max-iso9660-filenames -r -J -joliet-long -boot-info-table -b boot/syslinux/isolinux.bin -o "%isofile%" "%tooldir%" REM --- Test the ISO with QEMU --- qemu-img.exe create -f vmdk qemu_disk.img 1G qemu-system-x86_64w -L Bios -vga std -m 1G -hda qemu_disk.img -cdrom %isofile% -boot d |
There is a directory named \TOOL where all the important files reside, for ex: \TOOL\BOOT(syslinux) and \TOOL\IMAGES(iso-images). This is the also the base directory from which MKISOFS builds the image from.
I also parse the \TOOL\IMAGES directory and build a dynamic menu(syslinux.cfg) from the contents. You might need a different configuration for booting the underlying image(YMMW):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
### MENU START LABEL localboot MENU LABEL Boot from Hard Drive MENU START MENU DEFAULT localboot 0x80 TEXT HELP Boot from first HDD ENDTEXT ### MENU END ### MENU START LABEL - MENU LABEL name_of_a_tool.iso LINUX /boot/syslinux/grub.exe APPEND --config-file="ls /images/name_of_a_tool.iso || find --set-root /images/name_of_a_tool.iso;map --heads=0 --sectors-per-track=0 /images/name_of_a_tool.iso (0xff) || map --heads=0 --sectors-per-track=0 --mem /images/name_of_a_tool.iso (0xff);map --hook;chainloader (0xff)" TEXT HELP ENDTEXT ### MENU END |
Utils used to create and test the menu : SYSLINUX , QEMU and MKISOFS.