[syslinux] help: booting dos from syslinux/memdisk

Wichetael wichetael at gmx.net
Fri Jul 4 05:19:08 PDT 2003


Thomas, try doing this, this should give you what you want.

mkdiskimage disk 8 64 63
losetup -o 32256 /dev/loop0 disk
mkdosfs /dev/loop0
mount /dev/loop0 /mnt/img
mcopy a: /mnt/img
dd if=/dev/fd0 of=bootblock.dos7 bs=512 count=1
cp bootblock.dos7 /mnt/img/dos.bss
cp <your syslinux config file> /mnt/img
umount /mnt/img
syslinux /dev/loop0

----- Original Message ----- 
From: "Christian Marg" <christian.marg at tu-clausthal.de>
To: "Thomas Baumann" <tom at tiri.li>
Cc: <syslinux at zytor.com>
Sent: Friday, July 04, 2003 13:52
Subject: Re: [syslinux] help: booting dos from syslinux/memdisk


> Hello...
> 
> -------------------
> > mkdiskimage disk 8 64 63
> > cfdisk -c 8 -h 64 -s 63 disk
> [...]
> 
> It seems like mkdiskimage already creates a partition with bootflag
> inside the disk image, so there is no need to run an fdisk program.
> Its just informative.
> 
> > losetup -o 32256 /dev/loop0 disk
> > mlabel -N 00 e:MYDISK
> > mdir e:
> [...]
> 
> mlabel and mdir both work OK because you used losetup correctly and
> assigned e: to /dev/loop0
> 
> [...]
> > syslinux /dev/loop0
> 
> Now your disk image is bootable. Mount /dev/loop0 to your favorite
> mount point, put the needed files in it, unmount it, delete the
> /dev/loop0 assignment using losetup ( /d I think) and use your image.
> Everything seems to be fine from what you wrote. 
> 
> > ############## >>> Why overwrites syslinux my partitiontable ?
> 
> Because you still didn't get  it:
> The Partition table is located in the first sector of a Harddisk (ie.
> first 512 Bytes of your Image) while the first partition Boot record
> is located in the 64th sector of the Harddisk (ie. 512 Bytes from
> offset 32256 in your image). This is where Syslinux should go. And by
> pointing /dev/loop0 to offset 32256 and using syslinux /dev/loop0 you
> did just that.
> 
> You have to understand: If you want to view the partition table point
> your fdisk program (be it fdisk or cfdisk) to offset 0 of your disk
> image (by entering the filename as device name)
> If you want some program to write to the Boot record of your Partition
> point it to offset 32256 (in this case) by using the /dev/loop0 you
> setup previously.
> If you want to mount the Dos volume (starting with the boot record)
> point your mount program to offset 32256 (in this case) by using the
> /dev/loop0 you setup previously.
> 
> bye
> Christian
> PS: If you still feel the urge to mail verbose logs please mail them
> to me privately and not to the list...
> -- 
> HiWi PC-Administration
> Rechenzentrum TU-Clausthal
> _______________________________________________
> SYSLINUX mailing list
> Submissions to SYSLINUX at zytor.com
> Unsubscribe or set options at:
> http://www.zytor.com/mailman/listinfo/syslinux
> Please do not send private replies to mailing list traffic.
> 



More information about the Syslinux mailing list