[syslinux] [PATCH 1/1] COMBOOT: add get config file full name

Gene Cumm gene.cumm at gmail.com
Tue Nov 4 19:14:04 PST 2008


On Sun, Nov 2, 2008 at 11:25 PM, H. Peter Anvin <hpa at zytor.com> wrote:
> Gene Cumm wrote:
>>
>> Returns the full configuration file name.  Int 22h AX 001Eh for now as
>> it appears that the COMBOOT API is designed to be strictly sequential.
>>  The API gets extended but only implemented (for now) for SYSLINUX in
>> ldlinux.asm.  Implementation and documentation are derived from Int
>> 22h AX 000Eh.
>>
>> There may be a way to be more efficient (with the push/pop on either
>> side of the call to open in order to preserve the current di value)
>> however I'm not sure what registers are available and utilizing the
>> stack would require changes in all variants.
>
> I think we can just have 000Eh return the full configuration file name.
>  The important thing, of course, is that the filename is valid.

I just started off with the assumption of leave the existing
functionality alone.  Thanks for making me think more about the full
file name.  As far as the validity of the file name, the safe bet
would be to set the first character to '\0' to ensure that the string
is a valid null-terminated string.  Then, if a valid file is found,
set it to the real value.

diff --git a/core/ldlinux.asm b/core/ldlinux.asm
--- a/core/ldlinux.asm
+++ b/core/ldlinux.asm
@@ -900,6 +900,7 @@ getfattype:
                mov si,config_name      ; Save configuration file name
                mov di,ConfigName
                call strcpy
+               mov byte[CurrentDirName], 0

                mov eax,[RootDir]       ; Make the root directory ...
                mov [CurrentDir],eax    ; ... the current directory


> As far as registers, it's probably easier to simply push/pop di around
> the call to searchdir in getc.inc.  I have been trying to clean up the
> register conventions more in the core.

Either on either side of the calls or on entry/return.

On a side note: After adding this patch and another for the current
directory (which does little for ISOLINUX, for now),
isolinux-debug.elf is very close to exceeding the 64k segment.




More information about the Syslinux mailing list