summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [settings] Add the notion of a "tag magic" to numbered settingsMichael Brown2008-10-307-25/+60
| | | | | | | | | | | | | | | | | | | Settings can be constructed using a dotted-decimal notation, to allow for access to unnamed settings. The default interpretation is as a DHCP option number (with encapsulated options represented as "<encapsulating option>.<encapsulated option>". In several contexts (e.g. SMBIOS, Phantom CLP), it is useful to interpret the dotted-decimal notation as referring to non-DHCP options. In this case, it becomes necessary for these contexts to ignore standard DHCP options, otherwise we end up trying to, for example, retrieve the boot filename from SMBIOS. Allow settings blocks to specify a "tag magic". When dotted-decimal notation is used to construct a setting, the tag magic value of the originating settings block will be ORed in to the tag number. Store/fetch methods can then check for the magic number before interpreting arbitrarily-numbered settings.
* [romprefix] Further sanity checks for the PCI 3 runtime segment addressMichael Brown2008-10-291-9/+22
| | | | | | | | | | | | | | | | This extends the sanity checks on the runtime segment address provided in %bx, first implemented in commit 5600955. We now allow the ROM to be placed anywhere above a000:0000 (rather than c000:0000, as before), since this is the region allowed by the PCI 3 spec. If the BIOS asks us to place the runtime image such that it would overlap with the init-time image (which is explicitly prohibited by the PCI 3 spec), then we assume that the BIOS is faulty and ignore the provided runtime segment address. Testing on a SuperMicro BIOS providing overlapping segment addresses shows that ignoring the provided runtime segment address is safe to do in these circumstances.
* [phantom] Add CLP settings interfaceMichael Brown2008-10-282-0/+368
| | | | | | This interface provides access to firmware settings (e.g. MAC address) that will apply to all drivers loaded for the duration of the current system boot.
* [phantom] Unhalt/halt all PEGs during driver startup/shutdownMichael Brown2008-10-282-0/+70
| | | | | | | | | | | A hardware bug means that reads through the expansion ROM BAR can return corrupted data if the PEGs are running. This breaks platforms that re-read the expansion ROM after invoking gPXE code, such as IBM blade servers. Halt PEGs during driver shutdown, and unhalt PEGs during driver startup if we detect that this is not the first startup since power-on.
* [phantom] Add line count limit to phantom_dmesg()Michael Brown2008-10-281-22/+57
| | | | | The Phantom firmware debug logs can be extremely long, so add the ability to restrict the output to the last N lines.
* [ioapi] Fix broken implementation of insX() in the x86 I/O APIMichael Brown2008-10-271-2/+2
|
* [uri] Avoid interpreting DOS-style path names as opaque URIsMichael Brown2008-10-241-2/+6
| | | | | | | | | | A DOS-style full path name such as "C:\Program Files\tftpboot\nbp.0" satisfies the syntax requirements for a URI with a scheme of "C" and an opaque portion of "\Program Files\tftpboot\nbp.0". Add a check in parse_uri() to ignore schemes that are apparently only a single character long; this avoids interpreting DOS-style paths in this way, and shouldn't affect any practical URI scheme.
* [phantom] Change register space abstraction to match other driversMichael Brown2008-10-242-54/+46Star
| | | | | | | Most other Phantom drivers define a register space in terms of a 64M virtual address space. While this doesn't map in any meaningful way to the actual addresses used on the latest cards, it makes maintenance easier if we do the same.
* [pcbios] Guard against register corruption in INT 15,e820 implementationsMichael Brown2008-10-232-3/+11
| | | | | | | | | | Someone at Dell must have a full-time job designing ways to screw up implementations of INT 15,e820. This latest gem is courtesy of a Dell Xanadu system, which arbitrarily decides to obliterate the contents of %esi. Preserve %esi, %edi and %ebp across calls to INT 15,e820, in case someone tries a variation on this trick in future.
* [settings] Avoid returning uninitialised data on error in fetch_xxx_setting()Michael Brown2008-10-221-5/+15
| | | | | | | | | | Callers (e.g. usr/autoboot.c) may not check the return values from fetch_xxx_setting(), assuming that in error cases the returned setting value will be "empty" (for some sensible value of "empty"). In particular, if the DHCP server did not specify a next-server address, this would result in gPXE using uninitialised data for the TFTP server IP address.
* [tftp] Add EUNIQ_xx values to differentiate the many EINVAL errorsMichael Brown2008-10-221-7/+16
|
* [tg3] Add PCI ID for BCM5786Michael Brown2008-10-211-0/+1
| | | | Contributed by Steve Cayford <cayfo001@umn.edu>
* [contrib] Add patch to enable writable ROM images in bochsMichael Brown2008-10-211-0/+20
| | | | | | | | Some of the gPXE romprefix.S code attempts to write to the ROM image, as allowed by the PCI spec. We do gracefully handle the case of read-only ROM images (for ISA ROMs and for normal bochs/qemu operation), but it can be handy to be able to use bochs to debug the code paths that depend on writable ROM images.
* [build] Fix building on FreeBSDMichael Brown2008-10-172-2/+14
| | | | | | | FreeBSD requires the object format to be specified as elf_i386_fbsd, rather than elf_i386. Based on a patch from Eygene Ryabinkin <rea-fbsd@codelabs.ru>
* [romprefix] Sanity-check the runtime segment address for PCI 3Michael Brown2008-10-171-0/+9
| | | | | | | | Some PCI 3 BIOSes seem to provide a garbage value in %bx, which should contain the runtime segment address. Perform a basic sanity check: we reject the segment if it is below the start of option ROM space. If the sanity check fails, we assume that the BIOS was not expecting us to be a PCI 3 ROM, and we just leave our image in situ.
* [build] Use ".bss.*" names for uninitialised-data sectionsMichael Brown2008-10-172-11/+11
| | | | | | | | | | | | | | | | | | | | | | The section name seems to have significance for some versions of binutils. There is no way to instruct gcc that sections such as .bss16 contain uninitialised data; it will emit them with contents explicitly set to zero. We therefore have to rely on the linker script to force these sections to become uninitialised-data sections. We do this by marking them as NOLOAD; this seems to be the closest semantic equivalent in the linker script language. However, this gets ignored by some versions of ld (including 2.17 as shipped with Debian Etch), which mark the resulting sections with (CONTENTS,ALLOC,LOAD,DATA). Combined with the fact that this version of ld seems to ignore the specified LMA for these sections, this means that they end up overlapping other sections, and so parts of .prefix (for example) get obliterated by .data16's bss section. Rename the .bss sections from .section_bss to .bss.section; this seems to cause these versions of ld to treat them as uninitialised data.
* [build] Fix building on Ubuntu 8.04Michael Brown2008-10-177-14/+16
| | | | | | | | | | | | | | | Not fully understood, but it seems that the LMA of bss sections matters for some newer binutils builds. Force all bss sections to have an LMA at the end of the file, so that they don't interfere with other sections. The symptom was that objcopy -O binary -j .zinfo would extract the .zinfo section from bin/xxx.tmp as a blob of the correct length, but with zero contents. This would then cause the [ZBIN] stage of the build to fail. Also explicitly state that .zinfo(.*) sections have @progbits, in case some future assembler or linker variant decides to omit them.
* [etherfabric] Merge changes from vendor treeMichael Brown2008-10-172-2337/+3348
| | | | Also clean up minor errors in the use of debug macros.
* virtio-net: Fix kick/wait logicEduardo Habkost2008-10-161-3/+5
| | | | | | | | | | | | | | | | | | | | | | The virtnet_transmit() logic for waiting the packet to be transmitted is reversed: we can't wait the packet to be transmitted if we didn't kick() the ring yet. The vring_more_used() while loop logic is reversed also, that explains why the code works today. The current code risks trying to free a buffer from the used ring when none was available, that will happen most times because KVM doesn't handle the packet immediately on kick(). Luckily it was working because it was unlikely to have a buffer still queued for transmit when virtnet_transmit() was called. Also, adds a BUG_ON() to vring_get_buf(), to catch cases where we try to free a buffer from the used ring when there was none available. Patch for Etherboot. gPXE has the same problem on the code, but I hadn't a chance to test gPXE using virtio-net yet. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
* [efi] Add basic implementation of EFI SIMPLE_NETWORK_PROTOCOLMichael Brown2008-10-165-0/+2367
| | | | | This implementation is tested and working, but not currently tied in to the EFI build.
* [netdevice] Change link-layer push() and pull() methods to take raw typesMichael Brown2008-10-165-64/+56Star
| | | | | | | | | | EFI requires us to be able to specify the source address for individual transmitted packets, and to be able to extract the destination address on received packets. Take advantage of this to rationalise the push() and pull() methods so that push() takes a (dest,source,proto) tuple and pull() returns a (dest,source,proto) tuple.
* [netdevice] Split multicast hashing out into an mc_hash methodMichael Brown2008-10-164-14/+57
| | | | | | Multicast hashing is an ugly overlap between network and link layers. EFI requires us to provide access to this functionality, so move it out of ipv4.c and expose it as a method of the link layer.
* [netdevice] Add maximum packet length as a net device propertyMichael Brown2008-10-164-4/+12
| | | | | Currently this length is set at device allocation time, and is never changed.
* [efi] Fix linker script for ld 2.17.50.0.9Michael Brown2008-10-131-6/+6
| | | | | | | Some versions of ld choke on the "AT ( _xxx_lma )" in efi.lds with an error saying "nonconstant expression for load base". Since these were only explicitly setting the LMA to the address that it would have had anyway, they can be safely omitted.
* [efi] Add EFI image format and basic runtime environmentMichael Brown2008-10-1340-1/+4781
| | | | | | | | | We have EFI APIs for CPU I/O, PCI I/O, timers, console I/O, user access and user memory allocation. EFI executables are created using the vanilla GNU toolchain, with the EXE header handcrafted in assembly and relocations generated by a custom efilink utility.
* [sanboot] Quick and dirty hack to make SAN boot protocols selectableMichael Brown2008-10-139-22/+64
|
* [config] Make the default image type selection platform-dependentMichael Brown2008-10-132-10/+19
|
* [monojob] Release reference on completed jobMichael Brown2008-10-131-0/+1
| | | | | | monojob_wait() was holding a reference to the completed job, meaning that various objects would not be freed until the next job was plugged in to the monojob interface.
* [umalloc] Formalise the user memory allocation APIMichael Brown2008-10-137-30/+95
|
* [uaccess] Formalise the uaccess APIMichael Brown2008-10-1321-760/+569Star
| | | | | | The userptr_t is now the fundamental type that gets used for conversions. For example, virt_to_phys() is implemented in terms of virt_to_user() and user_to_phys().
* [timer] Remove now-obsolete references to TIMER_BIOS and TIMER_RDTSCMichael Brown2008-10-132-12/+0Star
|
* [nap] Formalise the CPU sleeping APIMichael Brown2008-10-1312-20/+138
|
* [monojob] Allow for extremely slow system timersMichael Brown2008-10-121-1/+1
| | | | | The EFI timer runs at one tick per second, so using ">" rather than ">=" results in a two-second gap between dots.
* [timer] Formalise the timer APIMichael Brown2008-10-1222-284/+386
| | | | | | We now have two implementations for the timer API: one using the time-of-day counter at 40:70 and one using RDTSC. Both make use of timer2_udelay().
* [process] Add DBG2() messages to help track down frozen processesMichael Brown2008-10-121-0/+2
|
* [retry] Use a separate flag to indicate that a retry timer is runningMichael Brown2008-10-122-9/+12
| | | | | Using start==0 to indicate a stopped timer is dangerous, because 0 is a valid value for the current tick counter.
* [commands] Fix config command to accept zero argumentsMichael Brown2008-10-121-1/+1
|
* [pci] Formalise the PCI I/O APIMichael Brown2008-10-1210-81/+220
|
* [legacy] Add missing #include <gpxe/io.h>Michael Brown2008-10-121-0/+1
|
* [phantom] Add missing #include <gpxe/io.h>Michael Brown2008-10-121-0/+1
|
* [config] Split console configuration out to config/console.hMichael Brown2008-10-124-26/+26
|
* [ioapi] Absorb virt_to_phys() and phys_to_virt() into the I/O APIMichael Brown2008-10-124-39/+60
|
* [i386] Remove obsolete functions from virtaddr.hMichael Brown2008-10-121-21/+2Star
| | | | | | | The copy_{to,from}_phys() functions were obsoleted long ago by copy_{to,from}_user(). relocate_to() also disappeared some time ago.
* [rtl8139] Add missing #include <string.h>Michael Brown2008-10-121-0/+1
|
* [natsemi] Add missing #include <string.h>Michael Brown2008-10-121-0/+1
|
* [e1000] Add missing #include <string.h>Michael Brown2008-10-121-0/+1
|
* [ioapi] Remove old io.h file and switch all users over to <gpxe/io.h>Michael Brown2008-10-1222-291/+26Star
|
* [ioapi] Formalise the I/O API as used in i386-pcbiosMichael Brown2008-10-128-0/+850
|
* [cs89x0] Simplify obscure loop syntaxMichael Brown2008-10-121-2/+2
|
* [e1000] Fix dubious syntax in e1000 I/O wrapper macrosMichael Brown2008-10-121-24/+24
|