summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [build] Use weak definitions instead of weak declarationsJoshua Oreman2010-05-2712-98/+48Star
| | | | | | | | | | | | | | | This removes the need for inline safety wrappers, marginally reducing the size penalty of weak functions, and works around an apparent binutils bug that causes undefined weak symbols to not actually be NULL when compiling with -fPIE (as EFI builds do). A bug in versions of binutils prior to 2.16 (released in 2005) will cause same-file weak definitions to not work with those toolchains. Update the README to reflect our new dependency on binutils >= 2.16. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Fix link order for elf2efiPiotr Jaroszyński2010-05-271-2/+2
| | | | | | | | | Dependencies are considered in left-to-right order so the source file needs to come first in this case. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Inhibit "skipping incompatible" message from ldMichael Brown2010-05-271-1/+1
| | | | | | | | | | On 64-bit systems with both 32-bit and 64-bit libraries installed, ld tends to generate noisy "skipping incompatible /usr/lib/libxxx.so" messages when building elf2efi.c. Fix by passing --no-warn-search-mismatch to ld. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [efi] Verify object format support in elf2efi.cGeoff Lywood2010-05-271-2/+3
| | | | | | | | | | Currently, if you attempt to build 64-bit EFI binaries on a 32-bit system without a suitable cross-compiling version of libbfd, the iPXE build will die with a segmentation fault in elf2efi64. Fix by properly handling the return value from bfd_check_format(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Honor PXEBS_SKIP option in discovery controlJoshua Oreman2010-05-271-2/+26
| | | | | | | | | | | | | | | | It is permissible for a DHCP packet containing PXE options to specify only "discovery control", instead of the more typical boot menu + prompt options. This is the strategy used by older versions of dnsmasq; by specifying the discovery control as PXEBS_SKIP, they cause vendor PXE ROMs to ignore boot server discovery and just use the filename and next-server options in the initial (Proxy)DHCP packet. Modify iPXE to accept this behavior, to be more compatible with the Intel firmware. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Tested-by: Kyle Kienapfel <kyle@shadowmage.org> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [wpa] Remove PMKID checkingJoshua Oreman2010-05-271-64/+0Star
| | | | | | | | | | | | PMKID checking is an additional pre-check that helps detect invalid passphrases before going through the full handshaking procedure. It takes up some amount of code size, and is not necessary from a security perspective. It also is implemented improperly by some routers, which was causing iPXE to give spurious authentication errors. Remove it for these reasons. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bitmap] Fix bitmaps on 64-bitGeoff Lywood2010-05-272-2/+2
| | | | | Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [comboot] Propagate carry flag from COMBOOT APIStefan Hajnoczi2010-05-253-12/+41
| | | | | | | | | | | | COMBOOT API calls set the carry flag on failure. This was not being propagated because the COMBOOT interrupt handler used iret to return with EFLAGS restored from the stack. This patch propagates CF before returning from the interrupt. Reported-by: Geoff Lywood <glywood@vmware.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Marty Connor <mdc@etherboot.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [qib7322] Add support for QLogic 7322 HCAMichael Brown2010-05-254-0/+10051
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Update received sequence number before delivering received dataMichael Brown2010-05-221-8/+10
| | | | | | | | | | | | | iPXE currently updates the TCP sequence number after delivering the data to the application via xfer_deliver_iob(). If the application responds to the received data by transmitting more data, this would result in a stale ACK number appearing in the transmitted packet, which potentially causes retransmissions and also gives the undesirable appearance of violating causality (by sending a response to a message that we claim not to have yet received). Reported-by: Guo-Fu Tseng <cooldavid@cooldavid.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [script] Accept "#!gpxe" as well as "#!ipxe" as a script magic markerMichael Brown2010-05-221-4/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Treat PXENV_RESTART_TFTP as unreturnableMichael Brown2010-05-213-7/+17
| | | | | | | | | | | | | | | | | | | | | | | Microsoft WDS can end up calling PXENV_RESTART_TFTP to execute a second-stage NBP which then exits. Specifically, wdsnbp.com uses PXENV_RESTART_TFTP to execute pxeboot.com, which will exit if the user does not press F12. iPXE currently treats PXENV_RESTART_TFTP as a normal PXE API call, and so attempts to return to wdsnbp.com, which has just been vaporised by pxeboot.com. Use rmsetjmp/rmlongjmp to preserve the stack state as of the initial NBP execution, and to restore this state immediately prior to executing the NBP loaded via PXENV_RESTART_TFTP. This matches the behaviour in the PXE spec (which says that "if TFTP is restarted, control is never returned to the caller"), and allows pxeboot.com to exit relatively cleanly back to iPXE. As with all usage of setjmp/longjmp, there may be subtle corner case bugs due to not gracefully unwinding any state accumulated by the time of the longjmp call, but this seems to be the only viable way to provide the specified behaviour. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [lacp] Add simple LACP implementationMichael Brown2010-05-105-406/+526
| | | | | | | | | | Some switch configurations will refuse to enable our port unless we can speak LACP to inform the switch that we are alive. Add a very simple passive LACP implementation that is sufficient to convince at least Linux's bonding driver (when tested using qemu attached to a tap device enslaved to a bond device configured as "mode=802.3ad"). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix building with binutils 2.16Michael Brown2010-04-271-1/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uri] Special case NULL in churi()Piotr Jaroszyński2010-04-251-2/+4
| | | | | | | | | resolve_uri() doesn't (and probably shouldn't) handle NULL relative_uri. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Reviewed-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Marty Connor <mdc@etherboot.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uri] Fix NULL dereference in parse_uri()Piotr Jaroszyński2010-04-251-2/+10
| | | | | | | Don't try to parse authority if it's not there. Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Add .mrom format, allowing loading of large ROMsMichael Brown2010-04-255-9/+518
| | | | | | | | | | | | | | | | | | | | | Add an infrastructure allowing the prefix to provide an open_payload() method for obtaining out-of-band access to the whole iPXE image. Add a mechanism within this infrastructure that allows raw access to the expansion ROM BAR by temporarily borrowing an address from a suitable memory BAR on the same PCI card. For cards that have a memory BAR that is at least as large as their expansion ROM BAR, this allows large iPXE ROMs to be supported even on systems where PMM fails, or where option ROM space pressure makes it impossible to use PMM shrinking. The BIOS sees only a stub ROM of approximately 3kB in size; the remainder (which can be well over 64kB) is loaded only at the time iPXE is invoked. As a nice side-effect, an iPXE .mrom image will continue to work even if its PMM-allocated areas are overwritten between initialisation and invocation. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Replace obsolete makerom.pl with quick script using Option::ROMMichael Brown2010-04-255-251/+39Star
| | | | | | | | | | | The only remaining useful function of makerom.pl is to correct the ROM and PnP checksums; the PCI IDs are set at link time, and padding is performed using padimg.pl. Option::ROM already provides a facility for correcting the checksums, so we may as well just use this instead. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [main] Match "starting execution" and "initialising devices" message styleMichael Brown2010-04-251-2/+2
| | | | | | | | Add a trailing "ok" to the "initialising devices message", to match the visual style of the "ok" now added to the "starting execution" message. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Inhibit the use of relocation during POSTMichael Brown2010-04-253-6/+25
| | | | | | | | | | | | | | | It is common for system memory maps to be grotesquely unreliable during POST. Many sanity checks have been added to the memory map reading code, but these do not catch all problems. Skip relocation entirely if called during POST. This should avoid the problems typically encountered, at the cost of slightly disrupting the memory map of an operating system booted via iPXE when iPXE was entered during POST. Since this is a very rare special case (used, for example, when reflashing an experimental ROM that would otherwise prevent the system from completing POST), this is an acceptable cost. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Split PMM allocations for image source and decompression areaMichael Brown2010-04-251-51/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some BIOSes (at least some AMI BIOSes) tend to refuse to allocate a single area large enough to hold both the iPXE image source and the temporary decompression area, despite promising a largest available PMM memory block of several megabytes. This causes ROM image shrinking to fail on these BIOSes, with undesirable consequences: other option ROMs may be disabled due to shortage of option ROM space, and the iPXE ROM may itself be corrupted by a further BIOS bug (again, observed on an AMI BIOS) which causes large ROMs to end up overlapping reserved areas of memory. This can potentially render a system unbootable via any means. Increase the chances of a successful PMM allocation by dropping the alignment requirement (which is redundant now that we can enable A20 from within the prefix); this allows us to reduce the allocation size from 2MB down to only the required size. Increase the chances still further by using two separate allocations: one to hold the image source (i.e. the copy of the ROM before being shrunk) and the other to act as the decompression area. This allows ROM image shrinking to take place even on systems that fail to allocate enough memory for the temporary decompression area. Improve the behaviour of iPXE in systems with multiple iPXE ROMs by sharing PMM allocations where possible. Image source areas can be shared with any iPXE ROMs with a matching build identifier, and the temporary decompression area can be shared with any iPXE ROMs with the same uncompressed size (rounded up to the nearest 128kB). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Use area at top of INT 15,88 memory map for temporary decompressionMichael Brown2010-04-253-17/+27
| | | | | | | | | Use INT 15,88 to find a suitable temporary decompression area, rather than a fixed address. This hopefully gives us a better chance of not treading on any PMM-allocated areas, in BIOSes where PMM support exists but tends not to give us the large blocks that we ask for. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pcbios] Always show INT 15,88 result under DEBUG=memmapMichael Brown2010-04-251-5/+5
| | | | | | | | Always call INT 15,88 even if we don't use the result. This allows DEBUG=memmap to show the complete result set returned by all of the INT 15 memory-map calls. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Generate random build identifierMichael Brown2010-04-252-2/+10
| | | | | | | | | Randomly generate a 32-bit build identifier that can be used to identify identical iPXE ROMs when multiple such ROMs are present in a system (e.g. when a multi-function NIC exposes the same iPXE ROM image via each function's expansion ROM BAR). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Provide indication of successful call to install_preallocMichael Brown2010-04-211-4/+12
| | | | | | | | | | | The existing "iPXE starting execution" message indicates that the BEV (or INT19) was invoked, but gives no indication on whether or not the iPXE source was successfully retrieved (e.g. from PMM). Split the "starting execution message" into "starting execution...ok"; the "ok" indicates that the main iPXE body was successfully decompressed and relocated. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Default to 1MB mark as fallback high memory load pointMichael Brown2010-04-201-8/+1Star
| | | | | | | | | | Now that we can use odd megabytes, there is no particular need to use an even megabyte as the fallback temporary load point. Note that the old warnings about avoiding 2MB pre-date our ability to cooperate with other PXE ROMs by using PMM. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [relocate] Remove the even megabyte constraintMichael Brown2010-04-201-48/+8Star
| | | | | | | iPXE is now capable of operating in odd megabytes of memory, so remove the obsolete code enforcing an even-megabyte constraint. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Use libflat to enable A20 line on each real-to-protected transitionMichael Brown2010-04-208-227/+12Star
| | | | | | | | | | | | | Use the shared code in libflat to perform the A20 transitions automatically on each transition from real to protected mode. This allows us to remove all explicit calls to gateA20_set(). The old warnings about avoiding automatically enabling A20 are essentially redundant; they date back to the time when we would always start hammering the keyboard controller without first checking to see if gate A20 was already enabled (which it almost always is). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Add A20-enabling code in libflatMichael Brown2010-04-202-8/+296
| | | | | | | | | | | | | | | | iPXE currently insists on residing in an even megabyte. This imposes undesirably severe constraints upon our PMM allocation strategy, and limits our options for mechanisms to access ROMs greater than 64kB in size. Add A20 handling code to libflat so that prefixes are able to access memory even in odd megabytes. The algorithms and tuning parameters in the new A20 handling code are based upon a mixture of the existing iPXE A20 code and the A20 code from the 2.6.32 Linux kernel. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Move flatten_real_mode to libflat.SMichael Brown2010-04-202-122/+141
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Move flatten_real_mode to .text16.earlyMichael Brown2010-04-201-41/+31Star
| | | | | | | | | | The flatten_real_mode routine is not needed until after decompressing .text16.early, and currently performs various contortions to compensate for the fact that .prefix may not be writable. Move flatten_real_mode to .text16.early to save on (compressed) binary size and simplify the code. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Add .text16.early sectionMichael Brown2010-04-204-39/+150
| | | | | | | | | | | | | Add a section .text16.early which is always kept inline with the prefix. This will allow for some code sharing between the .prefix and .text16 sections. Note that the simple solution of just prepending the .prefix section to the .text16 section will not work, because a bug in Wyse Streaming Manager server (WLDRM13.BIN) requires us to place a dummy PXENV+ entry point at the start of .text16. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Use flat real mode for access to high memoryMichael Brown2010-04-201-127/+79Star
| | | | | | | | | | Use flat real mode rather than 16-bit protected mode for access to high memory during installation. This simplifies the code by reducing the number of CPU modes we need to think about, and also increases the amount of code in common between the normal and (somewhat hypothetical) KEEP_IT_REAL methods of operation. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Use flat real mode instead of real modeMichael Brown2010-04-202-17/+8Star
| | | | | | | | | | | | | | | | | | | | When returning to real mode, set 4GB segment limits instead of 64kB limits. This change improves our chances of successfully returning to a PMM-capable BIOS aftering entering iPXE during POST; the BIOS will have set up flat real mode before calling our initialisation point, and may be disconcerted if we then return in genuine real mode. This change is unlikely to break anything, since any code that might potentially access beyond 64kB must use addr32 prefixes to do so; if this is the case then it is almost certainly code written to expect flat real mode anyway. Note that it is not possible to restore the real-mode segment limits to their original values, since it is not possible to know which protected-mode segment descriptor was originally used to initialise the limit portion of the segment register. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Remove .hrom prefixMichael Brown2010-04-204-28/+0Star
| | | | | | | | | | | | The .hrom prefix provides an experimental mechanism for reducing option ROM space usage on systems where PMM allocation fails, by pretending that PMM allocation succeeded and gave us an address fixed at compilation time. This is unreliable, and potentially dangerous. In particular, when multiple gPXE ROMs are present in a system, each gPXE ROM will assume ownership of the same fixed address, resulting in undefined behaviour. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Remove .xrom prefixMichael Brown2010-04-206-407/+20Star
| | | | | | | | | | | | | | | The .xrom prefix provides an experimental mechanism for loading ROM images greater than 64kB in size by mapping the expansion ROM BAR in at a hopefully-unused address. This is unreliable, and potentially dangerous. In particular, there is no guarantee that any PCI bridges between the CPU and the device will respond to accesses for the "unused" memory region that is chosen, and it is possible that the process of scanning for the "unused" memory region may end up issuing reads to other PCI devices. If this ends up trampling on a register with read side-effects belonging to an unrelated PCI device, this may cause undefined behaviour. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Rename gPXE to iPXEMichael Brown2010-04-20597-2288/+2220Star
| | | | | | | | | | | Access to the gpxe.org and etherboot.org domains and associated resources has been revoked by the registrant of the domain. Work around this problem by renaming project from gPXE to iPXE, and updating URLs to match. Also update README, LOG and COPYRIGHTS to remove obsolete information. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [eepro100] Remove link-state checkingThomas Miletich2010-04-192-48/+1Star
| | | | | | | | | | | | Christopher Armenio reported link detection problems with an integrated eepro100 NIC. Thomas Miletich removed link detection code from the eepro100 driver and verified that the driver continued to function. Christopher verified Thomas' patch on his integrated eepro100 NIC. Reported-by: Christopher Armenio <christopher.armenio@resquared.com> Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [util] Hide an expected error from the 'which' commandPiotr Jaroszyński2010-04-161-1/+1
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [build] Look for isolinux.bin in more placesPiotr Jaroszyński2010-04-161-1/+5
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [drivers] Fix warnings identified by gcc 4.5Bruce Rogers2010-04-163-4/+4
| | | | | | | | | In building gpxe for openSUSE Factory (part of kvm package), there were a few problems identified by the compiler. This patch addresses them. Signed-off-by: Bruce Rogers <brogers@novell.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [build] Add support for local configuration filesPiotr Jaroszyński2010-03-2611-2/+25
| | | | | | | | Include config/local/$file in config/$file where it makes sense and create empty local configs during build if not present. Modified-by: Michael Brown <mcb30@etherboot.org> Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [pxe] Remove pxe_set_cached_filename()Michael Brown2010-03-263-37/+0Star
| | | | | | | | | | | | | | | | | gPXE currently overwrites the filename stored in the cached DHCP packets when a call to PXENV_TFTP_READ_FILE or PXENV_RESTART_TFTP is made. This code has existed for many years as a workaround for RIS, which seemed to require that this be done. pxe_set_cached_filename() causes problems with the Bootix NBP, and a recent test demonstrates that RIS will complete successfully even with pxe_set_cached_filename() removed. There have been many changes to the DHCP and PXE logic since this code was first added, and it is quite plausible that it was masking a bug that no longer exists. Reported-by: Alex Zeffertt <alex.zeffertt@eu.citrix.com> Debugged-by: Shao Miller <Shao.Miller@yrdsb.edu.on.ca> Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [pxe] Avoid potential interrupt storms when using shared interruptsMichael Brown2010-03-231-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Current gPXE code always returns "OURS" in response to PXENV_UNDI_ISR:START. This is harmless for non-shared interrupt lines, and avoids the complexity of trying to determine whether or not we really did cause the interrupt. (This is a non-trivial determination; some drivers don't have interrupt support and hook the system timer interrupt instead, for example.) A problem occurs when we have a shared interrupt line, the other device asserts an interrupt, and the controlling ISR does not chain to the other device's ISR when we return "OURS". Under these circumstances, the other device's ISR never executes, and so the interrupt remains asserted, causing an interrupt storm. Work around this by returning "OURS" if and only if our net device's interrupt is currently recorded as being enabled. Since we always disable interrupts as a result of a call to PXENV_UNDI_ISR:START, this guarantees that we will eventually (on the second call) return "NOT OURS", allowing the other ISR to be called. Under normal operation, including a non-shared interrupt situation, this change will make no difference since PXENV_UNDI_ISR:START would be called only when interrupts were enabled anyway. Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [netdevice] Record whether or not interrupts are currently enabledMichael Brown2010-03-232-0/+21
| | | | Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [netdevice] Add netdev_is_open() wrapper functionMichael Brown2010-03-2310-17/+28
| | | | Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [phantom] Update interrupt support to match current firmwareMichael Brown2010-03-222-23/+91
| | | | | | | | | | | The interrupt control mechanism on Phantom cards has changed substantially since the driver was initially written. This updates the code to match the mechanism used in production firmware. This is sufficient to allow DOS wget to function successfully using the 3Com UNDI/NDIS, Intel UNDI/NDIS, and UNDIPD.COM UNDI/PD stacks. Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [igb] Add igb driverMarty Connor2010-03-1721-0/+13395
| | | | | | | | | | | | This commit adds an igb (Intel GigaBit) driver based on Intel source code available at: http://sourceforge.net/projects/e1000/ which is upstream source for the Linux kernel e1000 drivers, and should support some PCIe e1000 variants. Signed-off-by: Marty Connor <mdc@etherboot.org>
* [e1000e] Add e1000e driverMarty Connor2010-03-1722-0/+18164
| | | | | | | | | | | | This commit adds an e1000e driver based on Intel source code available at: http://sourceforge.net/projects/e1000/ which is upstream source for the Linux kernel e1000 drivers, and should support many PCIe e1000 variants. Signed-off-by: Marty Connor <mdc@etherboot.org>
* [e1000] Update e1000 driverMarty Connor2010-03-1725-13859/+15348
| | | | | | | | | | | | This commit replaces the current gPXE e1000 driver with one ported from Intel source code available at http://sourceforge.net/projects/e1000/ which is upstream source for the Linux kernel e1000 drivers, and should support most if not all PCI e1000 variants. Signed-off-by: Marty Connor <mdc@etherboot.org>