[ipxe-devel] Entering String in menu-context possible?

Michael Brown mbrown at fensystems.co.uk
Fri Apr 12 12:58:33 UTC 2013


On Friday 12 Apr 2013 08:17:02 Andrew Bobulsky wrote:
> > Not directly, no.  However, you can use ANSI escape sequences to position
> > the cursor and set the foreground and background colours immediately
> > before issuing the "read" command.
> 
> So... Are we talking like a crude hack, or can we toss a metric ton of
> ANSI insanity at iPXE to (hopefully) land somewhere between a nice
> looking multi-entry custom config menu and a warez demo file?

iPXE uses the abstraction of an ANSI console for all console output.  The BIOS 
(and EFI) console layers implement support for a subset of ANSI escape 
sequences including cursor movement and colour control.  The serial console 
simply sends the raw ANSI output over the serial port and relies on the remote 
end's terminal software to display something appropriate.

Since iPXE uses ANSI sequences to generate the existing menu display, you're 
guaranteed to be able to produce something looking identical by using hand-
rolled ANSI sequences.  The script might not be pretty, but it will work.

What you can't (easily) do is recreate the horizontally scrollable edit boxes 
used by "config" and "login".  It would be viable to expose this functionality 
as a separate command, e.g. "edit".  It would be difficult to expose the various 
plausible ways of exiting an edit box (e.g. tab, up/down keys); you would 
probably be limited to either success (user pressed Enter) or failure (user 
pressed Ctrl-C or Escape).  Total cost would be (estimated) around 300 bytes, 
which is quite substantial.  Is it worth doing?

Michael



More information about the ipxe-devel mailing list