summaryrefslogtreecommitdiffstats
path: root/src/core
Commit message (Collapse)AuthorAgeFilesLines
...
* [settings] Clarify usage of the term "named setting"Michael Brown2013-07-181-10/+10
| | | | | | | | | | | | There are currently two conflicting usages of the term "named setting" within iPXE: one refers to predefined settings (such as show up in the "config" UI), the other refers to settings identified by a name (such as "net0.dhcp/ip"). Split these usages into the term "predefined setting" and "named setting" to avoid ambiguity. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "poweroff" commandMarin Hannache2013-07-151-0/+12
| | | | | | Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [base16] Ensure base16_encode() always terminates its result stringMichael Brown2013-07-151-0/+4
| | | | | | | | | | | | | base16_encode() will fail to generate a terminating NUL if the length of the raw data is zero, since the loop calling sprintf() will never execute. Fix by explicitly terminating the result with a NUL. Reported-by: Marin Hannache <git@mareo.fr> Debugged-by: Marin Hannache <git@mareo.fr> Tested-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Add FILE_LICENCE for core/errno.cMarin Hannache2013-07-141-0/+2
| | | | | Signed-off-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Add "version" builtin settingRobin Smidsrød2013-07-131-0/+22
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Make "netX" settings block function as a symbolic linkMichael Brown2013-07-131-23/+50
| | | | | | | | | | | | | | Add a facility for settings blocks to act as symbolic links to other settings blocks, and reimplement the "netX" virtual settings block using this facility. The primary advantage of this approach is that unscoped settings such as ${mac} and ${filename} will now reflect the settings obtained from the most recently opened network device: in most cases, this will mean the settings obtained from the most recent DHCP attempt. This should improve conformance to the principle of least astonishment. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Add "busdevfn" setting typeMichael Brown2013-07-121-0/+47
| | | | | | | Allow network device's "busloc" setting to be formatted as a PCI bus:dev.fn address using e.g. ${net0/busloc:busdevfn}. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Add "hexraw" setting typeMichael Brown2013-07-121-0/+35
| | | | | Originally-implemented-by: Jeppe Toustrup <ipxe@tenzer.dk> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Use hex_decode() to parse hex settingsMichael Brown2013-07-121-32/+29Star
| | | | | | | | | | Use hex_decode() to parse "hex" and "hexhyp" settings. Note that this parser is stricter than the old parser; it now requires exactly two hex digits for each byte. (The old parser was based upon strtoul() and so would allow leading whitespace and a leading plus or minus sign.) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [base16] Generalise base16_decode() to hex_decode()Michael Brown2013-07-122-24/+61
| | | | | | | Provide a generic hex_decode() routine which can be shared between the Base16 code and the "hex" and "hexhyp" settings parsers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Eliminate settings "tag magic"Michael Brown2013-05-012-35/+15Star
| | | | | | | Create an explicit concept of "settings scope" and eliminate the magic values used for numerical setting tags. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Expose build architecture and platform via settingsMichael Brown2013-04-061-15/+85
| | | | | | | | | | | | | | | Expose the build architecture (e.g. "i386" or "x86_64") via ${buildarch} and the firmware platform (e.g. "pcbios" or "efi") via ${platform}. These settings directly expose the ARCH and PLATFORM variables from the Makefile. Note that the build architecture reflects the architecture for which iPXE was compiled, not the architecture on which iPXE is currently running. The "cpuid" command can be used to detect a 64-bit system at runtime. Requested-by: James A. Peltier <jpeltier@sfu.ca> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add ability to perform a warm rebootMichael Brown2013-03-221-1/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Add "reboot" command for EFIMichael Brown2013-03-221-0/+42
| | | | | | | | | Abstract out the ability to reboot the system to a separate reboot() function (with platform-specific implementations), add an EFI implementation, and make the existing "reboot" command available under EFI. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Split main control flow out of main() into a new function ipxe()Michael Brown2013-03-131-82/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tls] Concatenate received non-data records before processingMichael Brown2013-01-311-0/+42
| | | | | | | | | Allow non-data records to be split across multiple received I/O buffers, to accommodate large certificate chains. Reported-by: Nicola Volpini <Nicola.Volpini@kambi.com> Tested-by: Nicola Volpini <Nicola.Volpini@kambi.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [umalloc] Split largest_memblock() function out from init_eheap()Michael Brown2012-11-061-0/+81
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [list] Reduce overall code size by externalising many list functionsMichael Brown2012-11-021-0/+84
| | | | | | Typical saving is 10-20 bytes in each file using list functions. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Include version number within only a single object fileMichael Brown2012-11-022-2/+44
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Add fetchf_named_setting_copy()Michael Brown2012-10-251-0/+39
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Avoid excess backspacing after displaying Ctrl-B promptMichael Brown2012-10-231-1/+3
| | | | | | | Remove the newline from the "Press Ctrl-B..." prompt string, so that prompt() does not attempt to backspace beyond the start of the line. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [nvo] Expose nvo_applies()Michael Brown2012-10-151-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [nvo] Expose non-volatile options block nameMichael Brown2012-10-151-1/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Treat an empty formatted value as meaning "delete setting"Michael Brown2012-10-151-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Expose find_child_settings()Michael Brown2012-10-151-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Add wcslen() functionMichael Brown2012-10-151-0/+43
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [serial] Don't enable serial console without serial supportShao Miller2012-10-052-4/+12
| | | | | | | | | | | serial_console_init() would enable serial console support without knowing if the serial driver succeeded or not. As a result, the serial console would interfere with a normal keyboard on a system lacking serial support. Reported-by: Jan ONDREJ (SAL) <ondrejj(at)salstar.sk> Signed-off-by: Shao Miller <sha0.miller@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Use a generic setting's own type as its default typeMichael Brown2012-09-101-5/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When fetching a named setting using a name that does not explicitly specify a type, default to using the type stored when the setting was created, rather than always defaulting to "string". This allows the behaviour of user-defined settings to match the behaviour of predefined settings (which have a sensible default type). For example: set server:ipv4 192.168.0.1 echo ${server} will now print "192.168.0.1", rather than trying to print out the raw IPv4 address bytes as a string. The downside of this change is that existing tricks for printing special characters within scripts may require (backwards-compatible) modification. For example, the "clear screen" sequence: set esc:hex 1b set cls ${esc}[2J echo ${cls} will now have to become set esc:hex 1b set cls ${esc:string}[2J # Must now explicitly specify ":string" echo ${cls} Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iobuf] Allow allocation of I/O buffers with a specified alignment offsetMichael Brown2012-08-311-15/+30
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [malloc] Allow allocation of memory with a specified alignment offsetMichael Brown2012-08-311-5/+7
| | | | | | | | Allow for allocation of memory blocks having a specified offset from a specified physical alignment, such as being 12 bytes before a 2kB boundary. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Sleep while waiting for user inputMichael Brown2012-07-241-0/+2
| | | | | | | | Reduce CPU usage while waiting for user input. This is particularly important for virtual machines, where CPU is a shared resource. Reported-by: Alessandro Salvatori <alessandro@embrane.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-2051-51/+102
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Add "--replace" optionMichael Brown2012-07-201-6/+10
| | | | | | | | | Expose image tail-recursion to iPXE scripts via the "--replace" option. This functions similarly to exec() under Unix: the currently-executing script is replaced with the new image (as opposed to running the new image as a subroutine). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Add "--autofree" optionMichael Brown2012-07-201-11/+21
| | | | | | | Allow images to be automatically freed after execution completes (successfully or otherwise). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Add support for "%lc" and "%ls" format specifiersMichael Brown2012-07-191-5/+31
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Expose exit status of failed command via ${errno}Michael Brown2012-07-121-0/+120
| | | | | | | | | | | | | | | Allow scripts to report errors in more detail by exposing the most recent error via the ${errno} setting. For example: chain ${filename} || goto failed ... :failed imgfree http://192.168.0.1/ipxe_error.php?error=${errno} Note that ${errno} is valid only immediately after executing a failed command. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Store exit status of failed command in errnoMichael Brown2012-07-121-6/+22
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [malloc] Increase heap size to 512kBMichael Brown2012-07-091-2/+2
| | | | | | | | The maximum TCP throughput is fundamentally limited by the amount of available receive buffer space. Increase the heap size from 128kB to 512kB to allow the use of larger TCP windows. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [malloc] Discard cached items less aggressivelyMichael Brown2012-07-091-3/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iobuf] Allocate I/O buffer descriptor separately to conserve aligned memoryMichael Brown2012-07-081-13/+53
| | | | | | | | | | | | | | | | | I/O buffers are allocated on aligned boundaries. The I/O buffer descriptor (the struct io_buffer) is currently attached to the end of the I/O buffer. When the size of the buffer is close to its alignment, this can waste large amounts of aligned memory. For example, a network card using 2048-byte receive buffers will end up allocating 2072 bytes on a 2048-byte boundary. This effectively wastes 50% of the available memory. Improve the situation by allocating the descriptor separately from the main I/O buffer if inline allocation would cause the total allocated size to cross the alignment boundary. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Do not ignore empty initial arguments in concat_args()Michael Brown2012-07-041-1/+1
| | | | | Reported-by: Oliver Rath <rath@mglug.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iobuf] Relax alignment requirement for small I/O buffersMichael Brown2012-06-291-5/+13
| | | | | | | | | | | | | iPXE currently aligns all I/O buffers on a 2kB boundary. This is overkill for transmitted packets, which are typically much smaller than 2kB. Align I/O buffers on their own size. This reduces the alignment requirement for small buffers, while preserving the guarantee that I/O buffers will never cross boundaries that might cause problems for some DMA engines. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [monojob] Check for keypresses only once per timer tickMichael Brown2012-06-281-11/+25
| | | | | | | | Checking for keypresses takes a non-negligible amount of time, and measurably affects our RTT. Minimise the impact by checking for keypresses only once per timer tick. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Move "domain" setting from dns.c to settings.cMichael Brown2012-06-201-0/+8
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pending] Add concept of "pending operations"Michael Brown2012-06-091-0/+79
| | | | | | | | | | iPXE is fundamentally asynchronous in operation: some operations continue in the background even after the foreground has continued to a new task. For example, the closing FIN/ACK exchanges of a TCP connection will take place in the background after an HTTP download has completed. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [monojob] Allow monojob to be completely silentMichael Brown2012-05-221-7/+11
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [base64] Avoid overrunning input data bufferMichael Brown2012-05-201-2/+7
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Avoid potential NULL pointer dereferenceMichael Brown2012-05-081-3/+5
| | | | | | Detected using Valgrind. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xferbuf] Add generic data-transfer bufferMichael Brown2012-05-081-0/+108
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [malloc] Allow Valgrind to be used when all assertions are enabledMichael Brown2012-05-041-11/+67
| | | | | | | | | | | | The free-memory-block traversal code triggers multiple warnings from Valgrind when assertions are enabled, since the list consistency checks performed by list_check() end up accessing areas that have been marked as inaccessible. Fix by ensuring that any memory areas that will be accessed by list_check() are marked as defined when necessary. Signed-off-by: Michael Brown <mcb30@ipxe.org>