geert geurts
2012-Apr-02 07:43 UTC
[syslinux] booting a dos floppy from a disk image over pxe
Hello, I'm trying to boot a dos floppy stored on a disk image which is initially loaded over pxe using memdisk. I've created the disk image as follows: dd if=/dev/zero of=$IMGLOCATION/$IMGNAME bs=$(( 1024 * 1024 )) count=20 LOOPDEV=$(losetup --show -f $IMGLOCATION/$IMGNAME) MAJOR_MINOR=$(ls -l $LOOPDEV|awk '{print $5$6}'|sed 's/,/:/') DMSIZE=$(( $(ls -l $IMGLOCATION/$IMGNAME|awk '{print $5}') / 512 )) echo 0 $DMSIZE linear $MAJOR_MINOR 0|dmsetup create hdz fdisk /dev/mapper/hdz<<EOT n p 1 t 6 a 1 w EOT kpartx -a /dev/mapper/hdz mkdosfs /dev/mapper/hdz1 Then I put a dosfloppy image and memdisk on the image: mount /dev/mapper/hdz1 /mnt/ mkdir -p /mnt/boot/grub cp dos622.IMA /mnt/boot/ cp /usr/lib/syslinux/memdisk /mnt/boot /mnt/boot/grub/grub.cfg contains: linux16 /boot/memdisk initrd16 /boot/dos622.IMA boot and I install grub: grub-install --root-directory=/mnt /dev/dm-0 This works perfectly on a virtualbox installation, I get a dos environment with a C: disk. On a live system it works till till the boot of the dos floppy. The machine resets. I believe it has something to do with loading a second memdisk instance for the floppy after the first which was used to boot the harddisk image over pxe... I have tried allot to get this working, even grub-legacy, but I'm out of options... If anyone has a idea, I would be very happy to hear! Thanks for reading! Regards,
Helmut Hullen
2012-Apr-02 08:45 UTC
[syslinux] booting a dos floppy from a disk image over pxe
Hallo, geert, Du meintest am 02.04.12:> I'm trying to boot a dos floppy stored on a disk image which is > initially loaded over pxe using memdisk. > I've created the disk image as follows:> dd if=/dev/zero of=$IMGLOCATION/$IMGNAME bs=$(( 1024 * 1024 )) > count=20 LOOPDEV=$(losetup --show -f $IMGLOCATION/$IMGNAME) > MAJOR_MINOR=$(ls -l $LOOPDEV|awk '{print $5$6}'|sed 's/,/:/') > DMSIZE=$(( $(ls -l $IMGLOCATION/$IMGNAME|awk '{print $5}') / 512 )) > echo 0 $DMSIZE linear $MAJOR_MINOR 0|dmsetup create hdz > fdisk /dev/mapper/hdz<<EOT > n > p > 1> t > 6 > a > 1 > w > EOT > kpartx -a /dev/mapper/hdz > mkdosfs /dev/mapper/hdz1> Then I put a dosfloppy image and memdisk on the image:> mount /dev/mapper/hdz1 /mnt/ > mkdir -p /mnt/boot/grub > cp dos622.IMA /mnt/boot/ > cp /usr/lib/syslinux/memdisk /mnt/boot> /mnt/boot/grub/grub.cfg contains: > linux16 /boot/memdisk > initrd16 /boot/dos622.IMA > boot> and I install grub:> grub-install --root-directory=/mnt /dev/dm-0> This works perfectly on a virtualbox installation, I get a dos > environment with a C: disk.Why these circumstances? My usual way: Put the floppy disk into the drive mkdir -p /tftpboot/images dd if=/dev/fd0 of=/tftpboot/images/myspecial.img for PXE-Boot: additional entry p.e. in "/tftpboot/pxelinux.cfg/default" LABEL myspecial MENU LABEL myspecial kernel memdisk append initrd=images/myspecial.img Viele Gruesse! Helmut
Gert Hulselmans
2012-Apr-02 10:05 UTC
[syslinux] booting a dos floppy from a disk image over pxe
2012/4/2 geert geurts <geert at verweggistan.eu>:> > On a live system it works till till the boot of the dos floppy. The > machine resets. > > I believe it has something to do with loading a second memdisk instance > ?for the floppy after the first which was used to boot the harddisk > image over pxe... > > I have tried allot to get this working, even grub-legacy, but I'm out > of options... > > If anyone has a idea, I would be very happy to hear! >Try one of the alternative memory access methods for MEMDISK: raw Use raw access to protected mode memory. bigraw Use raw access to protected mode memory, and leave the CPU in "big real" mode afterwards. int Use plain INT 15h access to protected memory. This assumes that anything which hooks INT 15h knows what it is doing. safeint Use INT 15h access to protected memory, but invoke INT 15h the way it was *before* MEMDISK was loaded. This is the default since version 3.73. http://www.syslinux.org/wiki/index.php/MEMDISK#Set_memory_access_method_.28raw.2C_bigraw.2C_int_.2C_safeint.29 'raw' works most of the time when the default 'safeint' fails. - Gert Hulselmans
geert geurts
2012-Apr-02 10:40 UTC
[syslinux] booting a dos floppy from a disk image over pxe
Hi Helmut, The reason for this is I want to be able to have a variable sized disk image to contain firmware images. Just booting form a floppy of pxe is not an issue... Thanks for your response though :) Regards,