summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS6
-rw-r--r--bootsect.inc9
-rw-r--r--comboot.doc15
-rw-r--r--comboot.inc6
-rw-r--r--configinit.inc58
-rw-r--r--conio.inc2
-rw-r--r--extlinux.asm3
-rw-r--r--font.inc2
-rw-r--r--graphics.inc2
-rw-r--r--init.inc26
-rw-r--r--initconfig.inc69
-rw-r--r--isolinux.asm30
-rw-r--r--kernel.inc13
-rw-r--r--keywords7
-rw-r--r--keywords.inc9
-rw-r--r--layout.inc5
-rw-r--r--ldlinux.asm2
-rw-r--r--parseconfig.inc17
-rw-r--r--pxelinux.asm5
-rw-r--r--syslinux.doc17
-rw-r--r--ui.inc55
-rw-r--r--version2
22 files changed, 293 insertions, 67 deletions
diff --git a/NEWS b/NEWS
index c8e472fb..2b450a0f 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,12 @@ Starting with 1.47, changes marked with SYSLINUX/PXELINUX/ISOLINUX
apply to that specific program only; other changes apply to all of
them.
+Changes in 3.40:
+ * New keywords allow the type of file to be specified in the
+ configuration file.
+ * It is now supported to load a different configuration file
+ with the CONFIG keyword.
+
Changes in 3.36:
* MEMDISK: Disable EDD by default on floppy disks. EDD can be
enabled with the "edd" option and disabled with "noedd".
diff --git a/bootsect.inc b/bootsect.inc
index a2137ecf..7c288daf 100644
--- a/bootsect.inc
+++ b/bootsect.inc
@@ -180,12 +180,3 @@ replace_bootstrap:
movzx esp,di
jmp shuffle_and_boot
-
-%if IS_SYSLINUX || IS_MDSLINUX
- ; Nothing
-%else
-is_bss_sector:
- mov si,err_bssimage
- call cwritestr
- jmp enter_command
-%endif
diff --git a/comboot.doc b/comboot.doc
index 8aaa0e78..0d7af174 100644
--- a/comboot.doc
+++ b/comboot.doc
@@ -642,7 +642,7 @@ AX=0016h [3.10] Run kernel image
DS:SI Filename of kernel image (zero-terminated string)
ES:BX Command line (zero-terminated string)
ECX IPAPPEND flags [PXELINUX]
- EDX Reserved - MUST BE ZERO
+ EDX Type of file (since 3.40)
Output: Does not return if successful; returns with CF=1 if
the kernel image is not found.
@@ -662,6 +662,19 @@ AX=0016h [3.10] Run kernel image
may still return to the command line if the image is somehow
corrupt, however.)
+ The file types are defined as follows:
+
+ Equivalent
+ EDX Config Extensions Type of file
+ 0 KERNEL Determined by filename extension
+ 1 LINUX none Linux kernel image
+ 2 BOOT .0 .bs .bin Bootstrap program
+ 3 BSS .bss Boot sector with patch [SYSLINUX]
+ 4 FDIMAGE .img Floppy disk image [ISOLINUX]
+ 5 COMBOOT .com .cbt 16-bit COMBOOT program
+ 6 COM32 .c32 COM32 program
+ 7 CONFIG Configuration file
+
AX=0017h [3.30] Report video mode change
Input: AX 0017h
diff --git a/comboot.inc b/comboot.inc
index 0f544c2e..304accaa 100644
--- a/comboot.inc
+++ b/comboot.inc
@@ -679,6 +679,10 @@ comapi_features:
; INT 22h AX=0016h Run kernel image
;
comapi_runkernel:
+ mov al,P_DL
+ cmp al,VK_TYPES-1
+ ja .error
+ mov [KernelType],al
push ds
mov ds,P_DS
mov si,P_SI
@@ -734,6 +738,8 @@ comapi_runkernel:
mov word [CmdOptPtr],zero_string
jmp kernel_good_saved
+.error equ comapi_shuffle.error
+
;
; INT 22h AX=0017h Report video mode change
;
diff --git a/configinit.inc b/configinit.inc
new file mode 100644
index 00000000..b26216e6
--- /dev/null
+++ b/configinit.inc
@@ -0,0 +1,58 @@
+;; -----------------------------------------------------------------------
+;;
+;; Copyright 1994-2006 H. Peter Anvin - All Rights Reserved
+;;
+;; This program is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+;; Boston MA 02111-1307, USA; either version 2 of the License, or
+;; (at your option) any later version; incorporated herein by reference.
+;;
+;; -----------------------------------------------------------------------
+
+;;
+;; configinit.inc
+;;
+;; Initialize the configuration section
+;;
+
+ section .text
+
+reset_config:
+ xor eax,eax
+
+ ; Initialize the .config section
+ mov si,section..config.start
+ mov di,section..config.vstart
+ mov cx,section..config.end.start
+ sub cx,di
+ shr cx,2
+ rep movsd
+
+%ifndef DEPEND
+%if NULLFILE != 0
+ mov al,NULLFILE
+ mov di,FKeyName
+ mov cx,10*(1 << FILENAME_MAX_LG2)
+ rep stosb
+%endif
+%endif
+
+ mov si,linuxauto_cmd ; Default command: "linux auto"
+ mov di,default_cmd
+ mov cx,linuxauto_len
+ rep movsb
+
+ mov di,KbdMap ; Default keymap 1:1
+ xor al,al
+ inc ch ; CX <- 256
+mkkeymap: stosb
+ inc al
+ loop mkkeymap
+
+ ret
+
+ section .data
+linuxauto_cmd db 'linux auto',0
+linuxauto_len equ $-linuxauto_cmd
+
diff --git a/conio.inc b/conio.inc
index 8fd9d9d2..f8b80739 100644
--- a/conio.inc
+++ b/conio.inc
@@ -386,7 +386,7 @@ debug_tracer: pushad
ret
%endif ; DEBUG_TRACERS
- section .data
+ section .config
; This is a word to pc_setint16 can set it
DisplayCon dw 01h ; Console display enabled
diff --git a/extlinux.asm b/extlinux.asm
index e41f6ae3..e4628478 100644
--- a/extlinux.asm
+++ b/extlinux.asm
@@ -62,6 +62,7 @@ SYMLINK_SECTORS equ 2 ; Max number of sectors in a symlink
vk_vname: resb FILENAME_MAX ; Virtual name **MUST BE FIRST!**
vk_rname: resb FILENAME_MAX ; Real name
vk_appendlen: resw 1
+vk_type: resb 1 ; Type of file
alignb 4
vk_append: resb max_cmd_len+1 ; Command line
alignb 4
@@ -1516,6 +1517,7 @@ getfssec:
%include "conio.inc" ; Console I/O
%include "plaincon.inc" ; writechr
%include "writestr.inc" ; String output
+%include "configinit.inc" ; Initialize configuration
%include "parseconfig.inc" ; High-level config file handling
%include "parsecmd.inc" ; Low-level config file handling
%include "bcopy32.inc" ; 32-bit bcopy
@@ -1556,7 +1558,6 @@ err_oldkernel db 'Cannot load a ramdisk with an old kernel image.'
db CR, LF, 0
err_notdos db ': attempted DOS system call', CR, LF, 0
err_comlarge db 'COMBOOT image too large.', CR, LF, 0
-err_bssimage db 'BSS images not supported.', CR, LF, 0
err_a20 db CR, LF, 'A20 gate not responding!', CR, LF, 0
err_bootfailed db CR, LF, 'Boot failed: please change disks and press '
db 'a key to continue.', CR, LF, 0
diff --git a/font.inc b/font.inc
index f27f8785..4eeee1d5 100644
--- a/font.inc
+++ b/font.inc
@@ -102,8 +102,6 @@ use_font:
mov ax,1103h ; Select page 0
int 10h
- ; Fall through to adjust_screen
-
lf_ret equ use_font.lf_ret
;
diff --git a/graphics.inc b/graphics.inc
index cfdcf6e6..e80e04cd 100644
--- a/graphics.inc
+++ b/graphics.inc
@@ -307,8 +307,8 @@ vgaclearmode:
; int 10h
mov [UsingVGA], byte 0
- call use_font ; Restore text font/data
mov byte [ScrollAttribute], 07h
+ call use_font ; Restore text font/data
.done:
popad
pop es
diff --git a/init.inc b/init.inc
index a01c6e94..2f31b0ed 100644
--- a/init.inc
+++ b/init.inc
@@ -22,23 +22,10 @@ common_init:
; Now set up screen parameters
call adjust_screen
- ; Wipe the F-key area
- mov al,NULLFILE
- mov di,FKeyName
- mov cx,10*(1 << FILENAME_MAX_LG2)
- rep stosb
-
- mov si,linuxauto_cmd ; Default command: "linux auto"
- mov di,default_cmd
- mov cx,linuxauto_len
- rep movsb
-
- mov di,KbdMap ; Default keymap 1:1
- xor al,al
- inc ch ; CX <- 256
-mkkeymap: stosb
- inc al
- loop mkkeymap
+;
+; Initialize configuration information
+;
+ call reset_config
;
; Clear Files structures
@@ -57,9 +44,4 @@ mkkeymap: stosb
add ax,PKTBUF_SIZE
loop .setbufptr
%endif
-
- section .data
-linuxauto_cmd db 'linux auto',0
-linuxauto_len equ $-linuxauto_cmd
-
section .text ; This is an inline file...
diff --git a/initconfig.inc b/initconfig.inc
new file mode 100644
index 00000000..5240567c
--- /dev/null
+++ b/initconfig.inc
@@ -0,0 +1,69 @@
+; -*- fundamental -*-
+; -----------------------------------------------------------------------
+;
+; Copyright 2004 H. Peter Anvin - All Rights Reserved
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+; Boston MA 02111-1307, USA; either version 2 of the License, or
+; (at your option) any later version; incorporated herein by reference.
+;
+; -----------------------------------------------------------------------
+
+;
+; init.inc
+;
+; Common initialization code (inline)
+;
+
+ section .text
+common_init:
+ ; Now set up screen parameters
+ call adjust_screen
+
+
+ ; If we restart with a new configuration file, start
+ ; over here...
+reset_config:
+ ; Wipe the F-key area
+ mov al,NULLFILE
+ mov di,FKeyName
+ mov cx,10*(1 << FILENAME_MAX_LG2)
+ rep stosb
+
+ mov si,linuxauto_cmd ; Default command: "linux auto"
+ mov di,default_cmd
+ mov cx,linuxauto_len
+ rep movsb
+
+ mov di,KbdMap ; Default keymap 1:1
+ xor al,al
+ inc ch ; CX <- 256
+mkkeymap: stosb
+ inc al
+ loop mkkeymap
+
+;
+; Clear Files structures
+;
+ mov di,Files
+ mov cx,(MAX_OPEN*open_file_t_size)/4
+ xor eax,eax
+ rep stosd
+
+%if IS_PXELINUX
+ mov di,Files+tftp_pktbuf
+ mov cx,MAX_OPEN
+.setbufptr:
+ mov [di],ax
+ add di,open_file_t_size
+ add ax,PKTBUF_SIZE
+ loop .setbufptr
+%endif
+
+ section .data
+linuxauto_cmd db 'linux auto',0
+linuxauto_len equ $-linuxauto_cmd
+
+ section .text ; This is an inline file...
diff --git a/isolinux.asm b/isolinux.asm
index 27d0b8c1..35827f14 100644
--- a/isolinux.asm
+++ b/isolinux.asm
@@ -56,6 +56,7 @@ SECTOR_SIZE equ (1 << SECTOR_SHIFT)
vk_vname: resb FILENAME_MAX ; Virtual name **MUST BE FIRST!**
vk_rname: resb FILENAME_MAX ; Real name
vk_appendlen: resw 1
+vk_type: resb 1 ; Type of file
alignb 4
vk_append: resb max_cmd_len+1 ; Command line
alignb 4
@@ -825,17 +826,16 @@ rl_checkpt_off equ ($-$$)
; ----------------------------------------------------------------------------
all_read:
+
+; Test tracers
+ TRACER 'T'
+ TRACER '>'
+
;
-; Initialize screen (if we're using one)
+; Common initialization code
;
- ; Now set up screen parameters
- call adjust_screen
-
- ; Wipe the F-key area
- mov al,NULLFILE
- mov di,FKeyName
- mov cx,10*(1 << FILENAME_MAX_LG2)
- rep stosb
+%include "init.inc"
+%include "cpuinit.inc"
; Patch the writechr routine to point to the full code
mov word [writechr+1], writechr_full-(writechr+3)
@@ -846,16 +846,6 @@ all_read:
call writestr
%endif
-; Test tracers
- TRACER 'T'
- TRACER '>'
-
-;
-; Common initialization code
-;
-%include "init.inc"
-%include "cpuinit.inc"
-
;
; Now we're all set to start with our *real* business. First load the
; configuration file (if any) and parse it.
@@ -1476,6 +1466,7 @@ getfssec:
%include "getc.inc" ; getc et al
%include "conio.inc" ; Console I/O
+%include "configinit.inc" ; Initialize configuration
%include "parseconfig.inc" ; High-level config file handling
%include "parsecmd.inc" ; Low-level config file handling
%include "bcopy32.inc" ; 32-bit bcopy
@@ -1514,7 +1505,6 @@ err_oldkernel db 'Cannot load a ramdisk with an old kernel image.'
db CR, LF, 0
err_notdos db ': attempted DOS system call', CR, LF, 0
err_comlarge db 'COMBOOT image too large.', CR, LF, 0
-err_bssimage db 'BSS images not supported.', CR, LF, 0
err_a20 db CR, LF, 'A20 gate not responding!', CR, LF, 0
notfound_msg db 'not found', CR, LF, 0
localboot_msg db 'Booting from local disk...', CR, LF, 0
diff --git a/kernel.inc b/kernel.inc
index 48a704bc..2a99da57 100644
--- a/kernel.inc
+++ b/kernel.inc
@@ -87,4 +87,17 @@ pxelinux_id equ 032h ; 3 = SYSLINUX family; 2 = PXELINUX
isolinux_id equ 033h ; 3 = SYSLINUX family; 3 = ISOLINUX
extlinux_id equ 034h ; 3 = SYSLINUX family; 4 = EXTLINUX
+;
+; Types of vkernels
+;
+VK_KERNEL equ 0 ; Choose by filename
+VK_LINUX equ 1 ; Linux kernel image
+VK_BOOT equ 2 ; Boot sector
+VK_BSS equ 3 ; BSS boot sector
+VK_FDIMAGE equ 4 ; Floppy disk image
+VK_COMBOOT equ 5 ; COMBOOT image
+VK_COM32 equ 6 ; COM32 image
+VK_CONFIG equ 7 ; Configuration file
+VK_TYPES equ 8 ; Number of VK types
+
%endif ; _KERNEL_INC
diff --git a/keywords b/keywords
index 39a871c0..95c9379c 100644
--- a/keywords
+++ b/keywords
@@ -1,6 +1,7 @@
menu
text
append
+config
default
display
font
@@ -8,6 +9,12 @@ implicit
ipappend
kbdmap
kernel
+linux
+boot
+bss
+fdimage
+comboot
+com32
label
localboot
prompt
diff --git a/keywords.inc b/keywords.inc
index 811d5bd8..908fd4ea 100644
--- a/keywords.inc
+++ b/keywords.inc
@@ -53,7 +53,14 @@ keywd_table:
keyword font, pc_filecmd, loadfont
keyword implicit, pc_setint16, AllowImplicit
keyword kbdmap, pc_filecmd, loadkeys
- keyword kernel, pc_kernel
+ keyword kernel, pc_kernel, VK_KERNEL
+ keyword linux, pc_kernel, VK_LINUX
+ keyword boot, pc_kernel, VK_BOOT
+ keyword bss, pc_kernel, VK_BSS
+ keyword fdimage, pc_kernel, VK_FDIMAGE
+ keyword comboot, pc_kernel, VK_COMBOOT
+ keyword com32, pc_kernel, VK_COM32
+ keyword config, pc_kernel, VK_CONFIG
keyword label, pc_label
keyword prompt, pc_setint16, ForcePrompt
keyword say, pc_say
diff --git a/layout.inc b/layout.inc
index f4e03079..7b122d74 100644
--- a/layout.inc
+++ b/layout.inc
@@ -47,8 +47,11 @@ STACK_START equ TEXT_START-STACK_SIZE
section .earlybss nobits start=BSS_START
section .bcopy32 align=4 valign=16 follows=.data vfollows=.earlybss
+ section .config align=4 valign=16 follows=.bcopy32 vfollows=.bcopy32
+ section .config.end nobits align=4 follows=.config
+
; NASM BUG: follows= here should be vfollows=
- section .bss nobits align=256 follows=.bcopy32
+ section .bss nobits align=256 follows=.config.end
section .text start=TEXT_START
; NASM BUG: follows=.text not accepted here
diff --git a/ldlinux.asm b/ldlinux.asm
index a5637cd1..69259247 100644
--- a/ldlinux.asm
+++ b/ldlinux.asm
@@ -64,6 +64,7 @@ SECTOR_SIZE equ (1 << SECTOR_SHIFT)
vk_vname: resb FILENAME_MAX ; Virtual name **MUST BE FIRST!**
vk_rname: resb FILENAME_MAX ; Real name
vk_appendlen: resw 1
+vk_type: resb 1 ; Type of file
alignb 4
vk_append: resb max_cmd_len+1 ; Command line
alignb 4
@@ -1528,6 +1529,7 @@ getfatsector:
%include "conio.inc" ; Console I/O
%include "plaincon.inc" ; writechr
%include "writestr.inc" ; String output
+%include "configinit.inc" ; Initialize configuration
%include "parseconfig.inc" ; High-level config file handling
%include "parsecmd.inc" ; Low-level config file handling
%include "bcopy32.inc" ; 32-bit bcopy
diff --git a/parseconfig.inc b/parseconfig.inc
index de64a18f..dd7e7b00 100644
--- a/parseconfig.inc
+++ b/parseconfig.inc
@@ -1,6 +1,6 @@
;; -----------------------------------------------------------------------
;;
-;; Copyright 1994-2004 H. Peter Anvin - All Rights Reserved
+;; Copyright 1994-2006 H. Peter Anvin - All Rights Reserved
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -100,9 +100,11 @@ pc_localboot: call getint
%endif
;
-; "kernel" command
+; "kernel", "config", ... command
+;
pc_kernel: cmp byte [VKernel],0
je .err ; ("label" section only)
+ mov [VKernelBuf+vk_type],al
call pc_getline
mov di,VKernelBuf+vk_rname
call mangle_name
@@ -252,10 +254,15 @@ pc_serial: call getint
call slow_out
; Show some life
+ cmp byte [SerialNotice],0
+ je .notfirst
+ mov byte [SerialNotice],0
+
mov si,syslinux_banner
call write_serial_str
mov si,copyright_str
call write_serial_str
+.notfirst:
ret
.serial_port_bad:
@@ -399,7 +406,9 @@ commit_vk:
section .data
vk_overflow_msg db 'Out of memory parsing config file', CR, LF, 0
+SerialNotice db 1 ; Only print this once
+ section .config
align 4, db 0
KbdTimeout dd 0 ; Keyboard timeout (if any)
TotalTimeout dd 0 ; Total timeout (if any)
@@ -415,6 +424,10 @@ SerialPort dw 0 ; Serial port base (or 0 for no serial port)
VKernelBytes dw 0 ; Number of bytes used by vkernels
VKernel db 0 ; Have we seen any "label" statements?
+%if IS_PXELINUX
+IPAppend db 0 ; Default IPAPPEND option
+%endif
+
section .latebss
alignb 4 ; For the good of REP MOVSD
command_line resb max_cmd_len+2 ; Command line buffer
diff --git a/pxelinux.asm b/pxelinux.asm
index ac986d3a..6f99b324 100644
--- a/pxelinux.asm
+++ b/pxelinux.asm
@@ -96,7 +96,7 @@ TFTP_EOPTNEG equ htons(8) ; Option negotiation failure
vk_vname: resb FILENAME_MAX ; Virtual name **MUST BE FIRST!**
vk_rname: resb FILENAME_MAX ; Real name
vk_ipappend: resb 1 ; "IPAPPEND" flag
- resb 1 ; Pad
+vk_type: resb 1 ; Type of file
vk_appendlen: resw 1
alignb 4
vk_append: resb max_cmd_len+1 ; Command line
@@ -2305,6 +2305,7 @@ check_for_arp:
%include "writestr.inc" ; String output
writestr equ cwritestr
%include "writehex.inc" ; Hexadecimal output
+%include "configinit.inc" ; Initialize configuration
%include "parseconfig.inc" ; High-level config file handling
%include "parsecmd.inc" ; Low-level config file handling
%include "bcopy32.inc" ; 32-bit bcopy
@@ -2347,7 +2348,6 @@ err_oldkernel db 'Cannot load a ramdisk with an old kernel image.'
db CR, LF, 0
err_notdos db ': attempted DOS system call', CR, LF, 0
err_comlarge db 'COMBOOT image too large.', CR, LF, 0
-err_bssimage db 'BSS images not supported.', CR, LF, 0
err_a20 db CR, LF, 'A20 gate not responding!', CR, LF, 0
err_bootfailed db CR, LF, 'Boot failed: press a key to retry, or wait for reset...', CR, LF, 0
bailmsg equ err_bootfailed
@@ -2546,5 +2546,4 @@ EndOfGetCBuf dw getcbuf+trackbufsize ; = getcbuf+BufSafeBytes
%error trackbufsize must be a multiple of TFTP_BLOCKSIZE
%endif
%endif
-IPAppend db 0 ; Default IPAPPEND option
DHCPMagic db 0 ; DHCP site-specific option info
diff --git a/syslinux.doc b/syslinux.doc
index 7f07407a..a5500873 100644
--- a/syslinux.doc
+++ b/syslinux.doc
@@ -192,6 +192,19 @@ LABEL label
Since version 3.32 label names are no longer mangled into DOS
format (for SYSLINUX.)
+ LINUX image - Linux kernel image (default)
+ BOOT image - Bootstrap program (.bs, .0, .bin)
+ BSS image - BSS image (.bss)
+ FDIMAGE image - Floppy disk image (.img)
+ COMBOOT image - COMBOOT program (.com, .cbt)
+ COM32 image - COM32 program (.c32)
+ CONFIG image - New configuration file
+ Using one of these keywords instead of KERNEL forces the
+ filetype, regardless of the filename.
+
+ CONFIG means restart the boot loader using a different
+ configuration file.
+
APPEND -
Append nothing. APPEND with a single hyphen as argument in a
LABEL section can be used to override a global APPEND.
@@ -510,6 +523,10 @@ file by adding extensions in the order listed above if the plain
filename is not found. Filenames in KERNEL statements must be fully
qualified.
+If this is specified with one of the keywords LINUX, BOOT, BSS,
+FDIMAGE, COMBOOT, COM32, or CONFIG instead of KERNEL, the filetype is
+considered to be the one specified regardless of the filename.
+
++++ BOOTING DOS (OR OTHER SIMILAR OPERATING SYSTEMS) ++++
diff --git a/ui.inc b/ui.inc
index ddde6bb5..b5eed64a 100644
--- a/ui.inc
+++ b/ui.inc
@@ -13,8 +13,10 @@
;
; This file should be entered with the config file open (for getc)
;
+load_config_file:
call parse_config ; Parse configuration file
no_config_file:
+
;
; Check whether or not we are supposed to display the boot prompt.
;
@@ -277,6 +279,9 @@ vk_check:
%endif
xor bx,bx ; Try only one version
+ mov al, [VKernelBuf+vk_type]
+ mov [KernelType], al
+
%if IS_PXELINUX || IS_ISOLINUX
; Is this a "localboot" pseudo-kernel?
%if IS_PXELINUX
@@ -312,6 +317,9 @@ vk_check:
pop di
pop si
pop es
+
+ mov [KernelType], cl ; CL == 0 here
+
;
; Find the kernel on disk
;
@@ -489,9 +497,14 @@ kernel_good:
pop di
;
-; At this point, DX:AX contains the size of the kernel, and SI contains
-; the file handle/cluster pointer.
+; At this point, DX:AX contains the size of the kernel, SI contains
+; the file handle/cluster pointer, and ECX contains the extension (if any.)
;
+ movzx di,byte [KernelType]
+ add di,di
+ jmp [kerneltype_table+di]
+
+is_unknown_filetype:
or ecx,20202000h ; Force lower case (except dot)
cmp ecx,'.com'
@@ -516,6 +529,43 @@ kernel_good:
je is_bootsector
; Otherwise Linux kernel
+ jmp is_linux_kernel
+
+is_config_file:
+ call openfd
+ call reset_config
+ jmp load_config_file
+
+; This is an image type we can't deal with
+is_bad_image:
+ mov si,err_badimage
+ call cwritestr
+ jmp enter_command
+
+%if IS_SYSLINUX || IS_MDSLINUX
+ ; ok
+%else
+is_bss_sector equ is_bad_image
+%endif
+%if IS_ISOLINUX
+ ; ok
+%else
+is_disk_image equ is_bad_image
+%endif
+
+ section .data
+err_badimage db 'Invalid image type for this media type!', CR, LF, 0
+
+ align 2, db 0
+kerneltype_table:
+ dw is_unknown_filetype ; VK_KERNEL
+ dw is_linux_kernel ; VK_LINUX
+ dw is_bootsector ; VK_BOOT
+ dw is_bss_sector ; VK_BSS
+ dw is_disk_image ; VK_FDIMAGE
+ dw is_comboot_image ; VK_COMBOOT
+ dw is_com32_image ; VK_COM32
+ dw is_config_file ; VK_CONFIG
section .bss
alignb 4
@@ -525,5 +575,6 @@ KernelExtPtr resw 1 ; During search, final null pointer
CmdOptPtr resw 1 ; Pointer to first option on cmd line
KbdFlags resb 1 ; Check for keyboard escapes
FuncFlag resb 1 ; Escape sequences received from keyboard
+KernelType resb 1 ; Kernel type, from vkernel, if known
section .text
diff --git a/version b/version
index 04370598..a2b1f510 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-3.36
+3.40