Gene Cumm
2008-Nov-10 16:08 UTC
[syslinux] [PATCH 1/1] COMBOOT API: Add get current working directory call to most (revised)
From: Gene Cumm <gene.cumm at gmail.com> COMBOOT API: Add get current working directory call to most (Revised) Signed-off-by: Gene Cumm <gene.cumm at gmail.com> --- Revised based on discussions on this list. Include trailing "/" on SYSLINUX and ISOLINUX. Copy TFTP Prefix as-is in PXELINUX. Initialize CurrentDirName to "./" in EXTLINUX (until a better solution is created). Based on current head plus the patch from yesterday. diff --git a/core/extlinux.asm b/core/extlinux.asm index c9ec166..972a2f6 100644 --- a/core/extlinux.asm +++ b/core/extlinux.asm @@ -43,6 +43,7 @@ SYMLINK_SECTORS equ 2 ; Max number of sectors in a symlink ; (should be >= FILENAME_MAX) ROOT_DIR_WORD equ 0x002F +CUR_DIR_DWORD equ 0x00002F2E ; ; This is what we need to do when idle @@ -845,7 +846,7 @@ load_config: mov si,config_name ; Save config file name mov di,ConfigName call strcpy - mov word[CurrentDirName], ROOT_DIR_WORD ; Write '/',0 to the CurrentDirName + mov dword[CurrentDirName], CUR_DIR_DWORD ; Write './',0,0 to the CurrentDirName call build_curdir_str mov di,ConfigName diff --git a/core/isolinux.asm b/core/isolinux.asm index fbd1ba0..2c71ea1 100644 --- a/core/isolinux.asm +++ b/core/isolinux.asm @@ -1170,6 +1170,9 @@ get_fs_structures: mov si,di mov di,CurrentDirName call strcpy + mov byte[di],0 ;done in case it's not word aligned + dec di + mov byte[di],'/' pop di pop si diff --git a/core/ldlinux.asm b/core/ldlinux.asm index 75e8fef..ac2ae6f 100644 --- a/core/ldlinux.asm +++ b/core/ldlinux.asm @@ -929,7 +929,7 @@ getfattype: ; This is inefficient as it will copy more than needed ; but not by too much call strcpy - mov ax,syslinux_cfg3 ;Cut it down + mov ax,config_name ;Cut it down pop si sub ax,si mov di,CurrentDirName diff --git a/core/pxelinux.asm b/core/pxelinux.asm index 4398582..9836a1e 100644 --- a/core/pxelinux.asm +++ b/core/pxelinux.asm @@ -709,8 +709,6 @@ prefix: test byte [DHCPMagic], 04h ; Did we get a path prefix option mov si,PathPrefix mov di,CurrentDirName call strcpy - sub di,2 - mov byte[di],0 pop di ;
H. Peter Anvin
2008-Nov-10 17:30 UTC
[syslinux] [PATCH 1/1] COMBOOT API: Add get current working directory call to most (revised)
Gene Cumm wrote:> ; This is what we need to do when idle > @@ -845,7 +846,7 @@ load_config: > mov si,config_name ; Save config file name > mov di,ConfigName > call strcpy > - mov word[CurrentDirName], ROOT_DIR_WORD ; Write '/',0 to the CurrentDirName > + mov dword[CurrentDirName], CUR_DIR_DWORD ; Write './',0,0 to theJust a stylistic note: please put a space between the size specifier and the bracket. This is significant especially since in some non-NASM assemblers, the syntax foo[bar] is used to mean [foo+bar]. -hpa
Seemingly Similar Threads
- [PATCH 1/1] COMBOOT API: Add get current working directory call to most
- [PATCH 1/1] COMBOOT API: Add calls for directory functions; Implement for FAT
- [PATCH 1/1] COMBOOT API: Add calls for directory functions; Implement for FAT; Try 2
- [PATCH] mboot using module path
- PATH directive searches in reverse order with wrong separator