summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [console] Add facility for rudimentary keyboard mappingMichael Brown2011-03-162-2/+49
| | | | | | | Allow for remapping of ASCII characters returned by the BIOS, using a map consisting of (from,to) pairs. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Mark SNP devices as children of EFI PCI deviceMichael Brown2011-03-153-0/+70
| | | | | | | | | | | | | Re-open the EFI_PCI_IO_PROTOCOL specifying an Attributes value of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER. This causes the SNP devices to be marked as children of the EFI PCI device (as shown in the "devtree" command). On at least one IBM blade system, this is required in order to have the relevant drivers automatically attach to the SNP controller at device creation time. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Use correct size for PMM allocation of image source blockMichael Brown2011-03-151-6/+7
| | | | | | | | | | | | | | | | | | iPXE allocates its first PMM block using the image source length, which is rounded up to the nearest 16-byte paragraph. It then copies in data of a length calculated from the ROM size, which is theoretically less than or equal to the image source length, but is rounded up to the nearest 512-byte sector. This can result in copying beyond the end of the allocated PMM block, which can corrupt the PMM data structures (and other essentially arbitrary areas of memory). Fix by rounding up the image source length to the nearest 512-byte sector before using it as the PMM allocation length. Reported-by: Alex Williamson <alex.williamson@redhat.com> Reported-by: Jarrod Johnson <jarrod.b.johnson@gmail.com> Reported-by: Itay Gazit <itayg@mellanox.co.il> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [eepro100] Do not discard short packetsMichael Brown2011-03-121-1/+1
| | | | | | | | | | | In a virtual environment such as qemu, we can legitimately receive packets less than 64 bytes in length, such as ARP replies. These are currently discarded, causing most IPv4 communication to fail. Fix by ignoring the RFDShort bit when receiving packets. Reported-by: Alex Williamson <alex.williamson@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bios] Use INT 16,11 instead of INT 16,01 to check for keystrokesMichael Brown2011-03-101-1/+1
| | | | | | | | INT 16,01 will discard some extended keystrokes on some BIOSes, making it impossible for iPXE to detect keypresses such as F12. Fix by using INT 16,11 instead. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Report an IRQ number only if device supports interruptsMichael Brown2011-03-101-1/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [syslog] Add support for sending console output to a syslog serverMichael Brown2011-03-103-0/+243
| | | | | Originally-implemented-by: Anselm Martin Hoffmeister <anselm@hoffmeister.be> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Move include/console.h to include/ipxe/console.hMichael Brown2011-03-0931-33/+33
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [script] Allow scripts to be replacedMichael Brown2011-03-091-2/+6
| | | | | | | | | A script that downloads a new image using imgdownload() with the action register_and_replace_image() can now be freed immediately before the replacement image is executed. This functionality is not yet exposed via an iPXE command. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Avoid ending up with multiple selected images on re-registrationMichael Brown2011-03-091-0/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Simplify use of imgdownload()Michael Brown2011-03-0910-138/+223
| | | | | | | Allow imgdownload() to be called without first having to allocate (and so keep track of) an image. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Generalise "currently-running script" to "currently-running image"Michael Brown2011-03-093-23/+24
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Move the register_and_{select|boot}_image() functions to imgmgmt.cMichael Brown2011-03-094-41/+41
| | | | | | | | These functions are used only as the "action" parameters to imgdownload() or imgfetch(), and so belong in imgmgmt.c rather than image.c Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [monojob] Display percentage progress, if availableMichael Brown2011-03-081-6/+23
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Allow iPXE's own command line to be executed as a scriptMichael Brown2011-03-076-1/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | Some prefixes (e.g. .lkrn) allow a command line to be passed in to iPXE. At present, this command line is ignored. If a command line is provided, treat it as an embedded script (without an explicit "#!ipxe" magic marker). This allows for patterns of invocation such as title iPXE kernel /boot/ipxe.lkrn dhcp && \ sanboot iscsi:10.0.4.1::::iqn.2010-04.org.ipxe.dolphin:storage Here GRUB is instructed to load ipxe.lkrn with an embedded script equivalent to #!ipxe dhcp sanboot iscsi:10.0.4.1::::iqn.2010-04.org.ipxe.dolphin:storage This can be used to effectively vary the embedded script without having to rebuild ipxe.lkrn. Originally-implemented-by: Dave Hansen <dave@sr71.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [main] Remove shell prompt when using an embedded imageMichael Brown2011-03-071-14/+13Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Use list_first_entry() to clarify logic in main()Michael Brown2011-03-072-5/+11
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [script] Add "prompt" commandMichael Brown2011-03-071-0/+67
| | | | | | | | | | | | | The "prompt" command exposes the prompt() function, allowing a script to prompt the user for a keypress and take action depending on the result. For example #!ipxe prompt -k 0x197e -t 2000 Press F12 to boot from network... || exit autoboot Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prompt] Replace shell_banner() with a generic prompt() functionMichael Brown2011-03-075-37/+64
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Add a timeout parameter to getkey()Michael Brown2011-03-077-16/+13Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Avoid timer wraparound problems in getchar_timeout()Michael Brown2011-03-071-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bios] Recognise scancodes for F5-F12 inclusiveMichael Brown2011-03-072-25/+31
| | | | | | | | | The function keys F5-F12 all conform to the same ANSI pattern as the other "special" keys that we currently recognise. Add these key definitions, and shrink the representation of the ANSI sequences in bios_console.c to compensate. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add generic concat_args() functionMichael Brown2011-03-073-36/+60
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [script] Add an iPXE error URI to the "not in a script" messageMichael Brown2011-03-071-2/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Clear the command line rather than setting an empty command lineMichael Brown2011-03-071-3/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Allow image_set_cmdline() to clear the command lineMichael Brown2011-03-071-4/+8
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [comboot] Do not assume that image has a non-NULL command lineMichael Brown2011-03-071-3/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Simplify image managementMichael Brown2011-03-0720-501/+414Star
| | | | | | | | | | | Refactor the {load,exec} image operations as {probe,exec}. This makes the probe mechanism cleaner, eliminates some forward declarations, avoids holding magic state in image->priv, eliminates the possibility of screwing up between the "load" and "exec" stages, and makes the documentation simpler since the concept of "loading" (as distinct from "executing") no longer needs to be explained. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [spi] Reset device on each accessMichael Brown2011-03-041-0/+3
| | | | | | | | | | | | | | When chainloading rtl8139.pxe from an old Etherboot rtl8139.zrom, iPXE can end up misreading the first word of the MAC address from the EEPROM as being all zeroes. This is presumably because Etherboot has left the serial EEPROM in an unexpected state. Fix by using the chip select line to reset the SPI device before we start accessing it. Reported-by: Mandar U Jog <mandarjog@gmail.com> Tested-by: Mandar U Jog <mandarjog@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [parseopt] Refer to online documentation for command helpMichael Brown2011-03-0423-80/+46Star
| | | | | | | | | | The online documentation (e.g. http://ipxe.org/cmd/ifopen), though not yet complete, is far more comprehensive than could be provided within the iPXE binary. Save around 200 bytes (compressed) by removing the command descriptions from the interactive help, and instead referring users directly to the web page describing the relevant command. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [arbel] Make driver 64-bit safeMichael Brown2011-03-041-2/+37
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hermon] Make driver 64-bit safeMichael Brown2011-03-042-0/+37
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [iscsi] Change default initiator IQNMichael Brown2011-03-033-241/+150Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default initiator IQN is "iqn.2000-09.org.etherboot:UNKNOWN". This is problematic for two reasons: a) the etherboot.org domain (and hence the associated IQN namespace) is not under the control of the iPXE project, and b) some targets (correctly) refuse to allow concurrent connections from different initiators using the same initiator IQN. Solve both problems by changing the default initiator IQN to be iqn.2010-04.org.ipxe:<hostname> if a hostname is set, or iqn.2010-04.org.ipxe:<uuid> if no hostname is set. Explicit initiator IQNs set via DHCP option 203 are not affected by this change. Unfortunately, this change is likely to break some existing configurations, where ACL rules have been put in place referring to the old default initiator IQN. Users may need to update ACLs, or force the use of the old IQN using an iPXE script line such as set initiator-iqn iqn.2000-09.org.etherboot:UNKNOWN or a dhcpd.conf option such as option iscsi-initiator-iqn "iqn.2000-09.org.etherboot:UNKNOWN" Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dns] Fix memory leak in settings applicatorMichael Brown2011-03-031-2/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Make fetch_string_setting_copy() easier to useMichael Brown2011-03-031-1/+10
| | | | | | | | | | | | | Most callers of functions in the fetch_setting() family treat any errors as meaning "non-existent setting". In the case of fetch_string_setting_copy(), an existent setting can still result in an error due to memory allocation failure. Allow the caller to distinguish between a non-existent setting and an error in allocating memory for the copy, by returning success (and a NULL buffer pointer) for a non-existent setting. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Avoid fetch_string_setting_copy() leaving an uninitialised pointerMichael Brown2011-03-031-0/+2
| | | | | | | | For consistency with other functions in the fetch_setting() family, ensure that fetch_string_setting_copy() always initialises the pointer to the fetched setting even if fetching fails. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [hermon] Add BOFM supportMichael Brown2011-03-033-58/+415
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bofm] Allow garbage collection of BOFM code in non-BOFM buildsMichael Brown2011-03-031-1/+10
| | | | | | | | | Most builds will not have BOFM enabled. In these builds, allow all BOFM code (including BOFM-only code within the individual drivers) to be garbage-collected at link time in order to save space in the final binary. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bofm] Add support for BOFM under EFIMichael Brown2011-03-034-0/+347
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bofm] Add offline BOFM test facilityMichael Brown2011-03-032-0/+170
| | | | | | | | Testing BOFM involves gaining access to an IBM blade chassis, which is often not practical. Provide a facility for testing BOFM functionality outside of a real IBM blade context. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bofm] Add core BOFM libraryMichael Brown2011-03-034-0/+678
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Allow a SAN boot as a fallback if a filename boot returnsMichael Brown2011-03-021-6/+23
| | | | | | | | | | | | | | | Currently, if both a filename and root-path are present, iPXE will hook the SAN device but will only attempt to boot from the filename. Change this behaviour so that both are attempted. Users who want to avoid booting from the SAN as a fallback can do so via the existing "skip-san-boot" setting. This allows for seamless deployment to a SAN target using Windows Deployment Services (and similar products). A user simply has to define the root-path option in DHCP and then use WDS to deploy the system. No further configuration should be required. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Tidy up output following NBP executionMichael Brown2011-03-021-1/+7
| | | | | | | | If the NBP returns, then always print a trailing newline, since some NBPs (e.g. wdsnbp.com) leave the cursor in a random position halfway across the screen. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Allow download job to complete before acting upon imageMichael Brown2011-03-024-19/+13Star
| | | | | | | | | Allow the monojob controlling the download to complete before calling register_image() and friends. This allows the trailing "ok" from monojob.c to be printed before the image starts executing (and possibly printing output of its own). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Automatically reopen underlying block device as neededMichael Brown2011-03-021-34/+50
| | | | | | | | | | | | | | | | We currently use INT 13,00 as an opportunity to reopen the underlying block device, which works well for callers such as DOS that will use INT 13,00 in response to any disk errors. However, some callers (such as Windows Server 2008) do not attempt to reset the disk, and so any failures become effectively permanent. Fix this by automatically reopening the underlying block device whenever we might want to access it. This makes direct installation of Windows to an iSCSI target much more reliable. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Set the "size" bit in the GDT entry for the flat data segmentMichael Brown2011-03-011-1/+1
| | | | | | | | | | | | The "size" bit (aka the D/B) bit should (as far as I can tell) be irrelevant for accesses to a non-code, non-stack, expand-upwards segment. However, VirtualBox fails on some accesses via this segment if this bit is not set. This change allows iPXE to boot under VirtualBox without having to disable VT-x/AMD-V support. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Add rudimentary debugging messages to libprefixMichael Brown2011-03-011-0/+40
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Allow DEBUG=... to affect builds of assembler source filesMichael Brown2011-03-012-6/+7
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Use a custom error number for "nothing to boot"Michael Brown2011-02-281-1/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [autoboot] Add an iPXE error URI to the "nothing to boot" messageMichael Brown2011-02-281-1/+1
| | | | | | | Change the message "No filename or root path specified" to include an iPXE error URI. Signed-off-by: Michael Brown <mcb30@ipxe.org>