;
; Extensions to search for (in *forward* order).
;
-exten_table: db 'CBT',0 ; COMBOOT (specific)
- db 'BSS',0 ; Boot Sector (add superblock)
- db 'BS ',0 ; Boot Sector
- db 'COM',0 ; COMBOOT (same as DOS)
- db 'C32',0 ; COM32
+exten_table: db '.cbt' ; COMBOOT (specific)
+ db '.bss' ; Boot Sector (add superblock)
+ db '.bs', 0 ; Boot Sector
+ db '.com' ; COMBOOT (same as DOS)
+ db '.c32' ; COM32
exten_table_end:
dd 0, 0 ; Need 8 null bytes here
; Find the kernel on disk
;
get_kernel: mov byte [KernelName+FILENAME_MAX],0 ; Zero-terminate filename/extension
-%if IS_SYSLINUX || IS_MDSLINUX ; SYSLINUX has to deal with DOS mangled names...
- mov eax,[KernelName+8] ; Save initial extension
- mov [exten_table_end],eax ; Last case == initial ext.
-%else
mov di,KernelName+4*IS_PXELINUX
xor al,al
mov cx,FILENAME_MAX-5 ; Need 4 chars + null
jne .no_skip
dec di ; Point to final null
.no_skip: mov [KernelExtPtr],di
-%endif
mov bx,exten_table
.search_loop: push bx
mov di,KernelName ; Search on disk
pop bx
jnz kernel_good
mov eax,[bx] ; Try a different extension
-%if IS_SYSLINUX || IS_MDSLINUX
- mov [KernelName+8],eax
-%else
mov si,[KernelExtPtr]
mov [si],eax
mov byte [si+4],0
-%endif
add bx,byte 4
cmp bx,exten_table_end
jna .search_loop ; allow == case (final case)