summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhpa <hpa>2003-11-24 01:40:34 +0000
committerhpa <hpa>2003-11-24 01:40:34 +0000
commit4a10396ab1f114fc37fa8f276e047fe3c283671c (patch)
treefa9031da1b0469d079e87694482e845aa579fe28
parentae5f820de305d20adb9d47c0dd142167ad7ad270 (diff)
downloadsyslinux-4a10396ab1f114fc37fa8f276e047fe3c283671c.tar.gz
Add timeoutcmd command
-rw-r--r--NEWS4
-rw-r--r--isolinux.asm3
-rw-r--r--keywords1
-rw-r--r--keywords.inc1
-rw-r--r--ldlinux.asm2
-rw-r--r--parseconfig.inc9
-rw-r--r--pxelinux.asm8
-rw-r--r--syslinux.doc6
-rw-r--r--ui.inc8
9 files changed, 39 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 78d82174..fde4a479 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ 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 2.08:
+ * Add "timeoutcmd" to allow timeout to have a different action
+ than just pressing Enter.
+
Changes in 2.07:
* MEMDISK: Workaround for BIOSes which go into a snit when
they get a RESET command for the floppy system when there is
diff --git a/isolinux.asm b/isolinux.asm
index 4c24bd2c..51d9468e 100644
--- a/isolinux.asm
+++ b/isolinux.asm
@@ -126,6 +126,7 @@ dir_clust resd 1 ; Length in clusters
VKernelBuf: resb vk_size ; "Current" vkernel
alignb 4
AppendBuf resb max_cmd_len+1 ; append=
+TimeOutCmd resb max_cmd_len+1 ; timeoutcmd
KbdMap resb 256 ; Keyboard map
FKeyName resb 10*FILENAME_MAX ; File names for F-key help
NumBuf resb 15 ; Buffer to load number
@@ -1600,6 +1601,7 @@ img_table:
; Misc initialized (data) variables
;
AppendLen dw 0 ; Bytes in append= command
+TimeOutCmdLen dw 0 ; Bytes in timeoutcmd command
KbdTimeOut dw 0 ; Keyboard timeout (if any)
CmdLinePtr dw cmd_line_here ; Command line advancing pointer
initrd_flag equ $
@@ -1608,7 +1610,6 @@ VKernelCtr dw 0 ; Number of registered vkernels
ForcePrompt dw 0 ; Force prompt
AllowImplicit dw 1 ; Allow implicit kernels
SerialPort dw 0 ; Serial port base (or 0 for no serial port)
-NextSocket dw 49152 ; Counter for allocating socket numbers
VGAFontSize dw 16 ; Defaults to 16 byte font
UserFont db 0 ; Using a user-specified font
ScrollAttribute db 07h ; White on black (for text mode)
diff --git a/keywords b/keywords
index f8e8c8eb..4a4f71f8 100644
--- a/keywords
+++ b/keywords
@@ -13,6 +13,7 @@ prompt
say
serial
timeout
+timeoutcmd
f0
f1
f2
diff --git a/keywords.inc b/keywords.inc
index b1dacfdc..b7c18ebc 100644
--- a/keywords.inc
+++ b/keywords.inc
@@ -57,6 +57,7 @@ keywd_table:
keyword say, pc_say
keyword serial, pc_serial
keyword timeout, pc_timeout
+ keyword timeoutcmd, pc_timeoutcmd
keyword f1, pc_fkey, FKeyName+(0<<FILENAME_MAX_LG2)
keyword f2, pc_fkey, FKeyName+(1<<FILENAME_MAX_LG2)
keyword f3, pc_fkey, FKeyName+(2<<FILENAME_MAX_LG2)
diff --git a/ldlinux.asm b/ldlinux.asm
index 545c1327..c8faa60f 100644
--- a/ldlinux.asm
+++ b/ldlinux.asm
@@ -116,6 +116,7 @@ xbs_vgatmpbuf equ 2*trackbufsize
VKernelBuf: resb vk_size ; "Current" vkernel
alignb 4
AppendBuf resb max_cmd_len+1 ; append=
+TimeOutCmd resb max_cmd_len+1 ; timeoutcmd
KbdMap resb 256 ; Keyboard map
FKeyName resb 10*16 ; File names for F-key help
NumBuf resb 15 ; Buffer to load number
@@ -1422,6 +1423,7 @@ exten_table_end:
debug_magic dw 0D00Dh ; Debug code sentinel
%endif
AppendLen dw 0 ; Bytes in append= command
+TimeOutCmdLen dw 0 ; Bytes in timeoutcmd command
KbdTimeOut dw 0 ; Keyboard timeout (if any)
CmdLinePtr dw cmd_line_here ; Command line advancing pointer
initrd_flag equ $
diff --git a/parseconfig.inc b/parseconfig.inc
index 3235a9c2..937d22f2 100644
--- a/parseconfig.inc
+++ b/parseconfig.inc
@@ -27,6 +27,15 @@ pc_default: mov di,default_cmd
ret
;
+; "timeoutcmd" command
+;
+pc_timeoutcmd: mov di,TimeOutCmd
+ call getline
+ sub di,TimeOutCmd
+ mov [TimeOutCmdLen],di
+ ret
+
+;
; "append" command
;
pc_append: cmp word [VKernelCtr],byte 0
diff --git a/pxelinux.asm b/pxelinux.asm
index fdc57809..b8aa92db 100644
--- a/pxelinux.asm
+++ b/pxelinux.asm
@@ -198,6 +198,7 @@ xbs_vgatmpbuf equ 2*trackbufsize
VKernelBuf: resb vk_size ; "Current" vkernel
alignb 4
AppendBuf resb max_cmd_len+1 ; append=
+TimeOutCmd resb max_cmd_len+1 ; timeoutcmd
KbdMap resb 256 ; Keyboard map
BootFile resb 256 ; Boot file from DHCP packet
PathPrefix resb 256 ; Path prefix derived from the above
@@ -2460,6 +2461,7 @@ pxe_udp_read_pkt:
BaseStack dd StackBuf ; SS:ESP of base stack
dw 0
AppendLen dw 0 ; Bytes in append= command
+TimeOutCmdLen dw 0 ; Bytes in timeoutcmd command
KbdTimeOut dw 0 ; Keyboard timeout (if any)
CmdLinePtr dw cmd_line_here ; Command line advancing pointer
initrd_flag equ $
@@ -2468,10 +2470,14 @@ VKernelCtr dw 0 ; Number of registered vkernels
ForcePrompt dw 0 ; Force prompt
AllowImplicit dw 1 ; Allow implicit kernels
SerialPort dw 0 ; Serial port base (or 0 for no serial port)
-NextSocket dw 49152 ; Counter for allocating socket numbers
VGAFontSize dw 16 ; Defaults to 16 byte font
UserFont db 0 ; Using a user-specified font
ScrollAttribute db 07h ; White on black (for text mode)
+
+;
+; PXELINUX-specific variables
+;
+NextSocket dw 49152 ; Counter for allocating socket numbers
KeepPXE db 0 ; Should PXE be kept around?
;
diff --git a/syslinux.doc b/syslinux.doc
index e217812d..765924d0 100644
--- a/syslinux.doc
+++ b/syslinux.doc
@@ -222,6 +222,12 @@ TIMEOUT timeout
NOTE: The maximum possible timeout value is 35996; corresponding to
just below one hour.
+TIMEOUTCMD kernel options...
+ Sets the command line invoked on a timeout. Normally this is
+ the same thing as invoked by "DEFAULT". If this is specified,
+ then "DEFAULT" is used only if the user presses <Enter> to
+ boot.
+
SERIAL port [[baudrate] flowcontrol]
Enables a serial port to act as the console. "port" is a
number (0 = /dev/ttyS0 = COM1, etc.) or an I/O port address
diff --git a/ui.inc b/ui.inc
index e3563e7f..a43af407 100644
--- a/ui.inc
+++ b/ui.inc
@@ -60,8 +60,14 @@ tick_loop: push dx
je tick_loop
pop cx
loop time_loop ; If so, decrement counter
+
+ ; Timeout!!!!
call vgahidecursor
- jmp command_done ; Timeout!
+ mov si,TimeOutCmd ; Copy timeoutcommand if we have one...
+ mov cx,TimeOutCmdLen
+ rep movsb
+.stddefault:
+ jmp command_done
get_char_pop: pop eax ; Clear stack
get_char: