Ram Yalamanchili
2007-Feb-06 10:39 UTC
[syslinux] Syslinux: Broken file reading for fat16 with 3.35+?
Hello, I noticed after upgrading from 3.20, I haven't been able to get syslinux to boot properly with menu.c32 or mboot.c32 from a USB key. I get an error saying invalid kernel when its trying to load menu.c32 or mboot.c32 (or any other kernel for that matter). I tried 3.35 and 3.36-pre5. Same exact behaviour. I'm using the following to compile: gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-34) NASM version 0.98.39 compiled on Jan 15 2005 Steps to reproduce: /dev/sdc is my usb key mkdiskimage -4 /dev/sdc4 0 64 32 syslinux -s /dev/sdc4 mount /mnt/sdc4 cp menu.c32 mboot.c32 syslinux.cfg mykernel /mnt/sdc4 umount /mnt/sdc4 reboot with key in. syslinux.cfg has the following: default menu.c32 menu title Boot Menu timeout 30 label RBoot menu label ^RBoot kernel mboot.c32 append mykernel Errors: It shows SYSLINUX 3.36 Pre 5, etc.. and then goes to boot: Loading Invalid or corrupt kernel image <repeat last 3 lines for like 5 mins or so> Then all of a sudden the error message changes to: boot: Could not find kernel image: menu.c32 This I assume is happening because the USB key device went away for whatever reason after many minutes. Before the USB key 'went off', entering mboot.c32 or menu.c32 in the prompt also produces the same error. If I enter the name of a non-existant file it says file not found as expected. I used the same above process with syslinux 3.20's syslinux/mkdiskimage, and copied the 3.36-pre5 menu.c32 and mboot.c32 into the partition, and this worked. Anyone know what might be causing this? Looks like ldlinux.sys is broken. I need to upgrade to 3.35 because I need the 0x19 read partition call for my use. On a similar note, Peter, are you ok with me implementing a comboot api call which would take in the bios drive and sector number to get data from (a 0x20 if you will)? Or 0x19 can be modified to take in an argument which says if the partition offset shoudl be added to eax or not before you issue the int 0x13h. I like a newer call which is a "Read raw disk" instead of "read active partition". I want to extend it to read from (drive number, partition number). Further extension could lead to Grub like addressing where you can have files on various other partitions and be able to get them. thanks, Ram
H. Peter Anvin
2007-Feb-06 15:52 UTC
[syslinux] Syslinux: Broken file reading for fat16 with 3.35+?
Ram Yalamanchili wrote:> Hello, > > I noticed after upgrading from 3.20, I haven't been able to get > syslinux to boot properly with menu.c32 or mboot.c32 from a USB key. I > get an error saying invalid kernel when its trying to load menu.c32 or > mboot.c32 (or any other kernel for that matter). I tried 3.35 and > 3.36-pre5. Same exact behaviour. >Could you test 3.31, and assuming that works, the prereleases between 3.31 and 3.35? I have gotten multiple reports of regression in 3.35, and I need help narrowing down the changeset(s) that caused it. -hpa
H. Peter Anvin
2007-Feb-06 15:56 UTC
[syslinux] Syslinux: Broken file reading for fat16 with 3.35+?
Ram Yalamanchili wrote:> > Anyone know what might be causing this? Looks like ldlinux.sys is > broken. I need to upgrade to 3.35 because I need the 0x19 read > partition call for my use. On a similar note, Peter, are you ok with > me implementing a comboot api call which would take in the bios drive > and sector number to get data from (a 0x20 if you will)? Or 0x19 can > be modified to take in an argument which says if the partition offset > shoudl be added to eax or not before you issue the int 0x13h. I like a > newer call which is a "Read raw disk" instead of "read active > partition". I want to extend it to read from (drive number, partition > number). >There is no useful reason to make an API call for that -- syslinux doesn't use that directly. If you're looking for the active partition offset, you can find it through int 0x22 AX=0x000a as [es:bx+8]. To handle multiple partitions, you need to know how to walk the partition tree. chain.c32 has that code in it, it would make more sense to turn that code into a library. > Further extension could lead to Grub like addressing where > you can have files on various other partitions and be able to get > them. No way in hell, sorry. I consider that the pinnacle of bad design, since it means the boot filesystem isn't self-contained. -hpa
Ram Yalamanchili
2007-Feb-06 22:15 UTC
[syslinux] Syslinux: Broken file reading for fat16 with 3.35+?
After trying for an hour or two, I couldn't get extlinux to work at all. I followed directions at: http://syslinux.zytor.com/extlinux.php Assuming /dev/sdc is my USB key, i did: fdisk - create primary partition 1 with ext3. mkfs.ext3 /dev/sdc1 mount /dev/sdc1 /mnt/sdc1 pushd /mnt/sdc1 extlinux -i . (also tried extlinux -i -z .) cp /tmp/syslinux.cfg extlinux.conf (also copied to extlinux.cfg, syslinux.cfg just in case) popd umount /mnt/sdc1 dd if=mbr.bin of=/dev/sdc try to boot machine. Got "Missing Operating System" as the error. This is with 3.32pre8 which works fine for me on syslinux. I'll be done for the rest of the week, so Peter, if you would like any further feedback from me, i can try to before today evening or on monday 12th. -- Ram On 2/6/07, H. Peter Anvin <hpa at zytor.com> wrote:> Ram Yalamanchili wrote: > > Alright, I narrowed it down to the patchset. > > > > I tried 3.31, 3.32pre2, pre6, pre8 -- all working > > 3.35-pre1, pre2, 3.35 -- all failing > > > > Something happened from 3.32-pre8 to 3.35-pre1 which is messing up the > > file reading part i think. Are you able to reproduce this? I tested on > > 3 machines with the USB key and all have the same issue. (Dell > > Poweredge 1800, 1900, and my acer laptop). > > > > Could you do me a favour? Could you check if the same thing happens > with *extlinux* as opposed to syslinux? > > -hpa >