summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-02106-114/+302
| | | | | | | | | | These files cannot be automatically relicensed by util/relicense.pl since they either contain unusual but trivial contributions (such as the addition of __nonnull function attributes), or contain lines dating back to the initial git revision (and so require manual knowledge of the code's origin). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-0226-26/+94
| | | | | | | | | | | | | | | Relicence files with kind permission from the following contributors: Alex Williamson <alex.williamson@redhat.com> Eduardo Habkost <ehabkost@redhat.com> Greg Jednaszewski <jednaszewski@gmail.com> H. Peter Anvin <hpa@zytor.com> Marin Hannache <git@mareo.fr> Robin Smidsrød <robin@smidsrod.no> Shao Miller <sha0.miller@gmail.com> Thomas Horsten <thomas@horsten.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-0215-15/+15
| | | | | | | Relicense files authored by Dan Lynch while working as an employee of Fen Systems Ltd., with permission from Fen Systems Ltd. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-02627-627/+1871
| | | | | | | Relicense files for which I am the sole author (as identified by util/relicense.pl). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Add UBDL relicensing toolMichael Brown2015-03-021-0/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | The UBDL relicensing tool (util/relicense.pl) is designed to identify files which may be relicensed under a dual GPL+UBDL licence. It uses git-blame to identify the author of each line (using the -M and -C options to track lines moved or copied between files), and relicenses files for which all authors have given permission. The relicensing tool will ignore certain types of lines identified by git-blame: - empty lines - comments - standalone opening or closing braces - "#include ..." - "return 0;" - "return rc;" - "PCI_ROM(...)" - "FILE_LICENCE(...)" These lines either contain no meaningful content (e.g. empty lines), contain only non-copyrightable facts (e.g. PCI ROM IDs) or are sufficiently common within the codebase that git-blame is likely to misattribute their origin (e.g. "return 0"). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Add support for the Unmodified Binary Distribution LicenceMichael Brown2015-03-023-0/+83
| | | | | | | | | | | | | | | Add the text for the Unmodified Binary Distribution Licence. This Licence allows for the distribution of unmodified binaries built from publicly available source code, without imposing the obligations of the GNU General Public License upon anyone who chooses to distribute only the unmodified binaries built from that source code. See the licence text for the precise terms and conditions. Add the licence GPL2_OR_LATER_OR_UBDL to the set of licences which can be declared using FILE_LICENCE(), and add the corresponding support to licence.pl. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [mucurses] Add missing FILE_LICENCE declarationsMichael Brown2015-03-026-0/+12
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Include full licence text for all GPL2_OR_LATER filesMichael Brown2015-02-2617-35/+205
| | | | | | | | Add the standard warranty disclaimer and Free Software Foundation address paragraphs to the licence text where these are not currently present. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update GPLv2 licence textMichael Brown2015-02-263-348/+348
| | | | | | | | | | | | Update the GPLv2 licence text to the current version (with the current address of the Free Software Foundation, and without the Y2k compatibility issue). Rename the GPLv2 licence text to COPYING.GPLv2 (to hopefully make it clearer that the licence does not apply to all files within the source tree) and rename COPYRIGHTS to COPYING. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [zbin] Remove now-unused unnrv2b.S decompressorMichael Brown2015-02-262-193/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vbox] Enable some more features now that we have LZMA compressionRobin Smidsrød2015-02-261-8/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [zbin] Fix check for existence of most recent output byteMichael Brown2015-02-261-3/+1Star
| | | | | | | | | | | | | | | | | | | The code in lzma_literal() checks to see if we are at the start of the compressed input data in order to determine whether or not a most recent output byte exists. This check is incorrect, since initialisation of the decompressor will always consume the first five bytes of the compressed input data. Fix by instead checking whether or not we are at the start of the output data stream. This is, in any case, a more logical check. This issue was masked during development and testing since virtual machines tend to zero the initial contents of RAM; the spuriously-read "most recent output byte" is therefore likely to already be a zero when running in a virtual machine. Reported-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [zbin] Allow decompressor to generate debug output via BIOS consoleMichael Brown2015-02-261-19/+50
| | | | | | | | | | | | The 0xe9 debug port exists only on virtual machines. Provide an option to print debug output on the BIOS console, to allow for debugging on real hardware. Note that this option can be used only if the decompressor is called in flat real mode; the easiest way to achieve this is to build with DEBUG=libprefix. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Call decompressor in flat real mode when DEBUG=libprefix is enabledMichael Brown2015-02-261-0/+16
| | | | | | | | Allow the decompressor the option of generating debugging output via the BIOS console by calling it in flat real mode (rather than 16-bit protected mode) when libprefix.S is built with debugging enabled. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [zbin] Perform extra normalisation after completing decompressionMichael Brown2015-02-261-0/+1
| | | | | | | | | | | LZMA performs an extra normalisation after decompression is complete, which does not affect the output but may consume an extra byte from the input (and so may affect which byte is identified as being the start of the next block). Reported-by: Robin Smidsrød <robin@smidsrod.no> Tested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Extract timing parameters out to config/dhcp.hAlex Williamson2015-02-253-23/+106
| | | | | | | | | | | | | | iPXE uses DHCP timeouts loosely based on values recommended by the specification, but often abbreviated to reduce timeouts for reliable and/or simple network topologies. Extract the DHCP timing parameters to config/dhcp.h and document them. The resulting default iPXE behavior is exactly the same, but downstreams are now afforded the opportunity to implement spec-compliant behavior via config file overrides. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [zbin] Use LZMA compressionMichael Brown2015-02-254-17/+1004
| | | | | | | | | | | | | | | | | | | | | | | | | | LZMA provides significantly better compression (by ~15%) than the current NRV2B algorithm. We use a raw LZMA stream (aka LZMA1) to avoid the need for code to parse the LZMA2 block headers. We use parameters {lc=2,lp=0,pb=0} to reduce the stack space required by the decompressor to acceptable levels (around 8kB). Using lc=3 or pb=2 would give marginally better compression, but at the cost of substantially increasing the required stack space. The build process now requires the liblzma headers to be present on the build system, since we do not include a copy of an LZMA compressor within the iPXE source tree. The decompressor is written from scratch (based on XZ Embedded) and is entirely self-contained within the iPXE source. The branch-call-jump (BCJ) filter used to improve the compressibility is specific to iPXE. We choose not to use liblzma's built-in BCJ filter since the algorithm is complex and undocumented. Our BCJ filter achieves approximately the same results (on typical iPXE binaries) with a substantially simpler algorithm. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Use .bss16 as temporary stack space for calls to install_blockMichael Brown2015-02-242-11/+46
| | | | | | | | | | | | Some decompression algorithms (e.g. LZMA) require large amounts of temporary stack space, which may not be made available by all prefixes. Use .bss16 as a temporary stack for the duration of the calls to install_block (switching back to the external stack before we start making calls into code which might access variables in .bss16), and allow the decompressor to define a global symbol to force a minimum value on the size of .bss16. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hyperv] Check for required featuresMichael Brown2015-02-202-0/+41
| | | | | | | | | | | Other hypervisors (e.g. KVM) may provide an unusable subset of the Hyper-V features, and our attempts to use these non-existent features cause the guest to reboot. Fix by explicitly checking for the Hyper-V features that we use. Reported-by: Ján ONDREJ (SAL) <ondrejj@salstar.sk> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Rewrite strtoul()Michael Brown2015-02-197-151/+199
| | | | | | | | | | The implementation of strtoul() has a partially unknown provenance. Rewrite this code to avoid potential licensing uncertainty. Since we now use -ffunction-sections, there is no need to place strtoull() in a separate file from strtoul(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv4] Rewrite inet_aton()Michael Brown2015-02-193-28/+39
| | | | | | | | | | The implementation of inet_aton() has an unknown provenance. Rewrite this code to avoid potential licensing uncertainty. Also move the code from core/misc.c to its logical home in net/ipv4.c, and add a few extra test cases. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Add missing copyright header to net/ipv4.cMichael Brown2015-02-181-0/+20
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add IPv4 self-testsMichael Brown2015-02-182-0/+148
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xhci] Abort commands on timeoutMichael Brown2015-02-182-15/+82
| | | | | | | | | | | | When a command times out, abort it (via the Command Abort bit in the Command Ring Control Register) so that subsequent commands may execute as expected. This improves robustness when a device fails to respond to the Set Address command, since the subsequent Disable Slot command will now succeed. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xhci] Leak memory if controller fails to disable slotMichael Brown2015-02-181-3/+18
| | | | | | | | | | | | | | | | If the Disable Slot command fails then the hardware may continue to write to the slot context. Leak the memory used by the slot context to avoid future memory corruption. This situation has been observed in practice when a Set Address command fails, causing the command ring to become temporarily unresponsive. Note that there is no need to similarly leak memory on the failure path in xhci_device_open(), since in the event of a failure the hardware is never informed of the slot context address. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [timer] Rewrite the 8254 Programmable Interval Timer supportMichael Brown2015-02-176-107/+153
| | | | | | | | The 8254 timer code (used to implement udelay()) has an unknown provenance. Rewrite this code to avoid potential licensing uncertainty. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ncm] Use generic USB network device frameworkMichael Brown2015-02-172-235/+58Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ecm] Use generic USB network device frameworkMichael Brown2015-02-172-211/+35Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Add generic USB network device frameworkMichael Brown2015-02-173-0/+343
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Reduce size of memset()Michael Brown2015-02-171-1/+127
| | | | | | | | | As with memcpy(), we can reduce the code size (by an average of 0.2%) by giving the compiler more visibility into what memset() is doing, and by avoiding the "rep" prefix on short fixed-length sequences of string operations. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add constant-length memset() self-testsMichael Brown2015-02-172-0/+154
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [test] Add self-tests for more string functionsMichael Brown2015-02-171-0/+88
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Rewrite string functionsMichael Brown2015-02-176-403/+371Star
| | | | | | | | | | | | Some of the C library string functions have an unknown provenance. Reimplement all such functions to avoid potential licensing uncertainty. Remove the inline-assembler versions of strlen(), memswap(), and strncmp(); these save a minimal amount of space (around 40 bytes in total) and are not performance-critical. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Remove unused string functionsMichael Brown2015-02-162-194/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ncm] Use generic refill framework for bulk IN and interrupt endpointsMichael Brown2015-02-162-252/+92Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ecm] Use generic refill framework for bulk IN and interrupt endpointsMichael Brown2015-02-132-133/+40Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Use generic refill framework for USB hub interrupt endpointsMichael Brown2015-02-132-51/+7Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Provide generic framework for refilling receive endpointsMichael Brown2015-02-132-0/+168
| | | | | | | Provide a generic framework for allocating, refilling, and optionally recycling I/O buffers used by bulk IN and interrupt endpoints. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Apply the "-fno-PIE -nopie" workaround only to i386 buildsMichael Brown2015-02-122-11/+11
| | | | | | | | | | | | | | | | | | | | Hardened versions of gcc default to building position-independent code, which breaks our i386 build. Our build process therefore detects such platforms and automatically adds "-fno-PIE -nopie" to the gcc command line. On x86_64, we choose to build position-independent code (in order to reduce the final binary size and, in particular, the number of relocations required for UEFI binaries). The workaround therefore breaks the build process for x86_64 binaries on such platforms. Fix by moving the workaround to the i386-specific portion of the Makefile. Reported-by: Jan Kundrát <jkt@kde.org> Debugged-by: Jan Kundrát <jkt@kde.org> Debugged-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Disallow R_X86_64_32 relocationsMichael Brown2015-02-121-2/+1Star
| | | | | | | | | | | | | | | | | UEFI binaries may be relocated to any location within the 64-bit address space. We compile as position-independent code with hidden visibility, which should force all relocation records to be either PC-relative (in which case no PE relocations are required) or full 64-bit relocations. There should be no R_X86_64_32 relocation records, since that would imply an invalid assumption that code could not be relocated above 4GB. Remove support for R_X86_64_32 relocation records from util/elf2efi.c, so that any such records result in a build failure rather than a potential runtime failure. Reported-by: Jan Kundrát <jkt@kde.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Sort objects in blib.aOlaf Hering2015-02-121-1/+1
| | | | | | | | | | | | | When building hvmloader for Xen tools the iPXE objects are also linked into the binary. Unfortunately the linker will place them in the order found in the archive. Since this order is random the resulting hvmloader binary differs when it was built from identical sources but on different build hosts. To help with creating a reproducible binary the elements in blib.a must simply be sorted before passing them to $(AR). Signed-off-by: Olaf Hering <olaf@aepfle.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [usb] Handle port status changes received after failing to find a driverMichael Brown2015-02-122-6/+20
| | | | | | | | | | | | | | | | | | | | | Commit a60f2dd ("[usb] Try multiple USB device configurations") changed the behaviour of register_usb() such that if no drivers are found then the device will be closed and the memory used will be freed. If a port status change subsequently occurs while the device is still physically attached, then usb_hotplug() will see this as a new device having been attached, since there is no device recorded as being currently attached to the port. This can lead to spurious hotplug events (or even endless loops of hotplug events, if the process of opening and closing the device happens to generate a port status change). Fix by using a separate flag to indicate that a device is physically attached (even if we have no corresponding struct usb_device). Reported-by: Dan Ellis <Dan.Ellis@displaylink.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rndis] Add rndis_rx_err()Michael Brown2015-02-112-0/+17
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Allow product tag line to be customised via config/branding.hMichael Brown2015-02-112-1/+10
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Allow setting help text URI to be customised via config/branding.hMichael Brown2015-02-113-3/+46
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Allow command help text URI to be customised via config/branding.hMichael Brown2015-02-112-1/+46
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Allow error message URI to be customised via config/branding.hMichael Brown2015-02-112-2/+48
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Allow product URI to be customised via config/branding.hMichael Brown2015-02-113-3/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Use PRODUCT_SHORT_NAME for end-user visible stringsMichael Brown2015-02-114-6/+11
| | | | | | | | | | | Use PRODUCT_SHORT_NAME instead of a hardcoded "iPXE" for strings which are typically shown in the user interface. Note that this only allows for customisation of the user interface. Where the "iPXE" string serves a technical purpose (such as in the HTTP User-Agent), the string cannot be customised. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Move branding information to config/branding.hMichael Brown2015-02-115-18/+36
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>