Add an API call to query the configuration file name
authorhpa <hpa>
Fri, 18 Jun 2004 22:55:45 +0000 (22:55 +0000)
committerhpa <hpa>
Fri, 18 Jun 2004 22:55:45 +0000 (22:55 +0000)
NEWS
comboot.doc
comboot.inc
isolinux.asm
ldlinux.asm
pxelinux.asm

diff --git a/NEWS b/NEWS
index 50bc957..72845ff 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@ Starting with 1.47, changes marked with SYSLINUX/PXELINUX/ISOLINUX
 apply to that specific program only; other changes apply to all of
 them.
 
+Changes in 2.11:
+       * ALL: Add an API call to get the configuration file name.
+
 Changes in 2.10:
        * MEMDISK: Handle images compressed with zip as well as with
          gzip.  Some Windows-based image tools apparently generate
index 48e7f8f..cab8c93 100644 (file)
@@ -247,7 +247,7 @@ AX=0003h    Run command
 
        Input:  AX      0003h
                ES:BX   null-terminated command string
-       Output: None
+       Output: Does not return
 
        This API call terminates the program and executes the command
        string as if the user had entered it at the SYSLINUX command
@@ -257,7 +257,7 @@ AX=0003h    Run command
 AX=0004h       Run default command
 
        Input:  AX      0004h
-       Output: None
+       Output: Does not return
 
        This API call terminates the program and executes the default
        command string as if the user had pressed Enter alone on the
@@ -424,7 +424,7 @@ AX=000Bh    Get Serial Console Configuration
 AX=000Ch       Perform final cleanup
        Input:  AX      000Ch
                DX      derivative-specific flags (0000h = clean up all)
-       Output: None
+       Output: Does not return
 
        This routine performs any "final cleanup" the boot loader
        would normally perform before loading a kernel, such as
@@ -461,7 +461,7 @@ AX=000Dh    Cleanup and replace bootstrap code
                EBX(!)  initial value of EDX after bootstrap
                ESI     initial value of ESI after bootstrap
                DS      initial value of DS after bootstrap
-       Output: None
+       Output: Does not return
 
        This routine performs final cleanup, then takes a piece of
        code, copies it over the primary bootstrap at address 7C00h,
@@ -476,3 +476,12 @@ AX=000Dh   Cleanup and replace bootstrap code
        For PXELINUX, if the PXE stack is not unloaded, all registers
        (except DS, ESI and EDX) and the stack will be set up as they
        were set up by the PXE ROM.
+
+
+AX=000Eh       Get configuration file name
+       Input:  AX      0000Eh
+       Output: ES:BX   null-terminated file name string
+
+       Returns the name of the configuration file.  Note that it is
+       possible that the configuration file doesn't actually exist.
+
index 3318a31..3a8f377 100644 (file)
@@ -551,6 +551,16 @@ comapi_chainboot:
                push P_ECX
                jmp replace_bootstrap
 
+
+;
+; INT 22h AX=000Eh     Get configuration file name
+;
+comapi_configfile:
+               mov P_ES,cs
+               mov P_BX,ConfigName
+               clc
+               ret
+
 ;
 ; This stuff should really be in the data section...
 ;
@@ -588,6 +598,7 @@ int22_table:
                dw comapi_serialcfg             ; 000B get serial port config
                dw comapi_cleanup               ; 000C perform final cleanup
                dw comapi_chainboot             ; 000D clean up then bootstrap
+               dw comapi_configfile            ; 000E get name of config file
 int22_count    equ ($-int22_table)/2
 
 APIKeyWait     db 0
index 04d829c..d1d250b 100644 (file)
@@ -1680,6 +1680,7 @@ default_str       db 'default', 0
 default_len    equ ($-default_str)
 boot_dir       db '/boot'                      ; /boot/isolinux
 isolinux_dir   db '/isolinux', 0
+ConfigName     equ $
 isolinux_cfg   db 'isolinux.cfg', 0
 err_disk_image db 'Cannot load disk image (invalid file)?', CR, LF, 0
 
index ad36710..b58211b 100644 (file)
@@ -1412,7 +1412,8 @@ aborted_msg       db ' aborted.'                  ; Fall through to crlf_msg!
 crlf_msg       db CR, LF
 null_msg       db 0
 crff_msg       db CR, FF, 0
-syslinux_cfg   db 'SYSLINUXCFG'
+syslinux_cfg   db 'SYSLINUXCFG'                ; Mangled form
+ConfigName     db 'syslinux.cfg',0             ; Unmangled form
 %if IS_MDSLINUX
 manifest       db 'MANIFEST   '
 %endif
index 3b8a818..58ae7e3 100644 (file)
@@ -817,10 +817,7 @@ prefix:            test byte [DHCPMagic], 04h      ; Did we get a path prefix option
 ; Load configuration file
 ;
 find_config:
-               mov di,trackbuf
-               mov si,cfgprefix
-               mov cx,cfgprefix_len
-               rep movsb
+
 ;
 ; Begin looking for configuration file
 ;
@@ -829,7 +826,6 @@ config_scan:
                jz .no_option
 
                ; We got a DHCP option, try it first
-               push di
                mov si,trying_msg
                call writestr
                mov di,ConfigName
@@ -837,18 +833,23 @@ config_scan:
                call writestr
                call crlf
                call open
-               pop di
                jnz .success
 
-.no_option:    ; Have to guess config file name
+.no_option:
+               mov di,ConfigName
+               mov si,cfgprefix
+               mov cx,cfgprefix_len
+               rep movsb
+
                ; Try loading by MAC address
+               ; Have to guess config file name
                push di
                mov si,MACStr
                mov cx,(3*17+1)/2
                rep movsw
                mov si,trying_msg
                call writestr
-               mov di,trackbuf
+               mov di,ConfigName
                mov si,di
                call writestr
                call crlf
@@ -887,7 +888,7 @@ config_scan:
 .not_default:  pusha
                mov si,trying_msg
                call writestr
-               mov di,trackbuf
+               mov di,ConfigName
                mov si,di
                call writestr
                call crlf