aboutsummaryrefslogtreecommitdiffstats
path: root/src/core
Commit message (Collapse)AuthorAgeFilesLines
...
* [console] Add concept of a "magic" colourMichael Brown2013-12-091-4/+34
| | | | | | | | 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>
* [console] Add centralised concept of colours and colour pairsMichael Brown2013-12-092-0/+283
| | | | | | | | | | | | | 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>
* [fbcon] Always draw cursor using current foreground and background coloursMichael Brown2013-12-091-5/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [fbcon] Update the console width and height after changing modeMichael Brown2013-12-061-0/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Allow consoles to update the recorded console sizeMichael Brown2013-12-061-0/+9
| | | | | | | | | | | | | | | | | | | | 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>
* [settings] Merge SETTING_IPv4 and SETTING_IPv6Michael Brown2013-12-051-1/+1
| | | | | | | 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>
* [settings] Allow for multiple definitions of each predefined settingMichael Brown2013-12-051-4/+30
| | | | | | | | | | 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>
* [settings] Force settings into alphabetical order within sectionsMichael Brown2013-12-052-21/+20
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Add fetch_ipv6_setting()Michael Brown2013-12-051-0/+38
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Allow for IPv6 setting types in non-IPv6 buildsMichael Brown2013-12-051-24/+55
| | | | | | | | | 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>
* [settings] Explicitly separate the concept of a completed fetched settingMichael Brown2013-12-053-192/+258
| | | | | | | | | | 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>
* [fbcon] Add support for displaying a cursorMichael Brown2013-12-021-25/+95
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Allow '?' as an intermediate byte in ANSI escape sequencesMichael Brown2013-12-021-1/+2
| | | | | | | | | 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>
* [fbcon] Add generic concept of a frame buffer consoleMichael Brown2013-11-281-0/+732
| | | | | | | 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>
* [console] Add concept of generic console configurationMichael Brown2013-11-282-0/+36
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Allow console input and output to be disabled independentlyMichael Brown2013-11-282-25/+13
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Add image_pixbuf() to create pixel buffer from imageMichael Brown2013-11-271-0/+26
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Allow for non-executable image formatsMichael Brown2013-11-271-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pixbuf] Add generic concept of a pixel bufferMichael Brown2013-11-271-0/+75
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Pass escape sequence context to ANSI escape sequence handlersMichael Brown2013-11-271-4/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [main] Defer "initialising devices" message until initialising devicesMichael Brown2013-11-271-1/+3
| | | | | | | | 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>
* [settings] Move user-class setting from dhcp.c to settings.cMichael Brown2013-11-141-0/+8
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [base16] Fix comparison of signed and unsigned integersMichael Brown2013-11-141-1/+1
| | | | | | | gcc 4.7.1 fails to report this erroneous comparison unless assertions are enabled. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Generate command option help text automaticallyMichael Brown2013-11-072-3/+20
| | | | | | | Generate the command option help text automatically from the list of defined options. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Add parse_netdev_configurator()Michael Brown2013-11-051-0/+23
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Rewrite "sync" command to use monojob_wait()Michael Brown2013-11-011-19/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [monojob] Report ongoing job status as overall return status on timeoutMichael Brown2013-11-011-2/+5
| | | | | | | | 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>
* [monojob] Add timeout parameter to monojob_wait()Michael Brown2013-11-011-10/+18
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [job] Allow job_progress() to return an ongoing job status code, if knownMichael Brown2013-11-012-6/+17
| | | | | | | | 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>
* [interface] Default to calling intf_restart() in response to intf_close()Michael Brown2013-11-011-2/+19
| | | | | | | | | 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>
* [parseopt] Add parse_timeout()Michael Brown2013-11-011-0/+22
| | | | | | | | 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>
* [ping] Add generic ping mechanismMichael Brown2013-10-211-0/+303
| | | | | | | | 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>
* [resolv] Use sock_aton() to allow parsing of arbitrary numeric addressesMichael Brown2013-10-211-13/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Make built-in settings a linker tableMichael Brown2013-08-271-46/+46
| | | | | | | 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>
* [uri] Allow URIs to incorporate a parameter listMichael Brown2013-08-191-1/+30
| | | | | | | | | | | | | | | | | 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>
* [params] Add support for the general concept of a form parameter listMichael Brown2013-08-192-0/+189
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Expose memory map via settings mechanismMichael Brown2013-08-121-0/+242
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [settings] Allow numeric_setting_value() to handle long setting valuesMichael Brown2013-08-121-4/+4
| | | | | | | | | | | 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>
* [settings] Introduce the generalised concept of a numeric settingMichael Brown2013-08-011-175/+412
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Remove now-unused fetchf_named_setting() and storef_named_setting()Michael Brown2013-07-221-114/+0
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Add parse_setting()Michael Brown2013-07-221-0/+55
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Move parse_settings() to parseopt.cMichael Brown2013-07-221-0/+23
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Allow parsed option to be modifiedMichael Brown2013-07-221-7/+7
| | | | | | | Parsing a setting name requires the ability to modify the text being parsed. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Remove now-unused store_named_setting()Michael Brown2013-07-191-35/+0
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Eliminate call to fetchf_named_setting() in expand_settings()Michael Brown2013-07-191-22/+25
| | | | | | | | | | Use parse_setting_name() and fetchf_setting_copy() in expand_settings(), to eliminate the call to fetchf_named_setting(). This change also eliminates the potentially large stack-allocated buffer in expand_settings(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Add fetchf_setting_copy()Michael Brown2013-07-191-2/+39
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Change "not-found" semantics of fetch_setting_copy()Michael Brown2013-07-191-14/+2
| | | | | | | | | | | | | | | | | | | | | | | | | fetch_settings_copy() currently returns success and a NULL data pointer to indicate a non-existent setting. This is intended to allow the caller to differentiate between a non-existent setting and an error in allocating memory for the copy of the setting. The underlying settings blocks' fetch() methods provide no way to perform an existence check separate from an attempt to fetch the setting. A "non-existent setting" therefore means simply a setting for which an error was encountered when attempting to fetch from every settings block within the subtree. Since any underlying error within a settings block (e.g. a GuestRPC failure when attempting to retrieve a VMware GuestInfo setting) will produce the effect of a "non-existent setting", it seems somewhat meaningless to give special treatment to memory allocation errors within fetch_setting_copy(). Remove the special treatment and simplify the semantics of fetch_setting_copy() by directly passing through any underlying error (including non-existence) encountered while fetching the setting. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Expose parse_setting_name()Michael Brown2013-07-191-11/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Remove default_type parameter from parse_setting_name()Michael Brown2013-07-191-9/+20
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Remove temporary name buffer parameter from parse_setting_name()Michael Brown2013-07-181-22/+40
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>