From: H. Peter Anvin Date: Wed, 10 Sep 2008 04:31:55 +0000 (-0700) Subject: Add Tab display of labels X-Git-Tag: syslinux-3.72-pre6^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b7d702fc7c3e6604e1f97aceaf66fd71d41b8856;p=platform%2Fupstream%2Fsyslinux.git Add Tab display of labels When the Tab key is pressed, display a list of matching labels. This can be disabled via the NOCOMPLETE configuration command. This is a slightly modified patch by Sebastian Herbszt. --- diff --git a/NEWS b/NEWS index 52e6717..5180be0 100644 --- a/NEWS +++ b/NEWS @@ -21,6 +21,9 @@ Changes in 3.72: * Remote gdb support for COM32 modules; patch from Stefan Hajnoczi. * Support beeps in F-key help in the simple menu system. + * Tab display of labels, based on a patch from Sebastian + Herbszt. Can be disabled with the NOCOMPLETE configuration + command. Changes in 3.71: * Workaround for a VESA BIOS which tries to make DOS system diff --git a/core/keywords b/core/keywords index 16fe772..7cd9ace 100644 --- a/core/keywords +++ b/core/keywords @@ -30,6 +30,7 @@ allowoptions ontimeout onerror noescape +nocomplete f0 f1 f2 diff --git a/core/keywords.inc b/core/keywords.inc index 973d15b..f563b9d 100644 --- a/core/keywords.inc +++ b/core/keywords.inc @@ -75,6 +75,7 @@ keywd_table: keyword onerror, pc_onerror keyword allowoptions, pc_setint16, AllowOptions keyword noescape, pc_setint16, NoEscape + keyword nocomplete, pc_setint16, NoComplete keyword f1, pc_filename, FKeyN(1) keyword f2, pc_filename, FKeyN(2) keyword f3, pc_filename, FKeyN(3) diff --git a/core/parseconfig.inc b/core/parseconfig.inc index 4a38c35..55d6fbb 100644 --- a/core/parseconfig.inc +++ b/core/parseconfig.inc @@ -463,6 +463,7 @@ OnerrorLen dw 0 ; Bytes in onerror command CmdLinePtr dw cmd_line_here ; Command line advancing pointer ForcePrompt dw 0 ; Force prompt NoEscape dw 0 ; No escape +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 diff --git a/core/ui.inc b/core/ui.inc index 26b6fa0..4f5b1fd 100644 --- a/core/ui.inc +++ b/core/ui.inc @@ -108,6 +108,8 @@ enter_char: test byte [FuncFlag],1 not_ascii: cmp al,0Dh ; Enter je command_done + cmp al,09h ; Tab + je display_labels cmp al,'F' & 1Fh ; je set_func_flag %if IS_PXELINUX @@ -142,6 +144,49 @@ set_func_flag: mov byte [FuncFlag],1 jmp short get_char_2 +display_labels: + cmp word [NoComplete],0 ; Label completion enabled? + jne get_char_2 + push di ; Save pointer + mov cx,di + sub cx,command_line + call crlf + mov esi,[HighMemSize] ; Start from top of memory +.scan: + cmp esi,[VKernelEnd] + jbe .not_vk + + push cx ; save command line size + + mov di,VKernelBuf + call rllunpack + ; ESI updated on return + + sub di,cx ; Return to beginning of buf + pop cx ; restore command line size + push si ; save SI + cmp cx,0 + jz .print + push di + push cx + mov si,command_line + es repe cmpsb + pop cx + pop di + jne .next +.print: + mov al,' ' + call writechr + + mov si,di + call writestr +.next: + pop si ; restore SI + jmp .scan +.not_vk: + call crlf + jmp fk_wrcmd + ctrl_f: xor ah,ah mov [FuncFlag],ah diff --git a/doc/syslinux.txt b/doc/syslinux.txt index 54be427..dd7608e 100644 --- a/doc/syslinux.txt +++ b/doc/syslinux.txt @@ -399,6 +399,10 @@ NOESCAPE flag_val Lock escapes. Use this (together with PROMPT 0) to force the default boot alternative. +NOCOMPLETE flag_val + If flag_val is set to 1, the Tab key does not display labels + at the boot: prompt. + F1 filename F2 filename ...etc...