summaryrefslogtreecommitdiffstats
path: root/src/include
Commit message (Collapse)AuthorAgeFilesLines
* [xen] Add basic support for PV-HVM domainsMichael Brown2014-07-299-0/+444
| | | | | | | | | Add basic support for Xen PV-HVM domains (detected via the Xen platform PCI device with IDs 5853:0001), including support for accessing configuration via XenStore and enumerating devices via XenBus. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [xen] Import selected public headersMichael Brown2014-07-2919-0/+5650
| | | | | | | | | | | | Import selected headers from the xen/include/public directory of the Xen repository at git://xenbits.xen.org/xen.git The script ./include/xen/import.pl can be used to automatically import any required headers and their dependencies (in a similar fashion to ./include/ipxe/efi/import.pl). Trailing whitespace is stripped and an appropriate FILE_LICENCE declaration is added to each header file. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ioapi] Centralise notion of PAGE_SIZEMichael Brown2014-07-282-3/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Include EFI_CONSOLE_CONTROL_PROTOCOL headerMichael Brown2014-07-162-1/+125
| | | | | | | | | | | | The EFI_CONSOLE_CONTROL_PROTOCOL does not exist in the current UEFI specification, but is required to enable text output on some older EFI 1.10 implementations (observed on an old iMac). The header is not present in any of the standard include directories, but can still be found in the EDK2 codebase as part of EdkCompatibilityPkg. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow for interception of boot services calls by loaded imageMichael Brown2014-07-161-0/+16
| | | | | | | When building with DEBUG=efi_wrap, print details of calls made by the loaded image to selected boot services functions. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Install our own disk I/O protocol and claim exclusive use of itMichael Brown2014-07-141-0/+119
| | | | | | | | | | | | | | | | | | | The EFI FAT filesystem driver has a bug: if a block device contains no FAT filesystem but does have an EFI_SIMPLE_FILE_SYSTEM_PROTOCOL instance, the FAT driver will assume that it must have previously installed the EFI_SIMPLE_FILE_SYSTEM_PROTOCOL. This causes the FAT driver to claim control of our device, and to refuse to stop driving it, which prevents us from later uninstalling correctly. Work around this bug by opening the disk I/O protocol ourselves, thereby preventing the FAT driver from opening it. Note that the alternative approach of opening the block I/O protocol (and thereby in theory preventing DiskIo from attaching to the block I/O protocol) causes an endless loop of calls to our DRIVER_STOP method when starting the EFI shell. I have no idea why this is. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Update EDK2 headersMichael Brown2014-07-1420-96/+533
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Add support for iPAddress subject alternative namesMichael Brown2014-07-111-0/+1
| | | | | Originally-implemented-by: Jarrod Johnson <jarrod.b.johnson@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Identify autoboot device by MAC address when chainloadingMichael Brown2014-07-081-0/+14
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Allow autoboot device to be identified by link-layer addressMichael Brown2014-07-081-2/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow network devices to be created on top of arbitrary SNP devicesMichael Brown2014-07-035-34/+56
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Restructure EFI driver modelMichael Brown2014-06-252-33/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | Provide a single instance of EFI_DRIVER_BINDING_PROTOCOL (attached to our image handle); this matches the expectations scattered throughout the EFI specification. Open the underlying hardware device using EFI_OPEN_PROTOCOL_BY_DRIVER and EFI_OPEN_PROTOCOL_EXCLUSIVE, to prevent other drivers from attaching to the same device. Do not automatically connect to devices when being loaded as a driver; leave this task to the platform firmware (or to the user, if loading directly from the EFI shell). When running as an application, forcibly disconnect any existing drivers from devices that we want to control, and reconnect them on exit. Provide a meaningful driver version number (based on the build timestamp), to allow platform firmware to automatically load newer versions of iPXE drivers if multiple drivers are present. Include device paths within debug messages where possible, to aid in debugging. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Provide a meaningful EFI SNP device nameMichael Brown2014-06-251-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow device paths to be easily included in debug messagesMichael Brown2014-06-251-16/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Expose build timestamp, build name, and product namesMichael Brown2014-06-241-1/+12
| | | | | | | | Expose the build timestamp (measured in seconds since the Epoch) and the build name (e.g. "rtl8139.rom" or "ipxe.efi"), and provide the product name and product short name in a single centralised location. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [smbios] Expose board serial number as ${board-serial}Dale Hamel2014-06-121-0/+17
| | | | | | | | With blade servers, the chassis serial number (exposed via ${serial}) may not be unique. Expose ${board-serial} as a named setting to provide easy access to a more meaningful serial number. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Include IP address origin in iBFTMichael Brown2014-06-121-0/+8
| | | | | | | | | | | The iBFT includes an "origin" field to indicate the source of the IP address. We use the heuristic of assuming that the source should be "manual" if the IP address originates directly from the network device settings block, and "DHCP" otherwise. This is an imperfect guess, but is likely to be correct in most common situations. Originally-implemented-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [scsi] Improve sense code parsingMichael Brown2014-06-031-4/+47
| | | | | | | | Parse the sense data to extract the reponse code, the sense key, the additional sense code, and the additional sense code qualifier. Originally-implemented-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ethernet] Provide eth_random_addr() to generate random Ethernet addressesHannes Reinecke2014-06-021-0/+1
| | | | | Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Fix definition of IN6_IS_ADDR_LINKLOCAL()Michael Brown2014-05-211-1/+1
| | | | | | | | Fix an erroneous htonl() in the definition of IN6_IS_ADDR_LINKLOCAL(), and add self-tests for the IN6_IS_ADDR_xxx() family of macros. Reported-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow for optional protocolsMichael Brown2014-05-191-0/+17
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [nfs] Rewrite NFS URI handlingMarin Hannache2014-05-182-0/+30
| | | | | | | | Get the NFS URI manipulation code out of nfs_open.c. The resulting code is now much more readable. Signed-off-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [profile] Allow interrupts to be excluded from profiling resultsMichael Brown2014-05-041-12/+79
| | | | | | | | | Interrupt processing adds noise to profiling results. Allow interrupts (from within protected mode) to be profiled separately, with time spent within the interrupt handler being excluded from any other profiling currently in progress. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [profile] Provide methods for profiling individual stages of operationsMichael Brown2014-05-031-7/+35
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Allow for a debug level of zeroMichael Brown2014-04-281-15/+2Star
| | | | | | | | Allow for an explicit debug level of zero, which will enable assertions and profiling (i.e. anything controlled by NDEBUG) without generating any debug messages. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "profstat" command to display profiling statisticsMichael Brown2014-04-281-0/+14
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [profile] Add generic profiling infrastructureMichael Brown2014-04-281-47/+61
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Add flsll()Michael Brown2014-04-271-4/+11
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Add isqrt() function to find integer square rootsMichael Brown2014-04-261-0/+14
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Add inline assembly implementation of flsl() using BSR instructionMichael Brown2014-04-241-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Add support for subjectAltName and wildcard certificatesMichael Brown2014-03-312-0/+19
| | | | | Originally-implemented-by: Alex Chernyakhovsky <achernya@google.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Allow signed timestamp error margin to be configured at build timeMichael Brown2014-03-301-8/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Generalise X.509 cache to a full certificate storeMichael Brown2014-03-286-65/+63Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Expand the concept of the X.509 cache to provide the functionality of a certificate store. Certificates in the store will be automatically used to complete certificate chains where applicable. The certificate store may be prepopulated at build time using the CERT=... build command line option. For example: make bin/ipxe.usb CERT=mycert1.crt,mycert2.crt Certificates within the certificate store are not implicitly trusted; the trust list is specified using TRUST=... as before. For example: make bin/ipxe.usb CERT=root.crt TRUST=root.crt This can be used to embed the full trusted root certificate within the iPXE binary, which is potentially useful in an HTTPS-only environment in which there is no HTTP server from which to automatically download cross-signed certificates or other certificate chain fragments. This usage of CERT= extends the existing use of CERT= to specify the client certificate. The client certificate is now identified automatically by checking for a match against the private key. For example: make bin/ipxe.usb CERT=root.crt,client.crt TRUST=root.crt KEY=client.key Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Add pubkey_match() to check for matching public/private key pairsMichael Brown2014-03-271-0/+18
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Remove dynamically-allocated storage for certificate OCSP URIMichael Brown2014-03-251-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Remove dynamically-allocated storage for certificate nameMichael Brown2014-03-251-1/+4
| | | | | | | | | | | | | | iPXE currently allocates a copy the certificate's common name as a string. This string is used by the TLS and CMS code to check certificate names against an expected name, and also appears in debugging messages. Provide a function x509_check_name() to centralise certificate name checking (in preparation for adding subjectAlternativeName support), and a function x509_name() to provide a name to be used in debugging messages, and remove the dynamically allocated string. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Disable SNP devices when running iPXE as the applicationMichael Brown2014-03-141-0/+4
| | | | | | | | | | | | | Some UEFI builds will set up a timer to continuously poll any SNP devices. This can drain packets from the network device's receive queue before iPXE gets a chance to process them. Use netdev_rx_[un]freeze() to explicitly indicate when we expect our network devices to be driven via the external SNP API (as we do with the UNDI API on the standard BIOS build), and disable the SNP API except when receive queue processing is frozen. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Notify upper-layer drivers when RX processing is (un)frozenMichael Brown2014-03-141-20/+2Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow driver to be unloadedMichael Brown2014-03-101-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Allow for 64-bit EFI_STATUS codesMichael Brown2014-03-101-10/+15
| | | | | | | On a 64-bit build, EFI_STATUS codes are 64-bit quantities, with the "error/warning" bit located in bit 63. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Add "--timeout" parameter to image downloading commandsMichael Brown2014-03-101-3/+6
| | | | | | | | | | | | | | | | | | iPXE will detect timeout failures in several situations: network link-up, DHCP, TCP connection attempts, unacknowledged TCP data, etc. This does not cover all possible circumstances. For example, if a connection to a web server is successfully established and the web server acknowledges the HTTP request but never sends any data in response, then no timeout will be triggered. There is no timeout defined within the HTTP specifications, and the underlying TCP connection will not generate a timeout since it has no way to know that the HTTP layer is expecting to receive data from the server. Add a "--timeout" parameter to "imgfetch", "chain", etc. If no progress is made (i.e. no data is downloaded) within the timeout period, then the download will be aborted. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [mii] Add mii_dump() to dump all MII registersMichael Brown2014-03-101-0/+31
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Calculate correct MSS from peer addressMichael Brown2014-03-041-10/+0Star
| | | | | | | | | | | | | | | | | | | iPXE currently advertises a fixed MSS of 1460, which is correct only for IPv4 over Ethernet. For IPv6 over Ethernet, the value should be 1440 (allowing for the larger IPv6 header). For non-Ethernet link layers, the value should reflect the MTU of the underlying network device. Use tcpip_mtu() to calculate the transport-layer MTU associated with the peer address, and calculate the MSS to allow for an optionless TCP header as per RFC 6691. As a side benefit, we can now fail a connection immediately with a meaningful error message if we have no route to the destination address. Reported-by: Anton D. Kachalov <mouse@yandex-team.ru> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Provide tcpip_mtu() to determine the maximum transmission unitMichael Brown2014-03-041-0/+3
| | | | | | | | Provide the function tcpip_mtu() to allow external code to determine the (transport-layer) maximum transmission unit for a given socket address. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Provide tcpip_netdev() to determine the transmitting network deviceMichael Brown2014-03-041-0/+8
| | | | | | | Provide the function tcpip_netdev() to allow external code to determine the transmitting network device for a given socket address. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Enable infrastructure to specify an autoboot device locationAlex Williamson2014-03-031-1/+3
| | | | | | | | | | | | | | | | | | iPXE will currently attempt to boot from every network device for which it has a driver. Where a system has more than one network device supported by iPXE, this renders BIOS IPL lists ineffective. Allow an autoboot device location to be specified. If such a location is specified, then only devices matching that location will be used as part of the automatic boot sequence. If no such location is specified, then all devices will be used. Note that this does not affect the "autoboot" command, which will continue to use all devices. Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add the "ipstat" commandMichael Brown2014-03-031-0/+14
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Add IP statistics collection as per RFC 4293Michael Brown2014-03-023-1/+194
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Ensure every image has a fully resolved URIMichael Brown2014-02-271-2/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uri] Refactor URI parsing and formattingMichael Brown2014-02-271-37/+41
| | | | | | | | | | | | | | | | | | | | | | | | 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>