summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/kernel.inc1
-rw-r--r--core/parseconfig.inc15
-rw-r--r--core/ui.inc20
3 files changed, 11 insertions, 25 deletions
diff --git a/core/kernel.inc b/core/kernel.inc
index 0da03638..9b888cc8 100644
--- a/core/kernel.inc
+++ b/core/kernel.inc
@@ -98,6 +98,7 @@ extlinux_id equ 034h ; 3 = SYSLINUX family; 4 = EXTLINUX
;
; 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
diff --git a/core/parseconfig.inc b/core/parseconfig.inc
index 5159a1a3..ce5450c9 100644
--- a/core/parseconfig.inc
+++ b/core/parseconfig.inc
@@ -83,24 +83,15 @@ pc_ipappend: call getint
%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
diff --git a/core/ui.inc b/core/ui.inc
index cb6e03bd..d14245c5 100644
--- a/core/ui.inc
+++ b/core/ui.inc
@@ -396,26 +396,18 @@ vk_check:
%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
;
@@ -442,6 +434,8 @@ vk_check:
;
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