[syslinux] SYSLINUX 3.35 released

H. Peter Anvin hpa at zytor.com
Thu Feb 1 21:16:09 PST 2007


Luciano Miguel Ferreira Rocha wrote:
>>
>> The reason is that the installer would have to be able to do a 
>> VFAT-to-MSDOS transformation on the entire path in order to encode it in 
>> ldlinux.sys (encoding something like the starting sector of a directory 
>> is unsafe in FAT, since it's not guaranteed to stay put.)
> 
> Correct me if I'm wrong, but from reading unix/syslinux.c, the
> filesystem is mounted as msdos, ergo no VFAT-to-MSDOS translation is
> needed for the -d option, as any "vfat" component on -d will fail upon
> the rename.
> 

As of 3.36-pre2, that's no longer the case, though.

I could revert that change, but that would make other people unhappy 
(see thread.)

>> Not all environments can do that natively, which means I would have had 
>> to write libfat code for it, and that would have made it take a lot longer.
> 
> Which ones? Win32?

mtools is the worst.  mdir can give you a table of long and short names 
for a single directory, but it doesn't tell you how to apply the fuzzy 
matching that is inherently needed.

Linux isn't ideal, either, having again only a way to get a list of 
matching names.  It is, however, better since it has inode numbers that 
one can use to verify the match with.

For Win32 there is GetShortPathName(), and for DOS there is INT 21h, 
AX=7160h, CL=01h.  (Right now I don't call the Long Filename functions 
in the MS-DOS installer at all, which I probably should.)  Both of those 
are pretty much the ideal functionality.

> After battling for a few hours with ldlinux.lst, I ended up having to do
> a string search in syslinux_ldlinux for the place I created for the
> specified dir.
> 
> The attached patch changes ldlinux.asm (adds a syslinux_cfg0 buffer for
> the new location) and unix/syslinux.c (set the reserved region to the
> specified directory).
> 
> I didn't like that I couldn't find the location of the buffer from the
> .lst, I'm probably missing something obvious. The length is easy, but is
> hardcoded to 32 bytes for now (counting with suffix "/syslinux.cfg"). 64
> bytes also works OK.
> 
> PS: After some more battles, I can locate the buffer using ldlinux.map:
> <location_of_syslinux_cfg0>-<start_of_.text>-<0x200 (a sector)>. Is
> there an easy way of getting that and syslinux_cfg1-syslinux_cfg0
> without having to use awk/sed/perl?

There is a flag called LDLINUX_MAGIC, which the code in syslxmod.c uses 
to find the areas that need to be automatically patched.  Pretty much 
one would either have a pointer or a fixed offset from this word to find 
things.

	-hpa




More information about the Syslinux mailing list