; NASM 0.98.38 croaks if these are equ's rather than macros...
FILENAME_MAX_LG2 equ 8 ; log2(Max filename size Including final null)
FILENAME_MAX equ (1 << FILENAME_MAX_LG2) ; Max mangled filename size
-NULLFILE equ ' ' ; First char space == null filename
+NULLFILE equ 0 ; Null character == empty filename
+NULLOFFSET equ 0 ; Position in which to look
retry_count equ 6 ; How patient are we with the disk?
%assign HIGHMEM_SLOP 0 ; Avoid this much memory near the top
LDLINUX_MAGIC equ 0x3eb202fe ; A random number to identify ourselves with
FILENAME_MAX_LG2 equ 8 ; log2(Max filename size Including final null)
FILENAME_MAX equ (1 << FILENAME_MAX_LG2)
NULLFILE equ 0 ; Zero byte == null file name
+NULLOFFSET equ 0 ; Position in which to look
retry_count equ 6 ; How patient are we with the BIOS?
%assign HIGHMEM_SLOP 128*1024 ; Avoid this much memory near the top
MAX_OPEN_LG2 equ 6 ; log2(Max number of open files)
FILENAME_MAX_LG2 equ 4 ; log2(Max filename size Including final null)
FILENAME_MAX equ 11 ; Max mangled filename size
NULLFILE equ ' ' ; First char space == null filename
+NULLOFFSET equ 0 ; Position in which to look
retry_count equ 6 ; How patient are we with the disk?
%assign HIGHMEM_SLOP 0 ; Avoid this much memory near the top
LDLINUX_MAGIC equ 0x3eb202fe ; A random number to identify ourselves with
FILENAME_MAX_LG2 equ 7 ; log2(Max filename size Including final null)
FILENAME_MAX equ (1 << FILENAME_MAX_LG2)
NULLFILE equ 0 ; Zero byte == null file name
+NULLOFFSET equ 4 ; Position in which to look
REBOOT_TIME equ 5*60 ; If failure, time until full reset
%assign HIGHMEM_SLOP 128*1024 ; Avoid this much memory near the top
MAX_OPEN_LG2 equ 5 ; log2(Max number of open sockets)
push si ; mangle_dir mangles si
call mangle_name ; Mangle ramdisk name
pop si
- cmp byte [es:InitRD],NULLFILE ; Null filename?
+ cmp byte [es:InitRD+NULLOFFSET],NULLFILE ; Null filename?
seta byte [es:initrd_flag] ; Set flag if not
not_initrd: pop es ; Restore ES -> real_mode_seg
skip_this_opt: lodsb ; Load from command line
shl ax,FILENAME_MAX_LG2 ; Convert to pointer
add ax,FKeyName
xchg di,ax
- cmp byte [di],NULLFILE
+ cmp byte [di+NULLOFFSET],NULLFILE
je short fk_nofile ; Undefined F-key
call searchdir
jz short fk_nofile ; File not found