failed in creating bootable hdd image
by anctop from LinuxQuestions.org on (#6H1VX)
Hi,
I am attempting to create a bootable hdd image which boots Syslinux and then chain loads FreeDOS.
At first I experiment with a physical hdd (/dev/sdb).
The procedure involves the following steps :
I proceed to repeat the procedure on an image file.
When I try to load the image with the command :
Code:memdisk initrd=FD.img harddisk rawThe procedure halts at the step showing
Code:Loading boot sector... booting...Could someone kindly advise ?
I am attempting to create a bootable hdd image which boots Syslinux and then chain loads FreeDOS.
At first I experiment with a physical hdd (/dev/sdb).
The procedure involves the following steps :
- Install the Syslinux MBR boot code.
dd if=mbr.bin of=/dev/sdb bs=440 count=1 conv=notrunc - Create a bootable partition (/dev/sdb1) of size 7MB and type 04 (FAT16 <32M).
- mkfs.fat /dev/sdb1
- Install the Syslinux boot loader.
syslinux --install /dev/sdb1 - Mount "/dev/sdb1" at "/mnt"
mount -t vfat /dev/sdb1 /mnt - Copy the Syslinux modules "{chain,libutil,libcom32}.c32" to "/mnt"
- Copy the FreeDOS files "KERNEL.SYS" and "COMMAND.COM" to "/mnt"
- Create the file "/mnt/syslinux.cfg"
Code:DEFAULT FreeDOS
LABEL FreeDOS
COM32 chain.c32
APPEND fs freedos=/KERNEL.SYS - umount /mnt
I proceed to repeat the procedure on an image file.
- dd if=/dev/zero of=FD.img bs=1M count=8
- losetup /dev/loop0 FD.img
- dd if=mbr.bin of=/dev/loop0 bs=440 count=1 conv=notrunc
- Create a bootable partition on "/dev/loop0" of size 7MB and type 04 (FAT16 <32M).
"fdisk" reports that the partition starts at sector 2048. - losetup -d /dev/loop0
losetup -o 1048576 /dev/loop1 FD.img - mkfs.fat /dev/loop1
- syslinux --install /dev/loop1
- mount /dev/loop1 at /mnt
- Copy the Syslinux and FreeDOS files to "/mnt"
- Create the file "/mnt/syslinux.cfg" as before
- umount /mnt
- losetup -d /dev/loop1
When I try to load the image with the command :
Code:memdisk initrd=FD.img harddisk rawThe procedure halts at the step showing
Code:Loading boot sector... booting...Could someone kindly advise ?