[syslinux] [PATCH 1/1] COMBOOT API: Add calls for directory functions; Implement for FAT

H. Peter Anvin hpa at zytor.com
Fri Dec 12 15:54:01 PST 2008

Gene Cumm wrote:
> Adds an API call to obtain the current working directory.  EXTLINUX
> will not return the correct value yet however SYSLINUX, ISOLINUX, and
> PXELINUX will return the correct value.  For the moment, EXTLINUX will
> ONLY return "./" (null-terminated of course).  In SYSLINUX and
> ISOLINUX, it presets the CurrentDirName string to "/" for safety.
> PXELINUX copies TFTP Prefix to CurrentDirName.

I was thinking about this again today, in particular how to handle it in

There are a lot of people who really want some kind of chdir
functionality, which means knowing the absolute path of the current
configuration file at all times.

It is actually possible to get the absolute path in EXTLINUX.  It just
requires a bit of new code.

There are, in fact, two ways of doing it: one is simply to install a
pathname to the install directory rather than the inode.  We would then
execute a chdir operation during startup, similar to how SYSLINUX and
ISOLINUX already work.

The other option is that we retain the current behaviour (stashed
inode), but do a backwards path search by looking up the ".." entry in
the current directory, and then search that directory for the name that
corresponds to current directory; iterate until we reach the root.  This
is the traditional (all-userspace) implementation of getcwd() in Unix.


More information about the Syslinux mailing list