PXELINUX: Add <Ctrl-N> to print the network information syslinux-3.50-pre8
authorH. Peter Anvin <hpa@zytor.com>
Thu, 10 May 2007 01:31:23 +0000 (18:31 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Thu, 10 May 2007 01:31:23 +0000 (18:31 -0700)
Pressing <Ctrl-N> at the boot prompt will output the ipappend strings.

NEWS
ui.inc

diff --git a/NEWS b/NEWS
index 16520ff..2daecea 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,8 @@ Changes in 3.50:
          65535*sectors.
        * vesamenu: fix decoding of palettized PNG images.
        * Update the Linux kernel boot protocol.
+       * PXELINUX: Press Ctrl-N at the boot prompt to read out the
+         network info.
 
 Changes in 3.36:
        * MEMDISK: Disable EDD by default on floppy disks.  EDD can be
diff --git a/ui.inc b/ui.inc
index 400c2d6..f8f95fd 100644 (file)
--- a/ui.inc
+++ b/ui.inc
@@ -89,6 +89,10 @@ not_ascii:   mov byte [FuncFlag],0
                je command_done
                cmp al,'F' & 1Fh                ; <Ctrl-F>
                je set_func_flag
+%if IS_PXELINUX
+               cmp al,'N' & 1Fh                ; <Ctrl-N>
+               je show_network_info
+%endif
                cmp al,'U' & 1Fh                ; <Ctrl-U>
                je kill_command                 ; Kill input line
                cmp al,'V' & 1Fh                ; <Ctrl-V>
@@ -102,7 +106,8 @@ backspace:  cmp di,command_line             ; Make sure there is anything
                dec di                          ; Unstore one character
                mov si,wipe_char                ; and erase it from the screen
                call cwritestr
-               jmp short get_char_2
+get_char_2:
+               jmp short get_char
 
 kill_command:
                call crlf
@@ -114,8 +119,7 @@ force_text_mode:
 
 set_func_flag:
                mov byte [FuncFlag],1
-get_char_2:
-               jmp short get_char
+               jmp short get_char_2
 
 ctrl_f_0:      add al,10                       ; <Ctrl-F>0 == F10
 ctrl_f:                sub al,'1'
@@ -173,6 +177,24 @@ fk_nofile: pop di
                jmp short get_char_2
 
 ;
+; Show network info (in the form of the ipappend strings)
+;
+%if IS_PXELINUX
+show_network_info:
+               mov si,IPAppends                ; See comboot.doc
+               mov cx,numIPAppends
+.loop:
+               lodsw
+               push si
+               mov si,ax
+               call cwritestr
+               call crlf
+               pop si
+               loop .loop
+               jmp fk_wrcmd
+%endif
+
+;
 ; Jump here to run the default command line
 ;
 auto_boot: