Thanks for Remko for his help to solve the fractional cylinder problem. But there is the second problem, the boot disk failure (see below << [B]) ... command line: initrd=disk.img harddisk c=2 h=256 s=63 BOOT_IMAGE=memdisk Disk is hard disk, 16128K CHS=2/256/63 <<<< [A] ... Loading boot sector... booting... SYSLINUX 2.04 welcome! boot: 1 [single dot] ... this seemed to be the problem for cutting my mail! boot disk failure <<<< [B] ### here it hangs. Question [B]: It seems syslinux cannot take the correct bootsector from dos.bss then it hangs and does not boot, although I have command.com and ibmbio.com etc. (see ls output). How can I boot ? My syslinux.cfg looks like this: SAY welcome! PROMPT 1 TIMEOUT 600 DEFAULT 1 LABEL 1 KERNEL dos.bss Thanks for your help or hints in advance!!!! Thomas. -- Thomas Baumann // Postfach 110115 // D-64216 Darmstadt // <tom at tiri.li>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello... Thomas Baumann wrote: | Loading boot sector... booting... | SYSLINUX 2.04 | welcome! | boot: 1 | [single dot] ... this seemed to be the problem for cutting my mail! | boot disk failure <<<< [B] | ### here it hangs. | | Question [B]: | It seems syslinux cannot take the correct bootsector from dos.bss | then it hangs and does not boot, although I have | command.com and ibmbio.com etc. (see ls output). | How can I boot ? | When I first read about your approach I thought "Why'd he use Syslinux on the Diskimage to boot an ordinary DOS". My approach was to make the Diskimage directly bootable with DOS, not taking the detour over Syslinux... Of course the process of doing that is slightly more complicated since it involves some DOSEMU config file hacking, but you get a Diskimage that'll boot with DOS... Here I described to mailto:Jay.Winks at teksouth.com how I did it using DOSEMU (but I lost my config files for doing it): *************************** |Also, you're saying you fixed it so it'll mount the floppy images? |Again, I'm all ears. I didn't fix DosEmu, I read the documentation (there is a config Tag for ~ mounting Floppy disk images and a tag for mounting raw harddisk images. but with my distribution I had to override most of the configuration, so to speak start over with an empty config file...) I was trying to find my Backups of the process hoping there would be a copy of my DOSEMU config, but so far I haven't been successful. *************************** He seemed to be successful with my approach, perhaps we could ask him for his DOSEMU config-files, to share the know-how he generated. bye Christian -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/Aukh2gF1h3CVOsMRAiU+AKDlVufxiekWXIpWsj+Iq2sgRm1idQCeOh4N ClTo6uEdXe8CZNhqshqccT8=UyfM -----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Thomas Baumann wrote: | Thanks for Remko for his help to solve the fractional cylinder problem. | But there is the second problem, the boot disk failure (see below << [B]) I might have an explanation to that one too: In your original Post you wrote: | # creating a 16MB image with structure C/H/S 2/256/63 | mkdiskimage disk.img 2 256 63 | # creating dos filesystem | mkdosfs disk.img But you forgot that the image will be emulated as a Harddisk. DOS can't boot from Harddisks without a partition table. I don't know if mkdiskimage creates a part.table (no linux Box to test it), but "mkdosfs disk.img" surely overwrites the Partition table if there was one. You should "cfdisk disk.img [...]" right after mkdiskimage. You have to look up the parameters [...]to pass the geometry to it, since I did once it but forgot how to... After that you should use losetup (as root) to mount the diskimage with a proper offset (which is usually the first track calculated in bytes, in this case 63*512. You can look up the sector offset in cfdisk) to point to the start of the partition. Then you can use mkdosfs on that loop device. Everything else you did should also be done using the loop device you setup... bye Christian -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQE/A9bF2gF1h3CVOsMRAnZmAJ9Hvprm4npxBuo6nt2+LL730c7lZACg6n/F qBZ6IFCHWN97GBOoH2J4WCk=vU2X -----END PGP SIGNATURE-----
Thanks to christian for his input. But I need some more help.> | # creating a 16MB image with structure C/H/S 2/256/63 > | mkdiskimage disk.img 2 256 63cfdisk gives an error for illegal heads value. this means there is sth. essentually faulty. so i did the correction: # creating a 16MB image with structure C/H/S 8/64/63 mkdiskimage disk.img 8 64 63 then i called cfdisk (you need ncurses to run this tool). download redhat 9 RPM at https://www.tiri.li/packages/RPMS/cfdisk-glibc-0.8g-1tom.9.0.i386.rpm cfdisk -c 8 -h 64 -s 63 # disk1 Boot Pri DOS FAT16 [NO NAME] 15.75MB cfdisk partition table for disk.img -start- ---end--- start numOf # flag H S C ID H S C Sect Sect # 1 0x80 1 1 0 0x04 63 63 7 63 32193> After that you should use losetup (as root) to mount the diskimage with > a proper offset (which is usually the first track calculated in bytes, > in this case 63*512. You can look up the sector offset in cfdisk) to > point to the start of the partition. Then you can use mkdosfs on that > loop device.losetup -o 32256 /dev/loop0 disk.img I can even do a fdisk -l /dev/loop0 # Disk /dev/loop0: 16MB, ... # 64heads, 63sec, 7 cyl # Units= cyl of 4032 * 512 = 2.064.384 bytes # /dev/loop0p1 * 1 8 16128 4 FAT16<32M Also assigning a letter to mtools is working. cat << EOF >> /etc/mtools.conf drive e: file="/dev/loop0" EOF mlabel -N 00 e:MYDISK mdir e: # Volume in Drive E is MYDISK # Volume Serial Number os 0000-0000 # Directory for E:/ # No files # 16.380.928 bytes free But how can I now transfer an OS to this image ? The device /dev/loop0p1 does not exist. So I cannot do a syslinux /dev/loop0p1. I even cant use the device with dosemu: # dosemu.conf # $_hdimage="drives/* /dev/loop0" Error from dosemu: /dev/loop0 must be a partition, can't find number suffix. Thanks for any further help. Thomas. -- Thomas Baumann // Postfach 110115 // D-64216 Darmstadt // <tom at tiri.li>
Thanks to christian for his input. But I need some more help.> | # creating a 16MB image with structure C/H/S 2/256/63 > | mkdiskimage disk.img 2 256 63cfdisk gives an error for illegal heads value. this means there is sth. essentually faulty. so i did the correction: # creating a 16MB image with structure C/H/S 8/64/63 mkdiskimage disk.img 8 64 63 then i called cfdisk (you need ncurses to run this tool). download redhat 9 RPM at https://www.tiri.li/packages/RPMS/cfdisk-glibc-0.8g-1tom.9.0.i386.rpm cfdisk -c 8 -h 64 -s 63 # disk1 Boot Pri DOS FAT16 [NO NAME] 15.75MB cfdisk partition table for disk.img -start- ---end--- start numOf # flag H S C ID H S C Sect Sect # 1 0x80 1 1 0 0x04 63 63 7 63 32193> After that you should use losetup (as root) to mount the diskimage with > a proper offset (which is usually the first track calculated in bytes, > in this case 63*512. You can look up the sector offset in cfdisk) to > point to the start of the partition. Then you can use mkdosfs on that > loop device.losetup -o 32256 /dev/loop0 disk.img I can even do a fdisk -l /dev/loop0 # Disk /dev/loop0: 16MB, ... # 64heads, 63sec, 7 cyl # Units= cyl of 4032 * 512 = 2.064.384 bytes # /dev/loop0p1 * 1 8 16128 4 FAT16<32M Also assigning a letter to mtools is working. cat << EOF >> /etc/mtools.conf drive e: file="/dev/loop0" EOF mlabel -N 00 e:MYDISK mdir e: # Volume in Drive E is MYDISK # Volume Serial Number os 0000-0000 # Directory for E:/ # No files # 16.380.928 bytes free But how can I now transfer an OS to this image ? The device /dev/loop0p1 does not exist. So I cannot do a syslinux /dev/loop0p1. I even cant use the device with dosemu: # dosemu.conf # $_hdimage="drives/* /dev/loop0" Error from dosemu: /dev/loop0 must be a partition, can't find number suffix. Thanks for any further help. Thomas. -- Thomas Baumann // Postfach 110115 // D-64216 Darmstadt // <tom at tiri.li>
Hello... -------------------> cfdisk -c 8 -h 64 -s 63 > # disk1 Boot Pri DOS FAT16 [NO NAME] 15.75MB > cfdisk partition table for disk.img > -start- ---end--- start numOf > # flag H S C ID H S C Sect Sect > # 1 0x80 1 1 0 0x04 63 63 7 63 32193This means, your disk.img file contains a valid harddisk image with a partition table in sector 0 and a Partition starting at Sector 63 aka CHS 1/1/0> losetup -o 32256 /dev/loop0 disk.imgHere you setup the loop0-device to point to the start of the partition _within_ the file. (Thats what the offset does!)> I can even do a fdisk -l /dev/loop0That doesn't make sense, because /dev/loop0 at best points to a valid Boot record (first sector of a Partiton) but not to a Partition table (ie. the first sector of your disk.img).> Also assigning a letter to mtools is working. > cat << EOF >> /etc/mtools.conf > drive e: file="/dev/loop0" > EOF > mlabel -N 00 e:MYDISK > mdir e: > # Volume in Drive E is MYDISK > # Volume Serial Number os 0000-0000 > # Directory for E:/ > # No files > # 16.380.928 bytes freeThis is correct, since, as I said, the loop0 device points to your actual partition.> But how can I now transfer an OS to this image ?Here comes a tricky part.> The device /dev/loop0p1 does not exist.That statement is correct.> So I cannot do a syslinux /dev/loop0p1.Thats not correct. It should read syslinux /dev/loop0 because you want to make the first partition in your disk.img bootable (remember the offset) Using dosemu is a little complicated, since you've got to throw away most of the default configuration. DOSEMU with the default config doesn't allow you to use the tags for mounting a harddisk image. So you throw away the default config and use that tag (which you've got to look up) in a "virgin" config file. I used a DOS floppy disk image to boot DOSEMU and then sys to make the partition from the diskimage I also mounted bootable. bye Christian -- HiWi PC-Administration Rechenzentrum TU-Clausthal
If you set up the loop device correctly with the appropriate offset it shouldn't. The loop device effectively represents the rest of the disk image from that offset, which should be your partition table. ie, there should be no partition table in the loop device. How did you come to the conclusion that syslinux /dev/loop0 broke your partition table? Are you sure you partitioned the disk image and not the loop device? ----- Original Message ----- From: "Thomas Baumann" <tom at tiri.li> To: "Wichetael" <wichetael at gmx.net> Sent: Thursday, July 03, 2003 14:54 Subject: Re: [syslinux] help: booting dos from syslinux/memdisk> The problem is the following: > > if I do a syslinux to /dev/loop0 my partitiontable > gets broken, and so I cannot boot my dos. > > Is the syntax in my syslinux.cfg correct ? > LABEL 1 > KERNEL pcdos7.bss > LABEL 2 > KERNEL msdos.bss > LABEL 3 > KERNEL vmlinuz > APPEND initrd=initrd.img > > Zitat von Wichetael <wichetael at gmx.net>: > > > > But how can I now transfer an OS to this image ? > > > The device /dev/loop0p1 does not exist. > > > So I cannot do a syslinux /dev/loop0p1. > > > > By using the offset with losetup you actually mounted the firstpartition in> > your disk image and not the complete disk image. > > > > What you should do after you mounted the partition with losetup is: > > > > 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 > > > -- > Thomas Baumann // Postfach 110115 // D-64216 Darmstadt // <tom at tiri.li> >