aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-12-11 14:59:36 -0800
committerH. Peter Anvin <hpa@zytor.com>2008-12-14 13:53:58 -0800
commite21e66137b454fb3afd50a113de68599dd28de09 (patch)
tree807860047ee9e406888e49590aa5f13ce03b2a1c /core
parent36390f9712ac56be1dce7a635322bd96e15620c1 (diff)
downloadsyslinux-elf-e21e66137b454fb3afd50a113de68599dd28de09.tar.gz
syslinux-elf-e21e66137b454fb3afd50a113de68599dd28de09.tar.xz
syslinux-elf-e21e66137b454fb3afd50a113de68599dd28de09.zip
Add new "UI" directive instead of abusing the DEFAULT directive
Add a new "UI" directive to specify a user interface module, instead of abusing the DEFAULT directive. This allows the DEFAULT directive to be used for setting the default, even when the menu system is enabled. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'core')
-rw-r--r--core/keywords1
-rw-r--r--core/keywords.inc3
-rw-r--r--core/parseconfig.inc9
-rw-r--r--core/ui.inc8
4 files changed, 14 insertions, 7 deletions
diff --git a/core/keywords b/core/keywords
index 7cd9ace5..aeafb96d 100644
--- a/core/keywords
+++ b/core/keywords
@@ -5,6 +5,7 @@ append
initrd
config
default
+ui
display
font
implicit
diff --git a/core/keywords.inc b/core/keywords.inc
index f563b9d4..f2940e8a 100644
--- a/core/keywords.inc
+++ b/core/keywords.inc
@@ -50,7 +50,8 @@ keywd_table:
keyword include, pc_opencmd, pc_include
keyword append, pc_append
keyword initrd, pc_filename, InitRD
- keyword default, pc_default
+ keyword default, pc_default, 1
+ keyword ui, pc_default, 2
keyword display, pc_opencmd, get_msg_file
keyword font, pc_opencmd, loadfont
keyword implicit, pc_setint16, AllowImplicit
diff --git a/core/parseconfig.inc b/core/parseconfig.inc
index 55d6fbb0..2fb26fdd 100644
--- a/core/parseconfig.inc
+++ b/core/parseconfig.inc
@@ -18,12 +18,14 @@
section .text
;
-; "default" command
+; "default" or "ui" command, with level (1 = default, 2 = ui)
;
-pc_default: mov di,default_cmd
+pc_default: cmp ax,[DefaultLevel]
+ jb .skip
+ mov di,default_cmd
call getline
mov byte [di-1],0 ; null-terminate
- ret
+.skip: ret
;
; "ontimeout" command
@@ -467,6 +469,7 @@ NoComplete dw 0 ; No label completion on TAB key
AllowImplicit dw 1 ; Allow implicit kernels
AllowOptions dw 1 ; User-specified options allowed
IncludeLevel dw 1 ; Nesting level
+DefaultLevel dw 0 ; The current level of default
SerialPort dw 0 ; Serial port base (or 0 for no serial port)
VKernel db 0 ; Have we seen any "label" statements?
diff --git a/core/ui.inc b/core/ui.inc
index 4f5b1fdc..7f88cda0 100644
--- a/core/ui.inc
+++ b/core/ui.inc
@@ -48,10 +48,12 @@ no_config_file:
; Check whether or not we are supposed to display the boot prompt.
;
check_for_key:
- cmp word [ForcePrompt],0 ; Force prompt?
- jnz enter_command
test byte [KbdFlags],5Bh ; Shift Alt Caps Scroll
- jz auto_boot ; If neither, default boot
+ jnz enter_command
+ cmp word [ForcePrompt],0 ; Force prompt?
+ jz auto_boot
+ cmp word [DefaultLevel],1 ; Active UI statement?
+ ja auto_boot
enter_command:
cmp word [NoEscape],0 ; If NOESCAPE, no prompt,