summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* [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
|
* [makefile] Add -Wformat-nonliteral as an extra warning categoryMichael Brown2008-10-106-26/+47
| | | | | | | | | | | -Wformat-nonliteral is not enabled by -Wall and needs to be explicitly specified. Modified the few files that use nonliteral format strings to work with this new setting in place. Inspired by a patch from Carl Karsten <carl@personnelware.com> and an identical patch from Rorschach <r0rschach@lavabit.com>.
* [efi] Add EFI headers from the EFI Development Kit (edk2)Michael Brown2008-10-1025-0/+9013
| | | | | | | | | | | The intention is to include near-verbatim copies of the EFI headers required by gPXE. This is achieved using the import.pl script in src/include/gpxe/efi. Note that import.pl will modify any #include lines in each imported header to reflect its new location within the gPXE tree. It will also tidy up the file by removing carriage return characters and trailing whitespace.
* [i386] Simplify linker script and standardise linker-defined symbol namesMichael Brown2008-10-1011-236/+153Star
| | | | | | | | | | | | | Reduce the number of sections within the linker script to match the number of practical sections within the output file. Define _section, _msection, _esection, _section_filesz, _section_memsz, and _section_lma for each section, replacing the mixture of symbols that previously existed. In particular, replace _text and _end with _textdata and _etextdata, to make it explicit within code that uses these symbols that the .text and .data sections are always treated as a single contiguous block.
* [makefile] Reduce verbosity of various NON_AUTO_MEDIA rulesMichael Brown2008-10-103-10/+17
|
* [makefile] Split platform-dependent portions out of arch/i386/MakefileMichael Brown2008-10-102-50/+56
|
* [makefile] Inhibit warnings if AUTO_DEPS or MEDIA_DEPS are empty listsMichael Brown2008-10-101-0/+4
|
* [makefile] Add missing dependency on arch/$(ARCH)/Makefile to MAKEDEPSMichael Brown2008-10-101-0/+1
|
* [util] Don't die on undefined symbols in sortobjdump.plMichael Brown2008-10-101-1/+1
| | | | | Undefined symbols shouldn't reach sortobjdump.pl, but if they do then it is not a helpful place to report the error.
* [util] Add optional debug messages to zbin.cMichael Brown2008-10-101-0/+27
|
* [makefile] Split config.h out into config/*.h and kill off mkconfig.plMichael Brown2008-10-087-293/+57Star
|
* [makefile] Add support for multiple build platformsMichael Brown2008-10-083-219/+378
| | | | | | | | | | | | | | | | | | | | | | Allow for the build CPU architecture and platform to be specified as part of the make command goals. For example: make bin/rtl8139.rom # Standard i386 PC-BIOS build make bin-efi/rtl8139.efi # i386 EFI build The generic syntax is "bin[-[arch-]platform]", with the default architecture being "i386" (regardless of the host architecture) and the default platform being "pcbios". Non-path targets such as "srcs" can be specified using e.g. make bin-efi srcs Note that this changeset is merely Makefile restructuring to allow the build architecture and platform to be determined by the make command goals, and to export these to compiled code via the ARCH and PLATFORM defines. It doesn't actually introduce any new build platforms.
* [makefile] Kill off arch/$(ARCH)/ConfigMichael Brown2008-10-073-166/+56Star
| | | | | | The arch/i386/Config file has long been marked as deprecated. Move all the pertinent bits to arch/i386/Makefile instead and remove arch/i386/Config.
* [libc] Define wchar_t in a gcc-compatible wayMichael Brown2008-10-071-0/+6
| | | | | gcc defines the magic __WCHAR_TYPE__ macro, in order to convey information about whether or not the user selected -fshort-wchar.