summaryrefslogtreecommitdiffstats
path: root/src/arch
Commit message (Collapse)AuthorAgeFilesLines
...
* [bzimage] Allow file mode to be specified for standalone initrd filesMichael Brown2012-08-031-3/+37
| | | | | | | | | | Allow the file mode to be specified using a "mode=" command line parameter. For example: initrd http://web/boot/bootlocal.sh /opt/bootlocal.sh mode=755 Requested-by: Bryce Zimmerman <bryce.zimmerman@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Round up PMM allocation sizes to nearest 4kBMichael Brown2012-07-251-1/+5
| | | | | | | | | | | | Some AMI BIOSes apparently break in exciting ways when asked for PMM allocations for sizes that are not multiples of 4kB. Fix by rounding up the image source area to the nearest 4kB. (The temporary decompression area is already rounded up to the nearest 128kB, to facilitate sharing between multiple iPXE ROMs.) Reported-by: Itay Gazit <itayg@mellanox.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Fix building under CygwinJoshua Oreman2012-07-241-1/+1
| | | | | | | Cygwin's assembler treats '/' as a comment character. Reported-by: Steve Goodrich <steve.goodrich@se-eng.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix building under OpenBSDThomas Miletich2012-07-241-0/+2
| | | | | | | | | Similarly to FreeBSD, OpenBSD requires the object format to be specified as elf_i386_obsd rather than elf_i386. Reported-by: Jiri B <jirib@devio.us> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vmware] Fix compilation under OpenBSDThomas Miletich2012-07-231-1/+1
| | | | | Reported-by: Jiri B <jirib@devio.us> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Report a pessimistic runtime size estimateMichael Brown2012-07-231-5/+23
| | | | | | | | | | | | | | | | PCI3.0 allows us to report a "runtime size" which can be smaller than the actual ROM size. On systems that support PMM our runtime size will be small (~2.5kB), which helps to conserve the limited option ROM space. However, there is no guarantee that the PMM allocation will succeed, and so we need to report the worst-case runtime size in the PCI header. Move the "shrunk ROM size" field from the PCI header to a new "iPXE ROM header", allowing it to be accessed by ROM-manipulation utilities such as disrom.pl. Reported-by: Anton D. Kachalov <mouse@yandex-team.ru> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-2066-66/+132
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxeprefix] Ignore errors from PXENV_FILE_CMDLINEMichael Brown2012-07-181-4/+2Star
| | | | | | | | | PXENV_FILE_CMDLINE is an iPXE extension, and will not be supported by most PXE stacks. Do not report any errors to the user, since in almost all cases the error will mean simply "not loaded by iPXE". Reported-by: Patrick Domack <patrickdk@patrickdk.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ioapi] Generalise i386 raw I/O API to x86Michael Brown2012-07-174-21/+22
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Reopen network device if NBP exitsMichael Brown2012-07-121-0/+7
| | | | | | | | Attempt to restore the network device to the state it was in prior to calling the NBP. This simplifies the task of taking follow-up action in an iPXE script. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxeprefix] Fetch command line (if any) via PXENV_FILE_CMDLINEMichael Brown2012-07-111-0/+38
| | | | | | | Use PXENV_FILE_CMDLINE to retrieve the command line (if any) provided by the invoking PXE stack. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxe] Add PXENV_FILE_CMDLINE API callMichael Brown2012-07-114-0/+69
| | | | | | | Allow a PXE NBP to obtain its command line (if any) via the new PXE API call PXENV_FILE_CMDLINE. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pxeprefix] Place temporary stack after iPXE binaryMichael Brown2012-07-101-3/+18
| | | | | | | | | | | | | | Some BIOSes (observed on a Supermicro system with an AMI BIOS) seem to use the area immediately below 0x7c00 to store data related to the boot process. This data is currently liable to be overwritten by the temporary stack used while decompressing and installing iPXE. Try to avoid any such problems by placing the temporary stack immediately after the loaded iPXE binary. Any memory used by the stack could then potentially have been overwritten anyway by a larger binary. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bzimage] Update setup_move_size only for protocol versions 2.00 and 2.01Michael Brown2012-07-091-1/+2
| | | | | | | | | | | | | | | | | | | | The setup_move_size field is not defined in protocol versions earlier than 2.00 (and is obsolete in versions later than 2.01). In binaries using versions earlier than 2.00, the relevant location is likely to contain executable code. Interestingly, this bug has been present since support for pre-2.00 protocol versions was added in 2009, and has been unexpectedly modifying the memtest86+ code fragment: mov $0x92, %dx inb %dx, %al Fortuitously, the modification exactly overwrote the value loaded into %dx, and so the net effect was limited to causing Fast Gate A20 detection to always fail. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [undi] Align the received frame payload for faster processingMichael Brown2012-06-291-8/+16
| | | | | | | | The undinet driver always has to make a copy of the received frame into an I/O buffer. Align this copy sensibly so that subsequent operations are as fast as possible. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Add faster algorithm for calculating the TCP/IP checksumMichael Brown2012-06-282-0/+174
| | | | | | | | | The generic TCP/IP checksum implementation requires approximately 10 CPU clocks per byte (as measured using the TSC). Improve this to approximately 0.5 CPU clocks per byte by using "lodsl ; adcl" in an unrolled loop. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Allow for architecture-specific TCP/IP checksum routinesMichael Brown2012-06-271-0/+12
| | | | | | | Calculating the TCP/IP checksum on received packets accounts for a substantial fraction of the response latency. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Simplify memcpy() implementationMichael Brown2012-06-271-16/+10Star
| | | | | | | | The "rep" prefix can be used with an iteration count of zero, which allows the variable-length memcpy() to be implemented without using any conditional jumps. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Treat 0xffffffff as an error return from PMMMichael Brown2012-06-191-9/+13
| | | | | | | | PMM defines the return code 0xffffffff as meaning "unsupported function". It's hard to imagine a PMM BIOS that doesn't support pmmAllocate(), but apparently such things do exist. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Allow .mrom image to be placed anywhere within the BARMichael Brown2012-06-121-0/+12
| | | | | | | | | | | A .mrom image currently assumes that it is the first image within the expansion ROM BAR, which may not be correct when multiple images are present. Fix by scanning through the BAR until we locate an image matching our build ID. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Add a dummy ROM header to cover the .mrom payloadMichael Brown2012-06-124-65/+135
| | | | | | | | | | | | | The header of a .mrom image declares its length to be only a few kilobytes; the remainder is accessed via a sideband mechanism. This makes it difficult to append an additional ROM image, such as an EFI ROM. Add a second, dummy ROM header covering the payload portion of the .mrom image, allowing consumers to locate any appended ROM images in the usual way. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Use "cpuid --ext" instead of "cpuid --amd"Michael Brown2012-06-121-1/+4
| | | | | | | Avoid potential confusion in the documentation by using a vendor-neutral name for the extended (AMD-defined) feature set. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Add "cpuid" commandMichael Brown2012-06-077-161/+306
| | | | | | | Allow x86 CPU feature flags (such as support for 64-bit mode) to be checked using the "cpuid" command. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Merge i386 and x86_64 versions of errfile.hMichael Brown2012-06-062-11/+0Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Remove non-working image loadersMarin Hannache2012-04-244-801/+0Star
| | | | | | | | | | The WinCE, a.out and FreeBSD loaders are designed to be #included by core/loader.c, which no longer exists. These old loaders are not usable anymore and cause compilation failures when enabled in config/general.h. Signed-off-by: Marin Hannache <mareo@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [multiboot] Place multiboot modules low in memoryMichael Brown2012-04-192-48/+53
| | | | | | | | | | | | | | | Solaris assumes that there is enough space above the Multiboot modules to use as a decompression and scratch area. This assumption is invalid when using iPXE, which places the Multiboot modules near the top of (32-bit) memory. Fix by copying the modules to an area of memory immediately following the loaded kernel. Debugged-by: Michael Brown <mcb30@ipxe.org> Debugged-by: Scott McWhirter <scottm@joyent.com> Tested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [vmware] Allow settings to be specified in the VMware .vmx fileMichael Brown2012-04-172-0/+282
| | | | | | | | | | | | | Allow iPXE settings to be specified in the .vmx file via the VMware GuestInfo mechanism. For example: guestinfo.ipxe.filename = "http://boot.ipxe.org/demo/boot.php" guestinfo.ipxe.dns = "192.168.0.1" guestinfo.ipxe.net0.ip = "192.168.0.15" guestinfo.ipxe.net0.netmask = "255.255.255.0" guestinfo.ipxe.net0.gateway = "192.168.0.1" Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Allow strtoul() to interpret negative numbersMichael Brown2012-04-171-0/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [multiboot] Include full image URI in command lineMichael Brown2012-04-151-21/+30
| | | | | | | | | | | | Solaris kernels seem to rely on having the full kernel path present in the multiboot command line; if only the kernel name is present then the boot fails with the error message krtld: failed to open 'unix' Debugged-by: Michael Brown <mcb30@ipxe.org> Debugged-by: Scott McWhirter <scottm@joyent.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Fix a build error on some platformsMarin Mareo Hannache2012-04-101-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Fix compilation on some versions of gccMichael Brown2012-04-101-4/+3Star
| | | | | | | | | Using __from_text16() and __from_data16() in inline asm constraints sometimes defeats gcc's ability to simplify expressions down to compile-time constants. Reported-by: Jason Kohles <jkohles@palantir.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [int13] Add support for emulating floppy disk drivesMichael Brown2012-03-303-56/+297
| | | | | Tested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bios] Recognise Page Up and Page Down keysMichael Brown2012-03-291-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Remove "log message" usage from interactive console defaultsMichael Brown2012-03-272-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [umalloc] Unhide umalloc()ed memory region when there are no allocationsMichael Brown2012-03-271-1/+2
| | | | | | | | At present, we always hide an extra sizeof(struct external_memory), to account for the header on the lowest allocated block. This header ceases to exist when there are no allocated blocks remaining. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [umalloc] Fail allocations when we run out of external memoryMichael Brown2012-03-271-7/+22
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Do not share ANSI escape context between lineconsole usersMichael Brown2012-03-261-0/+8
| | | | | | | | An ANSI escape sequence context cannot be shared between multiple users. Make the ANSI escape sequence context part of the line console definition and provide individual contexts for each user. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Exclude text-based UI output from logfile-based consolesMichael Brown2012-03-261-1/+1
| | | | | | | | The output from text-based user interfaces such as the "config" command is not generally meaningful for logfile-based consoles such as syslog and vmconsole. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [console] Allow usage to be defined independently for each consoleMichael Brown2012-03-263-0/+25
| | | | | | | | | | | | | | | | | | | | | Add the concept of a "console usage", such as "standard output" or "debug messages". Allow usages to be associated with each console independently. For example, to send debugging output via the serial port, while preventing it from appearing on the local console: #define CONSOLE_SERIAL CONSOLE_USAGE_ALL #define CONSOLE_PCBIOS ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_DEBUG ) If no usages are explicitly specified, then a default set of usages will be applied. For example: #define CONSOLE_SERIAL will have the same affect as #define CONSOLE_SERIAL CONSOLE_USAGE_ALL Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [image] Simplify image management commands and internal APIMichael Brown2012-03-252-7/+19
| | | | | | | | | | | | | | | | | | | | | | Remove the name, cmdline, and action parameters from imgdownload() and imgdownload_string(). These functions now simply download and return an image. Add the function imgacquire(), which will interpret a "name or URI string" parameter and return either an existing image or a newly downloaded image. Use imgacquire() to merge similar image-management commands that currently differ only by whether they take the name of an existing image or the URI of a new image to download. For example, "chain" and "imgexec" can now be merged. Extend imgstat and imgfree commands to take an optional list of images. Remove the arbitrary restriction on the length of image names. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix compilation under CygwinMichael Brown2012-03-232-2/+2
| | | | | Originally-fixed-by: Steve Goodrich <steve.goodrich@se-eng.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [bios] Set character attributes only when necessaryMichael Brown2012-03-221-0/+8
| | | | | | | | | | | | | | | | | | | There is no INT 10 call for "display character with attribute, advancing the cursor and scrolling the screen as necessary". We therefore make two INT 10 calls: INT 10,09 to write the character with its attribute at the current cursor position, and then INT 10,0e to (re)write the character (leaving the attribute unchanged), advance the cursor position and scroll as necessary. This confuses the serial-over-LAN console redirection feature provided by some BIOSes. Fix by performing the INT10,09 only when necessary to change the existing attribute. Reported-by: Itay Gazit <itaygazit@gmail.com> Tested-by: Itay Gazit <itaygazit@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [time] Add RTC-based time sourceMichael Brown2012-03-195-39/+241
| | | | | | Add a time source using the CMOS RTC to obtain the current time. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [time] Define an API for getting the current timeMichael Brown2012-03-192-0/+24
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Use correct constraint for byte-addressable registerMichael Brown2012-03-191-1/+1
| | | | | Reported-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [rng] Allow entropy_enable() to return an errorMichael Brown2012-03-181-1/+4
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [crypto] Add big-integer library for RSA calculationsMichael Brown2012-03-142-0/+408
| | | | | | | | | | | | | | RSA requires modular exponentiation using arbitrarily large integers. Given the sizes of the modulus and exponent, all required calculations can be done without any further dynamic storage allocation. The x86 architecture allows for efficient large integer support via inline assembly using the instructions that take advantage of the carry flag (e.g. "adcl", "rcrl"). This implemention is approximately 80% smaller than the (more generic) AXTLS implementation. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [prefix] Eliminate uninitialised variableMichael Brown2012-03-091-0/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [x86_64] Use memory address constraint in __bswap_16s()Michael Brown2012-03-041-1/+1
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [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>