;
; Types of vkernels
;
+VK_LOCALBOOT equ -1 ; localboot (no actual kernel loaded)
VK_KERNEL equ 0 ; Choose by filename
VK_LINUX equ 1 ; Linux kernel image
VK_BOOT equ 2 ; Boot sector
%endif
;
-; "localboot" command (PXELINUX, ISOLINUX)
+; "localboot" command
;
%if HAS_LOCALBOOT
pc_localboot: call getint
cmp byte [VKernel],0 ; ("label" section only)
je .err
- mov di,VKernelBuf+vk_rname
- xor ax,ax
- mov cx,FILENAME_MAX
- rep stosb ; Null kernel name
-%if IS_PXELINUX
- ; PXELINUX uses the first 4 bytes of vk_rname for the
- ; mangled IP address
- mov [VKernelBuf+vk_rname+5], bx ; Return type
-%else
- mov [VKernelBuf+vk_rname+1], bx ; Return type
-%endif
+ mov [VKernelBuf+vk_rname],bx
+ mov byte [VKernelBuf+vk_type],VK_LOCALBOOT
.err: ret
%endif ; HAS_LOCALBOOT
%endif
xor bx,bx ; Try only one version
- mov al, [VKernelBuf+vk_type]
- mov [KernelType], al
+ mov al,[VKernelBuf+vk_type]
+ mov [KernelType],al
%if HAS_LOCALBOOT
; Is this a "localboot" pseudo-kernel?
-%if IS_PXELINUX
- cmp byte [VKernelBuf+vk_rname+4], 0
-%else
- cmp byte [VKernelBuf+vk_rname], 0
+ cmp al,VK_LOCALBOOT ; al == KernelType
+ mov ax,[VKernelBuf+vk_rname] ; Possible localboot type
+ je local_boot
%endif
- jne get_kernel ; No, it's real, go get it
-
- mov ax, [VKernelBuf+vk_rname+1]
- jmp local_boot
-%else
jmp get_kernel
-%endif
.not_vk:
-
;
; Not a "virtual kernel" - check that's OK and construct the command line
;
;
get_kernel: mov byte [KernelName+FILENAME_MAX],0 ; Zero-terminate filename/extension
mov di,KernelName+4*IS_PXELINUX
+ cmp byte [di],' '
+ jb bad_kernel ; Missing kernel name
xor al,al
mov cx,FILENAME_MAX-5 ; Need 4 chars + null
repne scasb ; Scan for final null