summaryrefslogtreecommitdiffstats
path: root/src/arch
Commit message (Collapse)AuthorAgeFilesLines
...
* [pxe] Fix interoperability with the 3Com DOS UNDI driverMichael Brown2009-06-231-2/+15
| | | | | | | | | | | | | | | The 3Com DOS UNDI driver fails when run on top of gPXE for two reasons: firstly because PXENV_UNDI_SET_PACKET_FILTER is unsupported, and secondly because gPXE enters the NBP without enabling interrupts on the NIC, and the 3Com driver never calls PXENV_UNDI_OPEN. Fix by always returning success from PXENV_UNDI_SET_PACKET_FILTER (which is no worse than the current situation, since we already ignore the receive packet filter in PXENV_UNDI_OPEN), and by forcibly enabling interrupts on the NIC within PXENV_UNDI_TRANSMIT. The latter is something of a hack, but avoids the need to implement a complete base-code ISR that we would otherwise need if we were to enter the NBP with interrupts enabled.
* [undi] Include PXENV_GET_IFACE_INFO's ServiceFlags in debug outputMichael Brown2009-06-231-2/+3
|
* [netdevice] Add netdev argument to link-layer push and pull handlersJoshua Oreman2009-06-231-3/+3
| | | | | | | | | | | | | | | In order to construct outgoing link-layer frames or parse incoming ones properly, some protocols (such as 802.11) need more state than is available in the existing variables passed to the link-layer protocol handlers. To remedy this, add struct net_device *netdev as the first argument to each of these functions, so that more information can be fetched from the link layer-private part of the network device. Updated all three call sites (netdevice.c, efi_snp.c, pxe_undi.c) and both implementations (ethernet.c, ipoib.c) of ll_protocol to use the new argument. Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [misc] Fix source files erroneously marked as executableMichael Brown2009-06-024-0/+0
|
* [comboot] Implement stub calls for auxiliary data vector handlingDaniel Verkamp2009-05-261-1/+12
| | | | Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [multiboot] Include argv[0] as part of "command line"Michael Brown2009-05-261-5/+6
| | | | | Grub will include the module name as part of the command line, and some multiboot kernels expect this to be done.
* [legal] Add FILE_LICENCE declaration to romprefix.SMichael Brown2009-05-181-0/+2
|
* [legal] Add a selection of FILE_LICENCE declarationsMichael Brown2009-05-18126-1/+253
| | | | | Add FILE_LICENCE declarations to almost all files that make up the various standard builds of gPXE.
* [pxeprefix] Work around bug in Etherboot 5.4 when loading undionly.kpxeMichael Brown2009-04-301-5/+55
| | | | | | | | | | | | Etherboot 5.4 erroneously treats PXENV_UNLOAD_STACK as the "final shutdown" call, and unhooks INT15. When using gPXE's undionly.kpxe, this results in gPXE overwriting the portion of Etherboot located in high memory, because it is no longer hidden from the system memory map at the time that gPXE loads. Work around this by explicitly testing for Etherboot as the underlying PXE stack (as is already done in undinet.c) and skipping the call to PXENV_UNLOAD_STACK if necessary.
* [i386] Remove long-obsolete realmode.c fileMichael Brown2009-04-261-23/+0Star
|
* [i386] Remove long-obsolete callbacks_arch.h fileMichael Brown2009-04-261-243/+0Star
|
* [multiboot] Work around raw-flag bug in Solaris kernelsMichael Brown2009-04-241-8/+15
| | | | | | | | | | | Solaris kernels are multiboot images with the "raw" flag set, indicating that the loader should use the raw address fields within the multiboot header rather than looking for an ELF header. However, the Solaris kernel contains garbage data in the raw address fields, and requires us to use the ELF header instead. Work around this by always using the ELF header if present. This renders the "raw" flag somewhat redundant.
* [build] Remove obsolete linker script filesMichael Brown2009-04-175-189/+0Star
|
* [build] Kill off the last multiple-object source fileMichael Brown2009-04-172-5/+7
| | | | | | | The build mechanism currently allows for multiple objects per source file. The only remaining user of this is unnrv2b.S. Replace this usage with a separate unnrv2b16.S wrapper file, as is currently used for e.g. pxeprefix.S and kpxeprefix.S.
* [build] Reinstate the .pdsk padded-floppy image formatMichael Brown2009-04-161-0/+6
| | | | | | Some utilities that expect a floppy disk image (e.g. iLO?) may test for a file of the correct size. Reinstate the .pdsk image format in order to provide this if needed.
* [build] Pad .rom, .dsk, and .hd images to 512-byte boundariesMichael Brown2009-04-162-7/+6Star
| | | | | | | | QEMU will silently round down a disk or ROM image file to the nearest 512 bytes. Fix by always padding .rom, .dsk and .hd images to the nearest 512-byte boundary. Originally-fixed-by: Stefan Hajnoczi <stefanha@gmail.com>
* [pcbios] Don't use "lret $2" to return from an interruptH. Peter Anvin2009-04-153-13/+26
| | | | | | | | | | | | | Using "lret $2" to return from an interrupt causes interrupts to be disabled in the calling program, since the INT instruction will have disabled interrupts. Instead, patch CF on the stack and use iret to return. Interestingly, the original PC BIOS had this bug in at least one place. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [build] Use __SIZE_TYPE__ macro in definition of size_tJoshua Oreman2009-03-312-3/+3
| | | | | | | 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>
* [int13] Improve debugging messagesMichael Brown2009-03-311-4/+11
|
* [xfer] Implement xfer_vreopen() to properly handle redirectionsMichael Brown2009-03-301-1/+1
| | | | | When handling a redirection event, we need to close the existing connection before opening the new connection.
* [bzimage] Support old (pre-2.00 bootloader) Linux kernel formatsMichael Brown2009-03-302-249/+235Star
| | | | | | | | | | 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).
* [pci] Add driver_data field to struct pci_device_idThomas Miletich2009-03-261-1/+1
| | | | | Modified-by: Michael Brown <mcb30@etherboot.org> Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [build] Enable building with the Intel C compiler (icc)Michael Brown2009-03-263-9/+20
|
* [pxeprefix] Merge common code between !PXE and PXENV+H. Peter Anvin2009-03-061-14/+12Star
| | | | | | | The parsing of the !PXE and PXENV+ structures share a fair bit of code; merge the common code to save a few bytes. Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [pxe] Set %ax to zero on entry to PXE NBPMichael Brown2009-02-231-9/+10
| | | | | | This is not strictly an entry requirement, but it does mean that a PXE NBP returning without setting %ax will appear to have returned success.
* [pxeprefix] Search for the PXE entry points through all methodsH. Peter Anvin2009-02-231-42/+105
| | | | | | | Search for the PXE entry points (via the !PXE or PXENV+ structures) through all known combinations of search methods. Furthermore, if we find a PXENV+ structure, attempt to use it to find the !PXE structure if at all possible.
* [iscsi] Include credentials in iBFT only if used during iSCSI loginMichael Brown2009-02-201-3/+53
| | | | | | | | Avoid passing credentials in the iBFT that were available but not required for login. This works around a problem in the Microsoft iSCSI initiator, which will refuse to initiate sessions if the CHAP password is fewer than 12 characters, even if the target ends up not asking for CHAP authentication.
* [pxe] Initialize EDX on PXE NBP entry and INT 1AhH. Peter Anvin2009-02-182-8/+13
| | | | | | | | | The PXE 1.x spec specifies that on NBP entry or on return from INT 1Ah AX=5650h, EDX shall point to the physical address of the PXENV+ structure. The PXE 2.x spec drops this requirement, simply stating that EDX is clobbered. Given the principle "be conservative in what you send, liberal in what you accept", however, we should implement this anyway.
* [pxeprefix] Add .kkpxe image type and ability to return via PXE stackMichael Brown2009-02-186-39/+130
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>.
* [i386] Kill off obsolete boot1a.s fileMichael Brown2009-02-181-410/+0Star
|
* [comboot] Implement INT 22h AX=001Bh (Cleanup, shuffle, and boot to real mode)Daniel Verkamp2009-02-172-1/+95
|
* [comboot] Restore the real-mode stack pointer on exit from a COMBOOT imageMichael Brown2009-02-175-14/+40
| | | | | | | | | | | | | 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-174-0/+18
|
* [comboot] Fix reference counting on replacement imagesMichael Brown2009-02-173-15/+16
| | | | When chaining COMBOOT images, the old images now get freed correctly.
* [comboot] Allow for tail recursion of COMBOOT imagesMichael Brown2009-02-175-104/+134
| | | | | | | | | | | | 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.
* [build] Cope with oddities in the Fedora 10 assemblerMichael Brown2009-02-163-15/+15
| | | | | | | | | The version of the GNU assembler shipped with Fedora 10 (2.18.50.0.9-8.fc10) complains about character literals in some of our assembly code. Changing $'x' to $( 'x' ) seems to fix the problem. Yes, the whitespace is required; using just $('x') does not work. Reported by Kevin O'Connor <kevin@koconnor.net>.
* [image] Avoid claiming zero-length images as validMichael Brown2009-02-161-0/+6
| | | | | Both the script and PXE images types will claim a zero-length image. Inhibit this to avoid end-user surprises.
* [romprefix] Update ROM checksum even if PMM allocation failsMichael Brown2009-02-151-7/+9
| | | | | | | | | | There are code paths other than PMM allocation that can result in our changing the ROM checksum. For example, we attempt to update our product string to incorporate the PCI bus:dev.fn number. In a system that does not support PMM, we could therefore end up with an incorrect checksum. Fix by attempting to update the checksum unconditionally.
* [i386] Add explicit flags and type on all .section declarationsMichael Brown2009-02-158-99/+82Star
| | | | | | | | | | | | | | | | | | | | | | | Try to avoid future problems caused by implicit section flags and/or type information by instituting a policy that all .section declarations must explicitly state the flags and type. Most of this change was achieved using perl -pi \ -e 's/".text"$/".text", "ax", \@progbits/ ; ' \ -e 's/".text16"$/".text16", "ax", \@progbits/ ; ' \ -e 's/".text16.null"$/".text16.null", "ax", \@progbits/ ; ' \ -e 's/".text16.data"$/".text16.data", "aw", \@progbits/ ; ' \ -e 's/".data"$/".data", "aw", \@progbits/ ; ' \ -e 's/".data16"$/".data16", "aw", \@progbits/ ; ' \ -e 's/".bss"$/".bss", "aw", \@nobits/ ; ' \ -e 's/".bss16"$/".bss16", "aw", \@nobits/ ; ' \ -e 's/".prefix"$/".prefix", "ax", \@progbits/ ; ' \ -e 's/".prefix.lib"$/".prefix.lib", "awx", \@progbits/ ; ' \ -e 's/".prefix.data"$/".prefix.data", "aw", \@progbits/ ; ' \ -e 's/".weak"$/".weak", "a", \@nobits/ ; ' \ `git grep -l '\.section'`
* [i386] Add explicit ""aw", @nobits" declarations to stack sectionsMichael Brown2009-02-152-2/+2
| | | | | | | | | | | | | | As reported by Stefan, commit 13d09e6 ("[i386] Simplify linker script and standardise linker-defined symbol names") breaks gdb, readelf and associated utilities. This is caused by the .stack section overwriting a block in the middle of the .debug_info section (despite being included in the .bss.textdata section in the output file, which apparently has the correct attributes for a .bss section). Fixed by adding explicit flags and type to the stack section declaration.
* [umalloc] Avoid problems when _textdata_memsz is a multiple of 4kBMichael Brown2009-02-151-3/+3
| | | | | | | | | | | | | | | | | | | If it happens that _textdata_memsz ends up being an exact multiple of 4kB, then this will cause the .textdata section (after relocation) to start on a page boundary. This means that the hidden memory region (which is rounded down to the nearest page boundary) will start exactly at virtual address 0, i.e. UNULL. This means that init_eheap() will erroneously assume that it has failed to allocate a an external heap, since it typically ends up choosing the area that lies immediately below .textdata, which in this case will be the region with top==UNULL. A subsequent error is that memtop_urealloc() passes through the error return status -ENOMEM to the caller, which (rightly) assumes that the result represents a valid userptr_t address. Fixed by using alternative tests for heap non-existence, and by returning UNULL in case of an error from init_eheap().
* [iobuf] Add iob_disown() and use it where it simplifies codeMichael Brown2009-02-011-2/+1Star
| | | | | | | | | | | | | | | | | | | | | | | | | There are many functions that take ownership of the I/O buffer they are passed as a parameter. The caller should not retain a pointer to the I/O buffer. Use iob_disown() to automatically nullify the caller's pointer, e.g.: xfer_deliver_iob ( xfer, iob_disown ( iobuf ) ); This will ensure that iobuf is set to NULL for any code after the call to xfer_deliver_iob(). iob_disown() is currently used only in places where it simplifies the code, by avoiding an extra line explicitly setting the I/O buffer pointer to NULL. It should ideally be used with each call to any function that takes ownership of an I/O buffer. (The SSA optimisations will ensure that use of iob_disown() gets optimised away in cases where the caller makes no further use of the I/O buffer pointer anyway.) If gcc ever introduces an __attribute__((free)), indicating that use of a function argument after a function call should generate a warning, then we should use this to identify all applicable function call sites, and add iob_disown() as necessary.
* [dhcp] Split PXE menuing code out of dhcp.cMichael Brown2009-02-011-1/+1
| | | | | | | | | The DHCP client code now implements only the mechanism of the DHCP and PXE Boot Server protocols. Boot Server Discovery can be initiated manually using the "pxebs" command. The menuing code is separated out into a user-level function on a par with boot_root_path(), and is entered in preference to a normal filename boot if the DHCP vendor class is "PXEClient" and the PXE boot menu option exists.
* [tftp] Temporary fix for conveying TFTP block size to callersMichael Brown2009-01-271-7/+4Star
| | | | | | | | | | | | | | | | | | | | | pxe_tftp.c assumes that the first seek on its data-transfer interface represents the block size. Apart from being an ugly hack, this will also screw up file size calculation for files smaller than one block. The proper solution would be to extend the data-transfer interface to support the reporting of stat()-like data. This is not going to happen until the cost of adding interface methods is reduced (a fix I have planned since June 2008). In the meantime, abuse the xfer_window() method to return the block size, since it is not being used for anything else and is vaguely justifiable. Astonishingly, having returned the incorrect TFTP blocksize via PXENV_TFTP_OPEN for almost a year seems not to have affected any of the test cases run during that time; this bug was found only when someone tried running the heavily-patched version of pxegrub found in OpenSolaris.
* [bios] Add F8 function key as a recognised BIOS keycodeMichael Brown2009-01-251-1/+3
|
* [efi] Add efirom utility and .efirom image formatMichael Brown2009-01-081-0/+4
|
* [efi] Allow for .efidrv images as well as .efi imagesMichael Brown2009-01-085-29/+78
| | | | | | Merge in the changes that allow for building EFI driver images (that can be loaded using the EFI shell's "load" command) as well as EFI applications.
* [efi] Use elf2efi utility in place of efilinkMichael Brown2009-01-079-731/+156Star
| | | | | | | | | | | elf2efi converts a suitable ELF executable (containing relocation information, and with appropriate virtual addresses) into an EFI executable. It is less tightly coupled with the gPXE build process and, in particular, does not require the use of a hand-crafted PE image header in efiprefix.S. elf2efi correctly handles .bss sections, which significantly reduces the size of the gPXE EFI executable.
* [efi] Inhibit harmless ld warning on unresolved symbol checkMichael Brown2009-01-052-2/+4
| | | | | | | | The check for unresolved symbols does not explicitly specify an output architecture format, and so causes a warning when building an i386 EFI binary on an x86_64 platform. This warning is harmless, and specifying the output architecture in multiple places is cumbersome, so just inhibit the warning.
* [pcbios] Add additional sanity check for bogus e820 mapMarty Connor2008-12-181-0/+7
| | | | | | | | | | At POST time some BIOSes return invalid e820 maps even though they indicate that the data is valid. We add a check that the first region returned by e820 is RAM type and declare the map to be invalid if it is not. This extends the sanity checks from 8b20e5d ("[pcbios] Sanity-check the INT15,e820 and INT15,e801 memory maps").