summaryrefslogtreecommitdiffstats
path: root/src/arch
Commit message (Collapse)AuthorAgeFilesLines
* [netdevice] Allow the hardware and link-layer addresses to differ in sizeMichael Brown2009-08-121-4/+6
| | | | | | | | | | IPoIB has a 20-byte link-layer address, of which only eight bytes represent anything relating to a "hardware address". The PXE and EFI SNP APIs expect the permanent address to be the same size as the link-layer address, so fill in the "permanent address" field with the initial link layer address (as generated by register_netdev() based upon the real hardware address).
* [netdevice] Separate out the concept of hardware and link-layer addressesMichael Brown2009-08-122-7/+3Star
| | | | | | | | | | | The hardware address is an intrinsic property of the hardware, while the link-layer address can be changed at runtime. This separation is exposed via APIs such as PXE and EFI, but is currently elided by gPXE. Expose the hardware and link-layer addresses as separate properties within a net device. Drivers should now fill in hw_addr, which will be used to initialise ll_addr at the time of calling register_netdev().
* [doc] Expand scope of doxygen-generated documentationMichael Brown2009-08-111-1/+1
|
* [zbin] Change fixup semantics to support ROMs over 128k uncompressedJoshua Oreman2009-08-116-25/+16Star
| | | | | | | | | | | | | | | | | | | | | | | | The option ROM header contains a one-byte field indicating the number of 512-byte sectors in the ROM image. Currently it is linked to contain the number of uncompressed sectors, with an instruction to the compressor to correct it. This causes link failure when the uncompressed size of the ROM image is over 128k. Fix by replacing the SUBx compressor fixup with an ADDx fixup that adds the total compressed output length, scaled as requested, to an addend stored in the field where the final length value will be placed. This is similar to the behavior of ELF relocations, and ensures that an overflow error will not be generated unless the compressed size is still too large for the field. This also allows us to do away with the _filesz_pgh and _filesz_sect calculations exported by the linker script. Output tested bitwise identical to the old SUBx mechanism on hd, dsk, lkrn, and rom prefixes, on both 32-bit and 64-bit processors. Modified-by: Michael Brown <mcb30@etherboot.org> Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [infiniband] Add support for the SRP Boot Firmware TableMichael Brown2009-08-103-0/+236
| | | | | | The SRP Boot Firmware Table serves a similar role to the iSCSI and AoE Boot Firmware Tables; it provides information required by the loaded OS in order to establish a connection back to the SRP boot device.
* [infiniband] Add support for SRP over InfinibandMichael Brown2009-08-101-0/+63
| | | | | | | | SRP is the SCSI RDMA Protocol. It allows for a method of SAN booting whereby the target is responsible for reading and writing data using Remote DMA directly to the initiator's memory. The software initiator merely sends and receives SCSI commands; it never has to touch the actual data.
* [romprefix] Cope with PnP BIOSes that fail to set %es:%di on entryMichael Brown2009-08-081-7/+20
| | | | | | | | | | | | Some BIOSes support the BIOS Boot Specification (BBS) but fail to set %es:%di correctly when calling the option ROM initialisation entry point. This causes gPXE to identify the BIOS as non-PnP (and so non-BBS), leaving the user unable to control the boot order. Fix by scanning for the $PnP signature ourselves, rather than relying on the BIOS having passed in %es:%di correctly. Tested-by: Helmut Adrigan <helmut.adrigan@chello.at>
* [pxe] Dual-license pxe_api.h under the MIT licenseH. Peter Anvin2009-08-031-0/+25
| | | | | | | | | pxe_api.h is just a description of API functions, it's actively undesirable to have more implementations than necessary. Allowing it under the MIT license lets the Syslinux libraries use it. Signed-off-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [pxe] Avoid printf format warning on some compilersMichael Brown2009-08-021-1/+1
| | | | Tested-by: Joshua Oreman <oremanj@xenon.get-linux.org>
* [build] Add syslinux floppy image type .sdskMarty Connor2009-08-021-0/+6
| | | | | | | | | | | | We add a syslinux floppy disk type using parts of the genliso script. This floppy image cat be dd'ed to a physical floppy or used in instances where a virtual floppy with an mountable DOS filesystem is useful. We also modify the genliso script to only generate .liso images rather than creating images depending on how it is called. Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [netdevice] Make ll_broadcast per-netdevice rather than per-ll_protocolMichael Brown2009-07-181-1/+1
| | | | | | | | | IPoIB has a link-layer broadcast address that varies according to the partition key. We currently go through several contortions to pretend that the link-layer address is a fixed constant; by making the broadcast address a property of the network device rather than the link-layer protocol it will be possible to simplify IPoIB's broadcast handling.
* [pxe] Add startpxe and stoppxe commandsMichael Brown2009-06-282-0/+34
| | | | | | | | | These commands can be used to activate or deactivate the PXE API (on a specifiable network interface). This is currently of limited use, since most image formats will call shutdown() before booting the image, meaning that the underlying net device gets shut down during remove_devices() anyway.
* [pxe] Check for unhookable interrupts in PXENV_STOP_UNDIMichael Brown2009-06-281-0/+9
| | | | | | PXENV_STOP_UNDI should return PXENV_STATUS_KEEP_UNDI if the UNDI cannot be safely unloaded (e.g. due to interrupt vectors that could not be unhooked).
* [pxe] Create pxe_[de]activate() wrapper functionsMichael Brown2009-06-284-40/+61
| | | | | Merge the pxe_set_netdev()+pxe_[un]hook_int1a() pattern into a single pxe_[de]activate() call.
* [pxe] Make pxe_init_structures() an initialisation functionMichael Brown2009-06-284-6/+7
| | | | | | | | | pxe_init_structures() fills in the fields of the !PXE and PXENV+ structures that aren't known until gPXE starts up. Once gPXE is started, these values will never change. Make pxe_init_structures() an initialisation function so that PXE users don't have to worry about calling it.
* [pxe] Update UNDI transmit count before transmitting packetMichael Brown2009-06-271-4/+8
| | | | | | | | | | | | | It is possible that the UNDI ISR may be triggered before netdev_tx() returns control to pxenv_undi_transmit(). This means that pxenv_undi_isr() may see a zero undi_tx_count, and so not check for TX completions. This is not a significant problem, since it will check for TX completions on the next call to pxenv_undi_isr() anyway; it just means that the NBP will see a spurious IRQ that was apparently caused by nothing. Fix by updating the undi_tx_count before calling netdev_tx(), so that pxenv_undi_isr() can decrement it and report the TX completion.
* [pxe] Implement PXENV_UNDI_{GET,SET}_MCAST_ADDRESSMichael Brown2009-06-271-15/+42
| | | | | | | | | | | | | | | Symantec Ghost requires working multicast support. gPXE configures all (sufficiently supported) network adapters into "receive all multicasts" mode, which means that PXENV_UNDI_SET_MCAST_ADDRESS is actually a no-op, but the current implementation returns PXENV_STATUS_UNSUPPORTED instead. Fix by making PXENV_UNDI_SET_MCAST_ADDRESS return success. For good measure, also implement PXENV_UNDI_GET_MCAST_ADDRESS, since the relevant functionality is now exposed by the net device core. Note that this will silently fail if the gPXE driver for the NIC being used fails to configure the NIC in "receive all multicasts" mode.
* [pxe] Improve pxe_undi debug messagesMichael Brown2009-06-271-32/+92
| | | | | | | | The PXE debugging messages have remained pretty much unaltered since Etherboot 5.4, and are now difficult to read in comparison to most of the rest of gPXE. Bring the pxe_undi debug messages up to normal gPXE standards.
* [comboot] Implement INT 22h AX=000Bh (Get Serial Console Configuration)Daniel Verkamp2009-06-241-1/+9
| | | | Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [pxe] Fix interoperability with the Symantec (undipd) DOS UNDI driverMichael Brown2009-06-231-1/+1
| | | | | | | | | | | The Symantec UNDI DOS driver fails when run on top of gPXE because we return our interface type as "gPXE" rather than one of the predefined NDIS interface type strings. Fix by returning the standard "DIX+802.3" string; this isn't necessarily always accurate, but it's highly unlikely that anything trying to use the UNDI API would understand our IPoIB link-layer pseudo-header anyway.
* [pxe] Fix interoperability with the Intel DOS UNDI driverMichael Brown2009-06-232-1/+23
| | | | | | | | The Intel DOS UNDI driver fails when run on top of gPXE because we do not fill in the ServiceFlags field in PXENV_UNDI_GET_IFACE_INFO. Fix by filling in the ServiceFlags field with reasonable values indicating our approximate feature capabilities.
* [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>.