summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-05-30 17:17:11 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-05-30 17:17:11 -0700
commit46f46957e0aba98f6943dfa7cf61334dd5b2b890 (patch)
tree047d1ecec8b8aa066d0c347fa136abf3e94e70b0
parentf2befae50aa9341c938637fa9708f8eac3e9eb3d (diff)
downloadsyslinux-46f46957e0aba98f6943dfa7cf61334dd5b2b890.tar.gz
Allow binding help text to F11 and F12.
Fix the odd anomaly that one can't bind help text to F11 and F12.
-rw-r--r--NEWS1
-rw-r--r--config.inc1
-rw-r--r--configinit.inc2
-rw-r--r--keywords.inc2
-rw-r--r--parsecmd.inc2
-rw-r--r--pxelinux.asm14
-rw-r--r--syslinux.doc15
-rw-r--r--ui.inc49
8 files changed, 49 insertions, 37 deletions
diff --git a/NEWS b/NEWS
index bd57c035..023c1b5b 100644
--- a/NEWS
+++ b/NEWS
@@ -29,6 +29,7 @@ Changes in 3.50:
* Instead of the (non-existent) MAC, use the client identifier
for networks like Infiniband and Firewire/1394.
* Add a new INCLUDE command to the core syslinux parser.
+ * Allow binding help text to F11 and F12.
Changes in 3.36:
* MEMDISK: Disable EDD by default on floppy disks. EDD can be
diff --git a/config.inc b/config.inc
index 32bb62c2..142848c5 100644
--- a/config.inc
+++ b/config.inc
@@ -23,6 +23,7 @@ max_cmd_len equ 511 ; Must be &3; 255 is the kernel limit
HIGHMEM_MAX equ 037FFFFFFh ; DEFAULT highest address for an initrd
DEFAULT_BAUD equ 9600 ; Default baud rate for serial port
BAUD_DIVISOR equ 115200 ; Serial port parameter
+MAX_FKEYS equ 12 ; Number of F-key help files
%assign DO_WBINVD 0 ; Should we use WBINVD or not?
diff --git a/configinit.inc b/configinit.inc
index 1f080c7b..6b5c5214 100644
--- a/configinit.inc
+++ b/configinit.inc
@@ -33,7 +33,7 @@ reset_config:
%if NULLFILE != 0
mov al,NULLFILE
mov di,FKeyName
- mov cx,10*(1 << FILENAME_MAX_LG2)
+ mov cx,MAX_FKEYS*(1 << FILENAME_MAX_LG2)
rep stosb
%endif
%endif
diff --git a/keywords.inc b/keywords.inc
index a97d3603..c703551b 100644
--- a/keywords.inc
+++ b/keywords.inc
@@ -85,6 +85,8 @@ keywd_table:
keyword f9, pc_fkey, FKeyN(9)
keyword f10, pc_fkey, FKeyN(10)
keyword f0, pc_fkey, FKeyN(10)
+ keyword f11, pc_fkey, FKeyN(11)
+ keyword f12, pc_fkey, FKeyN(12)
%if IS_PXELINUX
keyword ipappend, pc_ipappend
%endif
diff --git a/parsecmd.inc b/parsecmd.inc
index ea7d0fcf..e3e3734d 100644
--- a/parsecmd.inc
+++ b/parsecmd.inc
@@ -100,7 +100,7 @@ AppendBuf resb max_cmd_len+1 ; append=
Ontimeout resb max_cmd_len+1 ; ontimeout
Onerror resb max_cmd_len+1 ; onerror
KbdMap resb 256 ; Keyboard map
-FKeyName resb 10*FILENAME_MAX ; File names for F-key help
+FKeyName resb MAX_FKEYS*FILENAME_MAX ; File names for F-key help
KernelCNameLen resw 1 ; Length of unmangled kernel name
InitRDCNameLen resw 1 ; Length of unmangled initrd name
%if IS_SYSLINUX
diff --git a/pxelinux.asm b/pxelinux.asm
index e8995eb8..8056796b 100644
--- a/pxelinux.asm
+++ b/pxelinux.asm
@@ -308,18 +308,7 @@ _start1:
;
; Initialize screen (if we're using one)
;
- ; 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)
- push es ; Save ES -> PXE structure
- push ds ; ES <- DS
- pop es
- rep stosb
- pop es ; Restore ES
+%include "init.inc"
;
; Tell the user we got this far
@@ -699,7 +688,6 @@ udp_init:
;
; Common initialization code
;
-%include "init.inc"
%include "cpuinit.inc"
;
diff --git a/syslinux.doc b/syslinux.doc
index 626b9eeb..17370739 100644
--- a/syslinux.doc
+++ b/syslinux.doc
@@ -384,18 +384,19 @@ F1 filename
F2 filename
...etc...
F9 filename
-F0 filename
+F10 filename
+F11 filename
+F11 filename
Displays the indicated file on the screen when a function key is
pressed at the boot: prompt. This can be used to implement
pre-boot online help (presumably for the kernel command line
- options.) Note that F10 MUST be entered in the config file as
- "F0", not "F10", and that there is currently no way to bind
- file names to F11 and F12. Please see the section below on
- DISPLAY files.
+ options.) Please see the section below on DISPLAY files.
When using the serial console, press <Ctrl-F><digit> to get to
- the help screens, e.g. <Ctrl-F><2> to get to the F2 screen,
- and <Ctrl-F><0> for the F10 one.
+ the help screens, e.g. <Ctrl-F><2> to get to the F2 screen.
+ For F10-F12, hit <Ctrl-F><A>, <Ctrl-F>B, <Ctrl-F>C. For
+ compatiblity with earlier versions, F10 can also be entered as
+ <Ctrl-F>0.
Blank lines are ignored.
diff --git a/ui.inc b/ui.inc
index 97d361e1..bb340849 100644
--- a/ui.inc
+++ b/ui.inc
@@ -72,14 +72,8 @@ got_ascii: cmp al,7Fh ; <DEL> == <BS>
cmp di,command_line ; Space must not be first
je short get_char
enter_char: test byte [FuncFlag],1
- jz .not_ctrl_f
- mov byte [FuncFlag],0
- cmp al,'0'
- jb .not_ctrl_f
- je ctrl_f_0
- cmp al,'9'
- jbe ctrl_f
-.not_ctrl_f: cmp di,max_cmd_len+command_line ; Check there's space
+ je ctrl_f ; Keystroke after <Ctrl-F>
+ cmp di,max_cmd_len+command_line ; Check there's space
jnb short get_char
stosb ; Save it
call writechr ; Echo to screen
@@ -121,19 +115,44 @@ set_func_flag:
mov byte [FuncFlag],1
jmp short get_char_2
-ctrl_f_0: add al,10 ; <Ctrl-F>0 == F10
-ctrl_f: sub al,'1'
+ctrl_f:
xor ah,ah
- jmp short show_help
+ mov [FuncFlag],ah
+ cmp al,'0'
+ jb get_char_2
+ je .zero ; <Ctrl-F>0 = F10
+ or al,20h ; Lower case
+ cmp al,'9'
+ jna .digit
+ cmp al,'a' ; F10-F12 = <Ctrl-F>A, B, C
+ jb get_char_2
+ cmp al,'c'
+ ja get_char_2
+ sub al,'a'-10
+ jmp show_help
+.zero:
+ mov al,10
+ jmp show_help
+.digit:
+ sub al,'1'
+ jmp show_help
func_key:
; AL = 0 if we get here
xchg al,ah
cmp al,68 ; F10
- ja short get_char_2
+ ja .f11_f12
sub al,59 ; F1
- jb short get_char_2
-show_help: ; AX = func key # (0 = F1, 9 = F10)
+ jb get_char_2
+ jmp show_help
+.f11_f12:
+ cmp al,87 ; F11
+ jb get_char_2
+ cmp al,88 ; F12
+ ja get_char_2
+ sub al,87-10
+
+show_help: ; AX = func key # (0 = F1, 9 = F10, 11 = F12)
push di ; Save end-of-cmdline pointer
shl ax,FILENAME_MAX_LG2 ; Convert to pointer
add ax,FKeyName
@@ -174,7 +193,7 @@ fk_wrcmd:
mov si,command_line
call cwritestr ; Write command line so far
fk_nofile: pop di
- jmp short get_char_2
+ jmp get_char
;
; Show network info (in the form of the ipappend strings)