[syslinux] [PATCH 1/1] COM32: Add stub functions for directories

Gene Cumm gene.cumm at gmail.com
Wed Oct 29 06:27:20 PDT 2008


On Wed, Oct 29, 2008 at 1:27 AM, H. Peter Anvin <hpa at zytor.com> wrote:
> Keith Schincke wrote:
>> Hey Gene,
>>
>> Are you going to be mostly POSIX with the way your functions work?
>> Are you going to add mkdir(), rmdir(), rewinddir() and fchdir()?
>> What file systems are you wanting to support? FAT or ext2 also?
>> opendir() can be quickly written with a statically sized open DIR* handle
>> table.
>>
>
> Well, ultimately you need to push this into the filesystem drivers.
>
> I really dislike the idea of write operations; it's way too easy to
> trash filesystems when encountering semi-broken firmware.
>
>        -hpa

Keith, providing all functions for directories was not my intention.
I was looking at being able to provide these functions such that I
could implement a read-only shell that would allow you to more easily
explore the contents of the boot media from the syslinux environment.
chdir() is the one function that I'm contemplating whether or not to
look at implementing in the first place as it changes the environment
and could easily break anything that happens after it.  I was not
aware of the existence of fchdir() but it makes complete sense in this
context.

As far as POSIX compatibility, that is my intention but to limit it to
only some functions.  Implementing mkdir() and rmdir() impact the
underlying boot media.  If you need these functions, you really should
be booting into a more full fledged operating environment.  Even
something as simple as DOS is more capable than syslinux.  I know that
ISOLINUX must always be treated as a read-only environment.

Peter, it is my intention to start looking at the different syslinux
variants.  It seems that some, if not all, of these functions are
already implemented but do not have a convenient API by which I can
utilize them.  This would first require extending the COMBOOT API to
add these functions but then turn around and implement them to just
return an error, I think by "equ comapi_err".

As far as covering the different variants, each variant is already
aware of how to use its own file system.  (I'm assuming that this is
what you mean by the filesystem drivers)  I would like to have this
work for any variant whose underlying filesystem allows directory
functions in the first place.  This would (I believe) force PXELINUX
to return an error for all of these functions.

With regards to the read-only shell, I'm having decent luck in
creating one and testing it within Linux as the functions are already
implemented.




More information about the Syslinux mailing list