[syslinux] [PATCH 1/1] COMBOOT API: Add get current working directory call to most

Gene Cumm gene.cumm at gmail.com
Mon Nov 10 06:30:15 PST 2008


On Sun, Nov 9, 2008 at 8:21 PM, H. Peter Anvin <hpa at zytor.com> wrote:
> Jeffrey Hutzelman wrote:
>>>>
>>> Okay, this isn't quite right, especially in the case of the TFTP prefix;
>>> the TFTP prefix may not end in '/', especially when the TFTP server is
>>> not a Unix system.  Therefore I think this call should return a prefix
>>> (including a final '/' in case of the filesystem-based variants.)

Alright.  Good to know.  I also just thought of the fact that I made
at least one more mistake in that if the prefix is "/", it will set it
to "".  Should it just be the TFTP Prefix?  It looks like PXELINUX
doesn't change the directory separator and leaves it up to the TFTP
server to deal with it.

>> I guess that depends on what it will be used for.
>>
>> If the intent is for callers to concatenate the returned string with a
>> filename to get something they can open, then I agree.
>>
>> If the intent is for the returned string to be something that can be passed
>> to opendir() (added in one of Gene's previous patches), then maybe not.

The latter was the direction that originally drove me to make that
decision.  I used Linux as a reference and saw that it always returned
without the trailing "/".

> opendir() really shouldn't care.  For the former case, however, it
> really does matter.

Didn't know that opendir() normally doesn't care about the trailing
"/".  Having the trailing "/" (or whatever characters it is) would
make appending the current dir to a file name easier.

> By the way, Gene, this is all impressive work.
>
>        -hpa

Thank you for the complement.  My whole goal with this, as I stated
before, is to be able to have a limited read-only shell for those
emergency situations where you accidentally messed up and _need_ to
know the contents of the filesystem in order to boot some operating
system.

Having the COMBOOT API and COM32 libraries makes it such that such a
shell could be included but need not be a required part of the
application.

And thanks again for a great boot loader suite.




More information about the Syslinux mailing list