david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
Commit Graph

781 Commits

Author SHA1 Message Date
Michael Brown a17ee3610d [console] Fix display of characters with top bit set
Inhibit implicit sign-padding of characters with the top bit set
(e.g. accented characters), which confuses the mucurses library by
colliding with the bits used to store character attributes and
colours.

Reported-by: Marc Delisle <Marc.Delisle@cegepsherbrooke.qc.ca>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-03-13 14:21:59 +00:00
Michael Brown b850a6be28 [monojob] Reset timeout when progress is made
Redefine the timeout parameter from "time since start of job" to "time
since progress was last made".  This does not affect any existing
behaviour, since all existing users of the timeout parameter do not
provide progress indication.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-03-10 13:16:18 +00:00
Michael Brown c165e8d1fc [image] Ensure every image has a fully resolved URI
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-02-27 13:32:58 +00:00
Michael Brown 7667536527 [uri] Refactor URI parsing and formatting
Add support for parsing of URIs containing literal IPv6 addresses
(e.g. "http://[fe80::69ff:fe50:5845%25net0]/boot.ipxe").

Duplicate URIs by directly copying the relevant fields, rather than by
formatting and reparsing a URI string.  This relaxes the requirements
on the URI formatting code and allows it to focus on generating
human-readable URIs (e.g. by not escaping ':' characters within
literal IPv6 addresses).  As a side-effect, this allows relative URIs
containing parameter lists (e.g. "../boot.php##params") to function
as expected.

Add validity check for FTP paths to ensure that only printable
characters are accepted (since FTP is a human-readable line-based
protocol with no support for character escaping).

Construct TFTP next-server+filename URIs directly, rather than parsing
a constructed "tftp://..." string,

