summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/include
Commit message (Collapse)AuthorAgeFilesLines
...
* [i386] Use memory address constraints in __bswap_16s() and __bswap_64s()Michael Brown2012-03-041-4/+3Star
| | | | | | | | Minimise code size by forcing the use of memory addresses for __bswap_16s() and __bswap_64s(). (__bswap_32s() cannot avoid loading the value into a register.) Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [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>
* [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>
* [vmware] Add GuestRPC mechanismMichael Brown2012-02-293-0/+151
| | | | | | 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-282-0/+64
| | | | | | | | | | | 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-211-0/+12
| | | | | | | | | | | | | | | | 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>
* [pxe] Provide PXENV_FILE_EXIT_HOOK only for ipxelinux.0 buildsMichael Brown2011-12-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-112-120/+47Star
| | | | | | | Use the linker table infrastructure to dispatch PXE API calls to the relevant function. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Allow an initrd to be passed to iPXEMichael Brown2011-11-121-0/+1
| | | | | | | | 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>
* [dhcp] Add symbolic definitions for DHCP client architecture valuesMichael Brown2011-07-062-2/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Add support for El Torito bootable CD-ROM imagesMichael Brown2011-04-271-0/+133
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [sanboot] Add "sanhook" and "sanunhook" commandsMichael Brown2011-04-242-3/+11
| | | | | | | 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>
* [image] Simplify use of imgdownload()Michael Brown2011-03-091-3/+0Star
| | | | | | | 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>
* [bzimage] Increase maximum command-line size to 0x7ffJarrod Johnson2010-11-131-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Include disk signature in debugging outputMichael Brown2010-09-221-2/+7
| | | | | | | The disk signature is used by some OSes (notably Windows) to identify the boot disk, so it's useful debugging information to have. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Add infrastructure to support EDD version 4.0Michael Brown2010-09-221-4/+27
| | | | | | | | | | | | | | | | | | | | | | Support the extensions mandated by EDD 4.0, including: o the ability to specify a flat physical address in a disk address packet, o the ability to specify a sector count greater than 127 in a disk address packet, o support for all functions within the Fixed Disk Access and EDD Support subsets, o the ability to describe a device using EDD Device Path Information. This implementation is based on draft revision 3 of the EDD 4.0 specification, with reference to the EDD 3.0 specification. It is possible that this implementation may need to change in order to conform to the final published EDD 4.0 specification. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [block] Replace gPXE block-device API with an iPXE asynchronous interfaceMichael Brown2010-09-147-524/+36Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The block device interface used in gPXE predates the invention of even the old gPXE data-transfer interface, let alone the current iPXE generic asynchronous interface mechanism. Bring this old code up to date, with the following benefits: o Block device commands can be cancelled by the requestor. The INT 13 layer uses this to provide a global timeout on all INT 13 calls, with the result that an unexpected passive failure mode (such as an iSCSI target ACKing the request but never sending a response) will lead to a timeout that gets reported back to the INT 13 user, rather than simply freezing the system. o INT 13,00 (reset drive) is now able to reset the underlying block device. INT 13 users, such as DOS, that use INT 13,00 as a method for error recovery now have a chance of recovering. o All block device commands are tagged, with a numerical tag that will show up in debugging output and in packet captures; this will allow easier interpretation of bug reports that include both sources of information. o The extremely ugly hacks used to generate the boot firmware tables have been eradicated and replaced with a generic acpi_describe() method (exploiting the ability of iPXE interfaces to pass through methods to an underlying interface). The ACPI tables are now built in a shared data block within .bss16, rather than each requiring dedicated space in .data16. o The architecture-independent concept of a SAN device has been exposed to the iPXE core through the sanboot API, which provides calls to hook, unhook, boot, and describe SAN devices. This allows for much more flexible usage patterns (such as hooking an empty SAN device and then running an OS installer via TFTP). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Add linux api headersPiotr Jaroszyński2010-08-191-0/+6
| | | | | Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [comboot] Run com32 programs with a valid IDTGeoff Lywood2010-08-011-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | COM32 binaries generally expect to run with interrupts enabled. Syslinux does so, and COM32 programs will execute cli/sti pairs when running a critical section, to provide mutual exclusion against BIOS interrupt handlers. Previously, under iPXE, the IDT was not valid, so any interrupt (e.g. a timer tick) would generally cause the machine to triple fault. This change introduces code to: - Create a valid IDT at the same location that syslinux uses - Create an "interrupt jump buffer", which contains small pieces of code that simply record the vector number and jump to a common handler - Thunk down to real mode and execute the BIOS's interrupt handler whenever an interrupt is received in a COM32 program - Switch IDTs and enable/disable interrupts when context switching to and from COM32 binaries Testing done: - Booted VMware ESX using a COM32 multiboot loader (mboot.c32) - Built with GDBSERIAL enabled, and tested breakpoints on int22 and com32_irq - Put the following code in a COM32 program: asm volatile ( "sti" ); while ( 1 ); Before this change, the machine would triple fault immediately. After this change, it hangs as expected. Under Bochs, it is possible to see the interrupt handler run, and the current time in the BIOS data area gets incremented. Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Remove PACKED macroMichael Brown2010-05-304-70/+70
| | | | | | | Most of iPXE uses __attribute__((packed)) anyway, and PACKED conflicts with an identically-named macro in the upstream EFI header files. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Use correct DHCP options on EFI systemsGeoff Lywood2010-05-292-0/+80
| | | | | | | | See RFC 4578 for details. Signed-off-by: Joshua Oreman <oremanj@rwcr.net> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Use weak definitions instead of weak declarationsJoshua Oreman2010-05-271-19/+1Star
| | | | | | | | | | | | | | | 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>
* [pxe] Treat PXENV_RESTART_TFTP as unreturnableMichael Brown2010-05-211-0/+4
| | | | | | | | | | | | | | | | | | | | | | | 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>
* [librm] Use libflat to enable A20 line on each real-to-protected transitionMichael Brown2010-04-202-12/+0Star
| | | | | | | | | | | | | 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>
* [build] Rename gPXE to iPXEMichael Brown2010-04-2021-60/+60
| | | | | | | | | | | 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>
* [pxe] Remove pxe_set_cached_filename()Michael Brown2010-03-261-2/+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] Introduce PXE exit hook for NBP chainingShao Miller2010-01-242-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It might be the case that we wish to chain to an NBP without being "in the way". We now implement a hook in our exit path for gPXE *.*pxe build targets. The hook is a pointer to a SEG16:OFF16 which we try to jump to during exit. By default, this pointer results in the usual exit path. We also implement the "pxenv_file_exit_hook" PXE API routine to allow the user to specify an alternate SEG16:OFF16 to jump to during exit. Unfortunately, this additional PXE extension has a cost in code size. Fortunately, a look at the size difference for a gPXE .rom build target shows zero size difference after compression. The routine is documented in doc/pxe_extensions as follows: FILE EXIT HOOK Op-Code: PXENV_FILE_EXIT_HOOK (00e7h) Input: Far pointer to a t_PXENV_FILE_EXIT_HOOK parameter structure that has been initialized by the caller. Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The Status field in the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx constants. Description:Modify the exit path to jump to the specified code. Only valid for pxeprefix-based builds. typedef struct s_PXENV_FILE_EXIT_HOOK { PXENV_STATUS_t Status; SEGOFF16_t Hook; } t_PXENV_FILE_EXIT_HOOK; Set before calling API service: Hook: The SEG16:OFF16 of the code to jump to. Returned from API service: Status: See PXENV_STATUS_xxx constants. Requested-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca> Signed-off-by: Marty Connor <mdc@etherboot.org>
* [config] Make PXE stack a compile-time optionJoshua Oreman2010-01-201-0/+19
| | | | | | | | | | For extremely tight space requirements and specific applications, it is sometimes desirable to create gPXE images that cannot provide the PXE API functionality to client programs. Add a configuration header option, PXE_STACK, that can be removed to remove this stack. Also add PXE_MENU to control the PXE boot menu, which most uses of gPXE do not need. Signed-off-by: Marty Connor <mdc@etherboot.org>
* [pxe] Separate parent PXE API caller from UNDINET driverJoshua Oreman2010-01-202-0/+12
| | | | | | | | | Calling the parent PXE stack (the stack that loaded us, for undionly.kkpxe) can be useful for more than UNDI calls; for instance, it lets us get cached DHCP packets to avoid re-DHCP when working with embedded images. Signed-off-by: Marty Connor <mdc@etherboot.org>
* [infiniband] Add support for the SRP Boot Firmware TableMichael Brown2009-08-101-0/+125
| | | | | | The SRP Boot Firmware Table serves a similar role to the iSCSI and AoE Boot Firmware Tables; it provides information required by the loaded OS in order to establish a connection back to the SRP boot device.
* [pxe] Dual-license pxe_api.h under the MIT licenseH. Peter Anvin2009-08-031-0/+25
| | | | | | | | | pxe_api.h is just a description of API functions, it's actively undesirable to have more implementations than necessary. Allowing it under the MIT license lets the Syslinux libraries use it. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [pxe] Create pxe_[de]activate() wrapper functionsMichael Brown2009-06-281-2/+4
| | | | | Merge the pxe_set_netdev()+pxe_[un]hook_int1a() pattern into a single pxe_[de]activate() call.
* [pxe] Make pxe_init_structures() an initialisation functionMichael Brown2009-06-281-1/+0Star
| | | | | | | | | pxe_init_structures() fills in the fields of the !PXE and PXENV+ structures that aren't known until gPXE starts up. Once gPXE is started, these values will never change. Make pxe_init_structures() an initialisation function so that PXE users don't have to worry about calling it.
* [pxe] Fix interoperability with the Intel DOS UNDI driverMichael Brown2009-06-231-0/+19
| | | | | | | | The Intel DOS UNDI driver fails when run on top of gPXE because we do not fill in the ServiceFlags field in PXENV_UNDI_GET_IFACE_INFO. Fix by filling in the ServiceFlags field with reasonable values indicating our approximate feature capabilities.
* [misc] Fix source files erroneously marked as executableMichael Brown2009-06-021-0/+0
|
* [legal] Add a selection of FILE_LICENCE declarationsMichael Brown2009-05-1847-0/+94
| | | | | Add FILE_LICENCE declarations to almost all files that make up the various standard builds of gPXE.
* [i386] Remove long-obsolete callbacks_arch.h fileMichael Brown2009-04-261-243/+0Star
|
* [build] Use __SIZE_TYPE__ macro in definition of size_tJoshua Oreman2009-03-311-2/+2
| | | | | | | This is required in order to build on Mac OS X. Modified-by: Michael Brown <mcb30@etherboot.org> Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [bzimage] Support old (pre-2.00 bootloader) Linux kernel formatsMichael Brown2009-03-301-0/+3
| | | | | | | | | | This allows gPXE to load memtest86, which is packaged as an old kernel. Split all code that directly touches the kernel headers out into bzimage_parse_header() and bzimage_update_header(), to reduce code size and offset the cost of supporting older kernels. Total cost of this feature: 11 bytes (uncompressed).
* [pxeprefix] Add .kkpxe image type and ability to return via PXE stackMichael Brown2009-02-181-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Certain combinations of PXE stack and BIOS result in a broken INT 18 call, which will leave the system displaying a "PRESS ANY KEY TO REBOOT" message instead of proceeding to the next boot device. On these systems, returning via the PXE stack is the only way to continue to the next boot device. Returning via the PXE stack works only if we haven't already blown away the PXE base code in pxeprefix.S. In most circumstances, we do want to blow away the PXE base code. Base memory is a limited resource, and it is desirable to reclaim as much as possible. When we perform an iSCSI boot, we need to place the iBFT above the 512kB mark, because otherwise it may not be detected by the loaded OS; this may not be possible if the PXE base code is still occupying that memory. Introduce a new prefix type .kkpxe which will preserve both the PXE base code and the UNDI driver (as compared to .kpxe, which preserves the UNDI driver but uninstalls the PXE base code). This prefix type can be used on systems that are known to experience the specific problem of INT 18 being broken, or in builds (such as gpxelinux.0) for which it is particularly important to know that returning to the BIOS will work. Written by H. Peter Anvin <hpa@zytor.com> and Stefan Hajnoczi <stefanha@gmail.com>, minor structural alterations by Michael Brown <mcb30@etherboot.org>.
* [comboot] Implement INT 22h AX=001Bh (Cleanup, shuffle, and boot to real mode)Daniel Verkamp2009-02-171-0/+34
|
* [comboot] Restore the real-mode stack pointer on exit from a COMBOOT imageMichael Brown2009-02-172-6/+32
| | | | | | | | | | | | | COMBOOT images use INTs to issue API calls; these end up making calls into gPXE from real mode, and so temporarily change the real-mode stack pointer. When our COMBOOT code uses a longjmp() to implement the various "exit COMBOOT image" API calls, this leaves the real-mode stack pointer stuck with its temporary value, which causes problems if we eventually try to exit out of gPXE back to the BIOS. Fix by adding rmsetjmp() and rmlongjmp() calls (analogous to sigsetjmp()/siglongjmp()); these save and restore the additional state needed for real-mode calls to function correctly.
* [comboot] Unhook interrupt vectors after returning from a COMBOOT imageMichael Brown2009-02-171-0/+1
|
* [comboot] Allow for tail recursion of COMBOOT imagesMichael Brown2009-02-172-9/+6Star
| | | | | | | | | | | | Multi-level menus via COMBOOT rely on the COMBOOT program being able to exit and invoke a new COMBOOT program (the next menu). This works, but rapidly (within about five iterations) runs out of space in gPXE's internal stack, since each new image is executed in a new function context. Fix by allowing tail recursion between images; an image can now specify a replacement image for itself, and image_exec() will perform the necessary tail recursion.
* [x86_64] Add support for compilation as an x86_64 binaryMichael Brown2008-12-057-595/+7Star
| | | | | | | | | | | | Currently the only supported platform for x86_64 is EFI. Building an EFI64 gPXE requires a version of gcc that supports __attribute__((ms_abi)). This currently means a development build of gcc; the feature should be present when gcc 4.4 is released. In the meantime; you can grab a suitable gcc tree from git://git.etherboot.org/scm/people/mcb30/gcc/.git
* [efi] Use EFI-native mechanism for accessing SMBIOS tableMichael Brown2008-12-054-62/+29Star
| | | | | | EFI provides a copy of the SMBIOS table accessible via the EFI system table, which we should use instead of manually scanning through the F000:0000 segment.
* [i386] Move iSCSI and AoE boot code to arch/i386/interface/pcbiosMichael Brown2008-11-192-0/+335
|
* [i386] Change [u]int32_t to [unsigned] int, rather than [unsigned] longMichael Brown2008-11-192-3/+3
| | | | | | This brings us in to line with Linux definitions, and also simplifies adding x86_64 support since both platforms have 2-byte shorts, 4-byte ints and 8-byte long longs.
* [libgcc] Make __libgcc architecture-specificMichael Brown2008-11-191-0/+14
|