summaryrefslogtreecommitdiffstats
path: root/src/arch
Commit message (Collapse)AuthorAgeFilesLines
...
* [i386] Fix building on older versions of gccMichael Brown2012-03-041-3/+7
| | | | | | | Fix a strict-aliasing error on certain versions of gcc. Reported-by: Marko Myllynen <myllynen@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [x86_64] Provide __bswap_{16,32,64}s()Michael Brown2012-03-041-0/+25
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [i386] Optimise byte-swapping functions and provide __bswap_{16,32,64}s()Michael Brown2012-03-041-32/+56
| | | | | | | | | | | Use the "bswap" instruction to shrink the size of byte-swapping code, and provide the in-place variants __bswap_{16,32,64}s. "bswap" is available only on 486 and later processors. (We already assume the presence of "cpuid" and "rdtsc", which are available only on Pentium and later processors.) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Allow underlying PXE stack to construct link-layer headerMichael Brown2012-03-021-2/+47
| | | | | | | | | | | | | | Some PXE stacks (observed with a QLogic 8242) will always try to prepend a link-layer header, even if the caller uses P_UNKNOWN to indicate that the link-layer header has already been filled in. This results in an invalid packet being transmitted. Work around these faulty PXE stacks where possible by stripping the existing link-layer header and allowing the PXE stack to (re)construct the link-layer header itself. Originally-fixed-by: Buck Huppmann <buckh@pobox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vmware] Fix length returned by guestrpc_command()Michael Brown2012-03-011-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vmware] Add VMware logfile console (CONSOLE_VMWARE)Michael Brown2012-02-291-0/+117
| | | | | | | Allow iPXE console output to be sent to the VMware logfile via the GuestRPC mechanism. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vmware] Add GuestRPC mechanismMichael Brown2012-02-296-0/+535
| | | | | | Use the VMware backdoor I/O port to access the GuestRPC mechanism. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Add RTC-based entropy sourceMichael Brown2012-02-283-0/+297
| | | | | | | | | | | The RTC-based entropy source uses the nanosecond-scale CPU TSC to measure the time between two 1kHz interrupts generated by the CMOS RTC. In a physical machine these clocks are driven from independent crystals, resulting in some observable clock drift. In a virtual machine, the CMOS RTC is typically emulated using host-OS constructions such as SIGALRM. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Add ANS X9.82 Approved Source of Entropy InputMichael Brown2012-02-212-0/+24
| | | | | | | | | | | | | | | | ANS X9.82 specifies several Approved Sources of Entropy Input (SEI). One such SEI uses an entropy source as the Source of Entropy Input, condensing each entropy source output after each GetEntropy call. This can be implemented relatively cheaply in iPXE and avoids the need to allocate potentially very large buffers. (Note that the terms "entropy source" and "Source of Entropy Input" are not synonyms within the context of ANS X9.82.) Use the iPXE API mechanism to allow entropy sources to be selected at compilation time. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [i386] Add missing #include <ipxe/io.h> in pic8259.hMichael Brown2012-02-191-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Fix missing underscore in libprefixTill Straumann2012-02-101-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Delay initrd image copy until memory map is readyMichael Brown2012-02-091-2/+8
| | | | | | | | | | | initrd_init() calls umalloc() to allocate space for the initrd image, but does so before hide_etherboot() has been called. It is therefore possible for the initrd to end up overwriting iPXE itself. Fix by converting initrd_init() from an init_fn to a startup_fn. Originally-fixed-by: Till Straumann <strauman@slac.stanford.edu> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [lkrnprefix] Copy command line before installing iPXEMichael Brown2012-01-182-5/+41
| | | | | | | | | | | | The command line may be situated in an area of base memory that will be overwritten by iPXE's real-mode segments, causing the command line to be corrupted before it can be used. Fix by creating a copy of the command line on the prefix stack (below 0x7c00) before installing the real-mode segments. Reported-by: Dave Hansen <dave@sr71.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Provide PXENV_FILE_EXIT_HOOK only for ipxelinux.0 buildsMichael Brown2011-12-116-53/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PXENV_FILE_EXIT_HOOK is designed to allow ipxelinux.0 to unload both the iPXE and pxelinux components without affecting the underlying PXE stack. Unfortunately, it causes unexpected behaviour in other situations, such as when loading a non-embedded pxelinux.0 via undionly.kpxe. For example: PXE ROM -> undionly.kpxe -> pxelinux.0 -> chain.c32 to boot hd0 would cause control to return to iPXE instead of booting from the hard disk. In some cases, this would result in a harmless but confusing "No more network devices" message; in other cases stranger things would happen, such as being returned to the iPXE shell prompt. The fundamental problem is that when pxelinux detects PXENV_FILE_EXIT_HOOK, it may attempt to specify an exit hook and then exit back to iPXE, assuming that iPXE will in turn exit cleanly via the specified exit hook. This is not a valid assumption in the general case, since the action of exiting back to iPXE does not directly cause iPXE to exit itself. (In the specific case of ipxelinux.0, this will work since the embedded script exits as soon as pxelinux.0 exits.) Fix the unexpected behaviour in the non-ipxelinux.0 cases by including support for PXENV_FILE_EXIT_HOOK only when using a new .kkkpxe format. The ipxelinux.0 build process should therefore now use undionly.kkkpxe instead of undionly.kkpxe. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Modularise PXE API provisionMichael Brown2011-12-118-468/+272Star
| | | | | | | Use the linker table infrastructure to dispatch PXE API calls to the relevant function. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Tidy up debugging outputMichael Brown2011-12-081-13/+16
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Check for a valid PXE network device when applicableMichael Brown2011-12-082-11/+213
| | | | | | | | | Very nasty things can happen if a NULL network device is used. Check that pxe_netdev is non-NULL at the applicable entry points, so that this type of problem gets reported to the caller rather than being allowed to crash the system. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Retry PXENV_UNDI_INITIALIZE multiple timesMichael Brown2011-12-081-8/+30
| | | | | | | | | | | | | | | | On at least one PXE stack (Realtek r8169), PXENV_UNDI_INITIALIZE has been observed to fail intermittently due to a media test failure (PXE error 0x00000061). Retrying the call to PXENV_UNDI_INITIALIZE succeeds, and the NIC is then usable. It is worth noting that this particular Realtek PXE stack is already known to be unreliable: for example, it repeatably fails its own boot-time media test after every warm reboot. Fix by attempting PXENV_UNDI_INITIALIZE multiple times, with a short delay between each attempt to allow the link to settle. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Improve pxe_preboot debugging messagesMichael Brown2011-11-141-23/+48
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Improve pxe_undi debugging messagesMichael Brown2011-11-141-76/+84
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Allow an initrd to be passed to iPXEMichael Brown2011-11-124-124/+262
| | | | | | | | Allow an initrd (such as an embedded script) to be passed to iPXE when loaded as a .lkrn (or .iso) image. This allows an embedded script to be varied without recompiling iPXE. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Allow prefix to specify an arbitrary maximum address for relocationMichael Brown2011-11-125-38/+33Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Use stack rather than %ebp as temporary storage areaMichael Brown2011-11-111-11/+14
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Ensure that native drivers are tried before the UNDI PCI driverMichael Brown2011-11-111-1/+1
| | | | | Suggested-by: Alessandro Salvatori <sandr8@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Use meaningful driver and device namesMichael Brown2011-10-281-2/+10
| | | | | | | | | Specify a driver name of "undionly" and a device name based on the UNDI-reported underlying hardware device. For example: net0: 52:54:00:12:34:56 using undionly on UNDI-PCI00:03.0 (open) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Use current (rather than permanent) link-layer addressMichael Brown2011-10-281-0/+1
| | | | | Requested-by: Savitha Hiriyannaia <Savitha.Hiriyannaiah@emulex.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [liba20] Preserve all non-segment registers when calling INT 15,2401Michael Brown2011-10-251-3/+6
| | | | | | | | Some BIOSes are reported to corrupt %ebx when using INT 15,2401 (see http://opensolaris.org/jive/thread.jspa?messageID=377026). Guard against this by preserving all (non-segment) registers. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [librm] Avoid (harmless) collisions with linker symbolsMichael Brown2011-10-251-14/+14
| | | | | | | | The symbol_text16 is defined globally by the linker. Use rm_text16 instead of _text16 for the local variable within librm.S to avoid confusion when reading linker maps. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Eliminate the register_and_xxx_image() functionsMichael Brown2011-10-251-2/+2
| | | | | | | | All users of imgdownload() require registration of the image, so make registration an integral part of imgdownload() itself and simplify the "action" parameter to be one of image_select(), image_exec() et al. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [lkrnprefix] Fix lost command line passed by grubValentine Barshak2011-08-071-1/+1
| | | | | | | | | iPXE specifies a value of 0 for cmdline_size, causing GRUB to not pass in a command line. Fix by setting cmdline_size to the maximum value of 2047. Signed-off-by: Valentine Barshak <gvaxon@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Fix romprefix build with certain versions of binutilsValentine Barshak2011-08-071-2/+2
| | | | | Signed-off-by: Valentine Barshak <gvaxon@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Allow link layer to report broadcast/multicast packets via pull()Michael Brown2011-07-151-7/+7
| | | | | | | | Allow the link layer to directly report whether or not a packet is multicast or broadcast at the time of calling pull(), rather than relying on heuristics to determine this at a later stage. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Add symbolic definitions for DHCP client architecture valuesMichael Brown2011-07-063-4/+7
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Provide a permanently closed window via the control interfaceMichael Brown2011-06-281-0/+15
| | | | | | | Allow objects to support both streaming and block device protocols, by starting streaming data only when the data transfer window opens. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Cope with BOOT_IMAGE= anywhere within command lineMichael Brown2011-06-281-4/+14
| | | | | | | | Some bootloaders seem to add "BOOT_IMAGE=..." at the end of the command line; some at the start. Cope with either variation. Reported-by: Dave Hansen <dave@sr71.net> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Force PnP header to a 16-byte boundary for IBM BIOSesMichael Brown2011-05-171-0/+5
| | | | | | | | | | IBM BIOSes ignore the PnP header offset stored at address 0x1a and instead scan for the $PnP signature on a 16-byte boundary. (This alignment is not mandated by the PnP specification.) Force PnP header to a 16-byte boundary to work around these BIOSes. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Do not fall back to hooking INT19 by defaultMichael Brown2011-05-171-0/+2
| | | | | | | | | | | | | | | | | | | | Several BIOSes (including most IBM BIOSes and many virtual machine BIOSes) do not provide detectable PnP support, but will use the BEV entry point for a PnP option ROM. On these semi-PnP BIOSes, iPXE will respond to the absence of detectable PnP support by hooking INT19, which disrupts the boot order. BIOSes that genuinely require hooking INT19 seem to be very rare nowadays. It may therefore be preferable to assume that the absence of detectable PnP support indicates a semi-PnP BIOS rather than a non-PnP BIOS. Change the default behaviour so that INT19 will never be hooked unless the compile-time option NONPNP_HOOK_INT19 is enabled. Leave the redundant PnP detection routine in-place to allow for debugging via the ROM banner line. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Remove special treatment for IBM BIOSesMichael Brown2011-05-171-20/+6Star
| | | | | | | | Revert commit 38cd351 ("[romprefix] Attempt to gracefully handle semi-PnP IBM BIOSes"), since the test for the "IBM " signature in %edi is not sufficient to identify an IBM BIOS. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Attempt to gracefully handle semi-PnP IBM BIOSesMichael Brown2011-05-041-6/+20
| | | | | | | | | | | Some IBM BIOSes provide partial support for PnP: they will use the BEV entry point but will not advertise PnP support. This causes iPXE to hook INT 19, which disrupts the boot process. Attempt to improve this situation by detecting an IBM BIOS and treating it as a PnP BIOS despite the absence of a PnP signature. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix building on mildly deranged versions of binutilsMichael Brown2011-04-291-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some versions of binutils have curious concepts of what constitutes subtraction. For example: 0x00000000000000f0 _text16_late = . 0x0000000000000898 _mtext16 = . 0x0000000000000898 _etext16 = . 0x0000000000000898 _text16_late_filesz = ABSOLUTE ((_mtext16 - _text16_late)) 0x00000000000007a8 _text16_late_memsz = ABSOLUTE ((_etext16 - _text16_late)) This has interesting side-effects such as producing sizes for .bss segments that are negative, causing the majority of addressable memory to be zeroed out. Fix by using the form ABSOLUTE ( x ) - ABSOLUTE ( y ) rather than ABSOLUTE ( x - y ) Reported-by: H. Peter Anvin <hpa@zytor.com> Suggested-by: H. Peter Anvin <hpa@zytor.com> Tested-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Catch INT 13,4b when no explicit drive number is presentMichael Brown2011-04-281-2/+7
| | | | | | | | | This allows older versions of ELTORITO.SYS (such as the version found on the FreeDOS installation CD-ROM) to use iPXE's emulated CD-ROM drive. Reported-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Add support for INT 13,4bMichael Brown2011-04-281-4/+46
| | | | | | | This allows the ELTORITO.SYS driver for MS-DOS to access our emulated CD-ROM drives. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Add support for El Torito bootable CD-ROM imagesMichael Brown2011-04-272-48/+486
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Avoid building Linux-specific prefix on non-Linux buildsMichael Brown2011-04-272-0/+0
| | | | | Reported-by: David Yeske <dyeske@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [sanboot] Add "sanhook" and "sanunhook" commandsMichael Brown2011-04-243-10/+16
| | | | | | | Expose the multiple-SAN-drive capability of the iPXE core via the iPXE command line by adding commands to hook and unhook additional drives. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Assume that interrupts are not supported if IRQ=0Michael Brown2011-04-231-1/+3
| | | | | | | | | Some PXE stacks (notably old Etherboot/gPXE stacks) will claim to use the timer interrupt, rather than reporting that interrupts are not supported. Since using the timer interrupt is equivalent to polling anyway, we may as well genuinely poll these stacks. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Avoid unused-but-set variable warning in gcc 4.6Thomas Miletich2011-03-281-2/+2
| | | | | | | | | Temporary modification to prevent valgrind.h from breaking compilation with gcc 4.6. When this problem is fixed upstream, a new and unmodified copy of valgrind.h should be imported. Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [exeprefix] Add .exe prefixMichael Brown2011-03-282-0/+158
| | | | | | | | | | An iPXE .exe image can be loaded from DOS. Tested using bin/ipxe.exe to load a Linux kernel and simple initramfs from within MS-DOS 6.22. (EDD must be disabled using the "edd=off" kernel parameter, since the loaded kernel image has already overwritten parts of DOS' INT 13 wrapper.) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Avoid using base memory for temporary decompression areaMichael Brown2011-03-281-3/+7
| | | | | | | | In the unlikely (but observable) event that INT 15,88 returns less memory above 1MB than is required for the temporary decompression area, ignore it and use the 1MB point anyway. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Make malloc and linux_umalloc valgrindablePiotr Jaroszyński2011-03-276-6/+4859
| | | | | | | | | | Make the allocators used by malloc and linux_umalloc valgrindable. Include valgrind headers in the codebase to avoid a build dependency on valgrind. Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>