Add self-tests for URI functions.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-02-27 13:32:53 +00:00
Michael Brown c7b69ac793 [params] Use reference counters for form parameter lists
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-02-26 23:34:07 +00:00
Michael Brown 09b057ce84 [settings] Remove "uristring" setting type
Commit b5f5f73 ("[cmdline] Expand settings within each command-line
token individually") effectively rendered the "uristring" setting type
obsolete, since strings containing whitespace no longer break the
command line parser.  The concept of the "uristring" type is not well
defined, since URI escaping rules depend on which portion of a URI is
being escaped.

Remove the "uristring" type, converting it into an alias for the
"string" setting type so as to avoid breaking existing scripts.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-02-26 23:34:07 +00:00
Michael Brown 3ee2c4ac1c [fbcon] Allow ANSI CUP with missing arguments
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-22 22:43:55 +00:00
Michael Brown 608d6cac9e [fbcon] Allow for an arbitrary margin around the text area
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-22 14:26:31 +00:00
Michael Brown 7fc380e950 [fbcon] Centre background picture on console
Centre the background picture on the console, to give a more
consistent result when the aspect ratio does not match the requested
width and height.

Once drawn for the first time, nothing should ever overwrite the
margins of the display.  We can therefore eliminate the logic used to
redraw only the margin areas, and use much simpler code to draw the
complete initial background image.

Simplify the redrawing logic further by making the background picture
buffer equal in size to the frame buffer.  In the common case of a
background picture which is designed to fill the screen, this wastes
no extra memory, and the combined code simplifications reduce the size
of fbcon.o by approximately 15%.

Redefine the concept of "margin" to match the intuitive definition
(i.e. the size of the gap, rather than the position of the boundary
line).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-22 14:16:34 +00:00
Michael Brown a4e8ef72ab [libc] Add isprint()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-06 01:46:20 +01:00
Michael Brown f6dce77b15 [console] Add concept of a "magic" colour
The magic basic colour can be remapped at runtime from COLOR_NORMAL_BG
(usually blue) to COLOR_DEFAULT (which will be transparent as a
background colour on the framebuffer console).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-09 15:34:14 +00:00
Michael Brown 7025f5c648 [console] Add centralised concept of colours and colour pairs
Add a centralised concept of colours and colour pairs (using the
default colour pairs as configured via config/colour.h).  A colour
pair consists of a pair of colour indices.

Add the ability to redefine both a colour pair and an individual
colour index, with minimal overhead if this feature is not required
(e.g. because the relevant shell commands are not present in the
build).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-09 15:34:07 +00:00
Michael Brown 4c51f9602d [fbcon] Always draw cursor using current foreground and background colours
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-09 15:34:07 +00:00
Michael Brown 4d9f100240 [fbcon] Update the console width and height after changing mode
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-06 17:52:05 +00:00
Michael Brown 03401f9d21 [console] Allow consoles to update the recorded console size
Provide a mechanism for consoles to update the recorded console width
and height, and use this width and height to provide the curses COLS
and LINES variables.

We choose not to use ANSI escape sequences to obtain the width and
height, for two reasons:

- iPXE's model is that all output is sent to all consoles; we could
  therefore end up with multiple consoles reporting conflicting widths
  and heights

- when a serial console is in use, we probably don't want to resize
  the output shown on the BIOS console to match the size of the serial
  console, since it's likely that the serial console is in use only
  for debugging.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-06 17:47:54 +00:00
Michael Brown f3e5df3162 [settings] Merge SETTING_IPv4 and SETTING_IPv6
Allow for equivalent IPv4 and IPv6 settings (which requires equivalent
settings to be adjacent within the settings list).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 15:11:15 +00:00
Michael Brown eaa8615648 [settings] Allow for multiple definitions of each predefined setting
Allow for multiple setting definitions with the same name but
different scopes and tags.  For example, allow for a "filename"
setting with default scope and tag value 67 (for DHCPv4) and a
corresponding "filename" setting with IPv6 scope and tag value 59 (for
DHCPv6).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 12:43:28 +00:00
Michael Brown b0942534eb [settings] Force settings into alphabetical order within sections
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 12:43:28 +00:00
Michael Brown 60c4e62e5d [settings] Add fetch_ipv6_setting()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 00:41:49 +00:00
Michael Brown 17451b53e2 [settings] Allow for IPv6 setting types in non-IPv6 builds
Allow for the existence of references to IPv6 setting types without
dragging in the whole IPv6 stack, by placing the definition of
setting_type_ipv6 in core/settings.c and providing weak stub methods
for parse_ipv6_setting() and format_ipv6_setting().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 00:41:49 +00:00
Michael Brown 22001cb206 [settings] Explicitly separate the concept of a completed fetched setting
The fetch_setting() family of functions may currently modify the
definition of the specified setting (e.g. to add missing type
information).  Clean up this interface by requiring callers to provide
an explicit buffer to contain the completed definition of the fetched
setting, if required.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 00:37:02 +00:00
Michael Brown a2638a8edd [fbcon] Add support for displaying a cursor
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-02 17:27:37 +00:00
Michael Brown 135bf35b11 [console] Allow '?' as an intermediate byte in ANSI escape sequences
The ANSI escape sequences to show and hide the cursor take the form
"<ESC>[?25h" and "<ESC>[?25l" respectively.  iPXE currently treats the
'?' character as the final byte.  Fix by explicitly treating '?' as an
intermediate byte.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-02 17:20:36 +00:00
Michael Brown decf9dd133 [fbcon] Add generic concept of a frame buffer console
Add support for a simple frame buffer console, using single buffering
and a fixed-width bitmap font.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-28 05:55:45 +00:00
Michael Brown c501c980e0 [console] Add concept of generic console configuration
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-28 05:55:43 +00:00
Michael Brown b2251743d8 [console] Allow console input and output to be disabled independently
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-28 05:54:53 +00:00
Michael Brown 09f31e9fc4 [image] Add image_pixbuf() to create pixel buffer from image
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-27 11:27:50 +00:00
Michael Brown 2c161283d5 [image] Allow for non-executable image formats
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-27 11:27:50 +00:00
Michael Brown 95851d1305 [pixbuf] Add generic concept of a pixel buffer
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-27 11:27:50 +00:00
Michael Brown 02a63c6dec [console] Pass escape sequence context to ANSI escape sequence handlers
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-27 11:27:50 +00:00
Michael Brown 3102866a7f [main] Defer "initialising devices" message until initialising devices
Allow the "initialising devices" message to show up on consoles which
require initialisation, by deferring it until after initialise() has
completed.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-27 11:27:50 +00:00
Michael Brown 4484edd1c0 [settings] Move user-class setting from dhcp.c to settings.c
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-14 12:35:43 +00:00
Michael Brown 4f078801e9 [base16] Fix comparison of signed and unsigned integers
gcc 4.7.1 fails to report this erroneous comparison unless assertions
are enabled.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-14 12:35:43 +00:00
Michael Brown 43eba2f555 [cmdline] Generate command option help text automatically
Generate the command option help text automatically from the list of
defined options.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-07 17:00:51 +00:00
Michael Brown 3a67224c62 [parseopt] Add parse_netdev_configurator()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-05 17:30:20 +00:00
Michael Brown 92c56e129b [cmdline] Rewrite "sync" command to use monojob_wait()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-01 17:00:16 +00:00
Michael Brown dc7a023715 [monojob] Report ongoing job status as overall return status on timeout
If a job times out then use the most recent ongoing error status
reported via job_progress() (if available) as the overall return
status.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-01 16:26:08 +00:00
Michael Brown d1be9f4acc [monojob] Add timeout parameter to monojob_wait()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-01 16:26:02 +00:00
Michael Brown 5674a3c087 [job] Allow job_progress() to return an ongoing job status code, if known
Some background jobs have a meaningful ongoing status code (e.g. the
current link status for a job waiting for a network link to come up).
Allow this to be exposed via the job_progress() method.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-01 16:17:28 +00:00
Michael Brown a3346e3587 [interface] Default to calling intf_restart() in response to intf_close()
If an object interface does not provide an intf_close() method, then
default to calling intf_restart().  This allows static objects to
safely ignore intf_close(), without needing to add code solely to
ensure that the interface gets unplugged.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-01 16:17:28 +00:00
Michael Brown 5e1fa5cd40 [parseopt] Add parse_timeout()
Parsing a timeout value (specified in milliseconds) into an internal
timeout value measured in timer ticks is a common operation.  Provide
a parse_timeout() value to carry out this conversion automatically.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-11-01 02:26:19 +00:00
Michael Brown c597c7a071 [ping] Add generic ping mechanism
Add generic pinger mechanism (analogous to the generic downloader
mechanism) which opens a ping socket, transmits ping requests, and
passes information about ping replies to a callback function.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-10-21 15:08:18 +01:00
Michael Brown 12605efded [resolv] Use sock_aton() to allow parsing of arbitrary numeric addresses
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-10-21 14:34:13 +01:00
Michael Brown 3e975ecf3f [settings] Make built-in settings a linker table
Allow for configurable provision of built-in settings by placing them
in a linker table rather than an array.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-27 13:46:12 +01:00
Michael Brown e52380fa3b [uri] Allow URIs to incorporate a parameter list
HTTP POST requires the ability to associate a parameter list with a
URI.  There is no standardised syntax for this.  Use a non-standard
URI syntax to incorporate the specification of a parameter list within
a URI:

  URI = [ absoluteURI | relativeURI ]
	[ "#" fragment ] [ "##params" [ "=" paramsName ] ]

e.g.

  http://boot.ipxe.org/demo/boot.php##params
  http://boot.ipxe.org/demo/boot.php##params=mylist

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-19 17:22:58 +01:00
Michael Brown 564419c7e1 [params] Add support for the general concept of a form parameter list
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-19 17:22:52 +01:00
Michael Brown c692a690da [settings] Expose memory map via settings mechanism
Allow memory map entries to be read using the syntax

  ${memmap/<region>.<properties>.<scale>}

where <region> is the index of the memory region, <properties> is a
bitmask where bit 0 represents the start address and bit 1 represents
the length (allowing the end address to be encoded by having both bits
0 and 1 set), and <scale> is the number of bits by which to shift the
result.

This allows for several values of interest to be encoded.  For
example:

  ${memmap/<region>.1.0:hexraw}   # 64-bit start address of <region>
  ${memmap/<region>.2.0:hexraw}   # 64-bit length of <region>, in bytes
  ${memmap/<region>.3.0:hexraw}   # 64-bit end address of <region>
  ${memmap/<region>.2.10:int32}   # Length of <region>, in kB
  ${memmap/<region>.2.20:int32}   # Length of <region>, in MB

The numeric encoding is slightly more sophisticated than described
here, allowing a single encoding to cover multiple regions.  (See the
source code for details.)  The primary use case for this feature is to
provide the total system memory size (in MB) via the "memsize"
predefined setting.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-12 22:00:36 +01:00
Michael Brown 55daa953fb [settings] Allow numeric_setting_value() to handle long setting values
Allow numeric_setting_value() to handle e.g. the byte sequence

  00:00:00:00:12:34:56:78

by returning -ERANGE only if the value actually overflows the return
type.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-12 18:25:18 +01:00
Michael Brown c70d4cb1b3 [settings] Introduce the generalised concept of a numeric setting
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-01 14:39:58 +01:00
Michael Brown bd6c3a1886 [settings] Remove now-unused fetchf_named_setting() and storef_named_setting()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-07-22 16:39:32 +01:00