summaryrefslogtreecommitdiffstats
path: root/src/arch
Commit message (Collapse)AuthorAgeFilesLines
...
* [x86_64] Add support for compilation as an x86_64 binaryMichael Brown2008-12-0529-49/+692
| | | | | | | | | | | | 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-057-553/+113Star
| | | | | | 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.
* [romprefix] Change from opt-in to opt-out when booting via INT19Michael Brown2008-12-041-3/+3
| | | | | | | | | | | | | | | | | | | On non-BBS systems, we have to hook INT 19 in order to be able to boot from the gPXE ROM at all. However, doing this unconditionally will prevent the user from booting via any other devices. Previously, the INT 19 entry point would prompt the user to press B in order to boot from gPXE, which makes it impossible to perform an unattended network boot. We now prompt the user to press N to skip booting from gPXE, which allows for unattended operation. This should be a better match for most real-world scenarios. Most modern systems support BBS and so are unaffected by this change. Very old (non-BBS) systems tend not to have PXE ROMs by default anyway; if the user has added a gPXE ROM then they probably do want to boot from the network. Newer non-BBS systems are essentially limited to IBM servers, which will recapture the INT 19 vector anyway and implement their own boot-ordering selection mechanism.
* [netdevice] Kill off the various guess_boot_netdev() functionsMichael Brown2008-11-214-62/+5Star
| | | | | | | | Remove the assortment of miscellaneous hacks to guess the "network boot device", and replace them each with a call to last_opened_netdev(). It still isn't guaranteed correct, but it won't be any worse than before, and it will at least be consistent.
* [pxe] Select the correct network device on multiport cardsMichael Brown2008-11-211-2/+4
| | | | | When trying to find the "first open network device", it helps to actually check the NETDEV_OPEN flag.
* [blockdev] Move block device operations to structure block_device_operationsLaurent Vivier2008-11-191-6/+6
| | | | Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
* [i386] Move iSCSI and AoE boot code to arch/i386/interface/pcbiosMichael Brown2008-11-196-0/+976
|
* [i386] Change [u]int32_t to [unsigned] int, rather than [unsigned] longMichael Brown2008-11-199-14/+14
| | | | | | 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
|
* [i386] Rename __cdecl to __asmcallMichael Brown2008-11-1911-17/+28
| | | | | __cdecl is a misleading name, since it currently encapsulates both cdecl and regparm(0) attributes. Rename to __asmcall.
* [pxe] Move all PXE files to arch/i386Michael Brown2008-11-1810-0/+4558
| | | | | The initial PXE implementation in Etherboot had the goal of being architecture-agnostic, but this goal has not been realised.
* [elf] Kill off unused <bits/elf.h> and <bits/elf_x.h> header filesMichael Brown2008-11-182-96/+0Star
|
* [i386] Free allocated base memory on exit, if possibleMichael Brown2008-11-189-29/+133
| | | | | | | | | | | Code paths that automatically allocate memory from the FBMS at 40:13 should also free it, if possible. Freeing this memory will not be possible if either 1. The FBMS has been modified since our allocation, or 2. We have not been able to unhook one or more BIOS interrupt vectors.
* [build] Fix calculation of _fileszMichael Brown2008-11-181-6/+6
| | | | | | _filesz was incorrectly forced to be aligned up to MAX_ALIGN. In a non-compressed build, this would cause a build failure unless _filesz happened to already be aligned to MAX_ALIGN.
* [build] Discard junk sections created by newer gcc versionsMichael Brown2008-11-182-0/+12
|
* [build] Keep gcc 4.4 happyMichael Brown2008-11-182-8/+12
| | | | | gcc 4.4 adds another few warnings, and also seems to complain if we place %ebp in the clobber list for any inline asm.
* [romprefix] Use smaller PMM allocations if possibleMichael Brown2008-11-111-7/+41
| | | | | | | | | | | | | | | | | | The only way that PMM allows us to request a block in a region with A20=0 is to ask for a block with an alignment of 2MB. Due to the PMM API design, the only way we can do this is to ask for a block with a size of 2MB. Unfortunately, some BIOSes will hit problems if we allocate a 2MB block. In particular, it may not be possible to enter the BIOS setup screen; the BIOS setup code attempts a PMM allocation, fails, and hangs the machine. We now try allocating only as much as we need via PMM. If the allocated block has A20=1, we free the allocated block, double the allocation size, and try again. Repeat until either we obtain a block with A20=0 or allocation fails. (This is guaranteed to terminate by the time we reach an allocation size of 2MB.)
* [i386] Add data32 prefixes to all lgdt/lidt instructionsMichael Brown2008-11-072-7/+7
| | | | | | | | | | | | With a 16-bit operand, lgdt/lidt will load only a 24-bit base address, ignoring the high-order bits. This meant that we could fail to fully restore the GDT across a call into gPXE, if the GDT happened to be located above the 16MB mark. Not all of our lgdt/lidt instructions require a data32 prefix (for example, reloading the real-mode IDT can never require a 32-bit base address), but by adding them everywhere we will hopefully not forget the necessary ones in future.
* [romprefix] Add vendor branding facilities and guidelinesMichael Brown2008-10-312-12/+76
| | | | | | | | | | | | | Some hardware vendors have been known to remove all gPXE-related branding from ROMs that they build. While this is not prohibited by the GPL, it is a little impolite. Add a facility for adding branding messages via two #defines (PRODUCT_NAME and PRODUCT_SHORT_NAME) in config/general.h. This should accommodate all known OEM-mandated branding requirements. Vendors with branding requirements that cannot be satisfied by using PRODUCT_NAME and/or PRODUCT_SHORT_NAME should contact us so that we can extended this facility as necessary.
* [hacks] Improve the guess_boot_netdev() logicMichael Brown2008-10-311-3/+4
| | | | | | This function is a major kludge, but can be made slightly more accurate by ignoring net devices that aren't open. Eventually it needs to be removed entirely.
* [settings] Add the notion of a "tag magic" to numbered settingsMichael Brown2008-10-301-4/+19
| | | | | | | | | | | | | | | | | | | 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.
* [ioapi] Fix broken implementation of insX() in the x86 I/O APIMichael Brown2008-10-271-2/+2
|
* [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.
* [build] Fix building on FreeBSDMichael Brown2008-10-171-2/+6
| | | | | | | 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.
* [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-137-0/+437
| | | | | | | | | 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.
* [umalloc] Formalise the user memory allocation APIMichael Brown2008-10-134-27/+31
|
* [uaccess] Formalise the uaccess APIMichael Brown2008-10-1317-740/+235Star
| | | | | | 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().
* [nap] Formalise the CPU sleeping APIMichael Brown2008-10-135-14/+42
|
* [timer] Formalise the timer APIMichael Brown2008-10-1211-148/+263
| | | | | | 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().
* [pci] Formalise the PCI I/O APIMichael Brown2008-10-126-79/+94
|
* [ioapi] Absorb virt_to_phys() and phys_to_virt() into the I/O APIMichael Brown2008-10-123-24/+25
|
* [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.
* [ioapi] Remove old io.h file and switch all users over to <gpxe/io.h>Michael Brown2008-10-128-277/+12Star
|
* [ioapi] Formalise the I/O API as used in i386-pcbiosMichael Brown2008-10-123-0/+253
|
* [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-102-9/+16
|
* [makefile] Split platform-dependent portions out of arch/i386/MakefileMichael Brown2008-10-102-50/+56
|
* [makefile] Add support for multiple build platformsMichael Brown2008-10-081-11/+0Star
| | | | | | | | | | | | | | | | | | | | | | 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-072-153/+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.
* [pcbios] Allow for larger-than-20-byte buffers in e820mangler.SMichael Brown2008-09-291-14/+45
| | | | | | | | | | Although the E820 API allows for a caller to provide only a 20-byte buffer, there exists at least one combination (HP BIOS, 32-bit WinPE) that relies on information found only in the "extended attributes" field, which requires a 24-byte buffer. Allow for up to a 64-byte E820 buffer, in the hope of coping with future idiocies like this one.
* [pcbios] Print INT 15,E820 extended attributes, if presentMichael Brown2008-09-291-3/+43
| | | | | | | | | | | | | The ACPI specification defines an additional 4-byte field at offset 20 for an E820 memory map entry. This field is presumably optional, since generally E820 gets given only a 20-byte buffer to fill. However, the bits of this optional field are defined as: bit 0 : region is enabled bit 1 : region is non-volatile memory rather than RAM so it seems as though callers that pass in only a 20-byte buffer may be missing out on some rather important information.
* [gdb] Fix a compiler warning that shows up only when assertions are enabledMichael Brown2008-09-291-2/+2
| | | | | gcc should (I think) be warning about this anyway, but seems to do so only when assertions are enabled for this object.
* [pcbios] Save/restore %es in INT 15,e820Michael Brown2008-09-291-0/+2
| | | | | | | Our INT 15,e820 code was setting %es=%ss (as part of the "look ahead in the memory map" logic), but failing to restore %es afterwards. This is a serious bug, but wasn't affecting many platforms because almost all callers seem to set %es=%ss anyway.
* [i386] Add dump_regs() debug callMichael Brown2008-09-291-0/+23
| | | | | Use as "call dump_regs" from any real-mode code within .text16. Should preserve all registers and flags.
* [romprefix] Fully clear the "Press B to boot..." message when INT19 is usedMichael Brown2008-09-261-1/+1
|