section .bss16
alignb 4
DOSErrTramp resd 33 ; Error trampolines
+
+ global ConfigName, CurrentDirName
ConfigName resb FILENAME_MAX
CurrentDirName resb FILENAME_MAX
mov si,VGAFileBuf
mov di,VGAFileMBuf
call mangle_name
- call open
+ call core_open
jz msg_putcharnext ; Not there
call vgadisplayfile
; Fall through
; cache.c
extern cache_init, get_cache_block
+ ; load_config.c
+ extern load_config
+
%endif ; EXTERN_INC
;
; Load configuration file
;
-load_config:
- mov si,config_name ; Save config file name
- mov di,ConfigName
- call strcpy
- mov dword [CurrentDirName],CUR_DIR_DWORD ; Write './',0,0 to the CurrentDirName
- call build_curdir_str
-
- mov di,ConfigName
- call open
+ pm_call load_config
jz no_config_file
;
;
; close: Output: CF set if nothing open
;
-open:
+ global core_open
+core_open:
call searchdir
jz openfd.ret
openfd:
extern char core_xfer_buf[65536];
extern char core_cache_buf[65536];
+extern char CurrentDirName[];
+extern char ConfigName[];
+
+
/* diskstart.inc */
extern void getlinsec(void);
+/* getc.inc */
+extern void core_open(void);
+
/* hello.c */
extern void myputs(const char*);
mov [CurrentDir],eax ; ... the current directory
mov di,syslinux_cfg1
push di
- call open
+ call core_open
pop di
jnz .config_open
mov di,syslinux_cfg2
push di
- call open
+ call core_open
pop di
jnz .config_open
mov di,syslinux_cfg3
push di
- call open
+ call core_open
pop di
jz no_config_file
.config_open:
call pc_getline
mov di,MNameBuf
call mangle_name
- call open
+ call core_open
jnz .ok
pop ax ; Drop the successor function
.ok: ret ; Tailcall if OK, error return
xchg di,ax
cmp byte [di+NULLOFFSET],NULLFILE
je short fk_nofile ; Undefined F-key
- call open
+ call core_open
jz short fk_nofile ; File not found
call crlf
call get_msg_file