david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
Commit Graph

1079 Commits

Author SHA1 Message Date
Michael Brown 7ba33f7826 [infiniband] Provide ib_get_hca_info() as a commonly-available function 2009-07-17 23:06:33 +01:00
Michael Brown b25a4b6c8a [infiniband] Split queue set functionality out of ipoib.c to ib_qset.c 2009-07-17 23:06:33 +01:00
Michael Brown d09290161e [netdevice] Make ll_broadcast per-netdevice rather than per-ll_protocol
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.
2009-07-17 23:02:48 +01:00
Michael Brown 54ec3673cc [ata] Make ATA command issuing partially asynchronous
Move the icky call to step() from aoe.c to ata.c; this takes it at
least one step further away from where it really doesn't belong.

Unfortunately, AoE has the ugly aoe_discover() mechanism which means
that we still have a step() loop in aoe.c for now; this needs to be
replaced at some future point.
2009-07-17 23:01:20 +01:00
Michael Brown 1d8d8ef2c8 [scsi] Make SCSI command issuing partially asynchronous
Move the icky call to step() from iscsi.c to scsi.c; this takes it at
least one step further away from where it really doesn't belong.
2009-07-17 23:00:09 +01:00
Michael Brown 76c915d5bd [ifmgmt] Move ifmgmt_cmd.h to include/hci 2009-06-28 20:28:38 +01:00
Michael Brown 9580f9d5cd [pxe] Improve pxe_undi debug messages
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.
2009-06-27 14:43:10 +01:00
Michael Brown a310d00d37 [netdevice] Add mechanism for reporting detailed link status codes
Expand the NETDEV_LINK_UP bit into a link_rc status code field,
allowing specific reasons for link failure to be reported via
"ifstat".

Originally-authored-by: Joshua Oreman <oremanj@rwcr.net>
2009-06-24 13:04:36 +01:00
Joshua Oreman 254bdc2a8e [netdevice] Adjust maximum link-layer header length for 802.11
Signed-off-by: Michael Brown <mcb30@etherboot.org>
2009-06-23 10:49:50 +01:00
Joshua Oreman eb3ca2a36f [netdevice] Add netdev argument to link-layer push and pull handlers
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>
2009-06-23 10:41:57 +01:00
Joshua Oreman 743ebc2f4b [nvs] Add init function for Atmel 93C66 EEPROM
The 93C66 is identical to the 93C56 in programming interface and
addressing, but twice as large in data storage (4096 bits). It's
used in some RTL8185 wireless cards.

Signed-off-by: Michael Brown <mcb30@etherboot.org>
2009-06-23 10:33:10 +01:00
Michael Brown 558c1a45fe [tcp] Improve robustness in the presence of duplicated received packets
gPXE responds to duplicated ACKs with an immediate retransmission,
which can lead to a sorceror's apprentice syndrome.  It also responds
to out-of-range (or old duplicate) ACKs with a RST, which can cause
valid connections to be dropped.

Fix the sorceror's apprentice syndrome by leaving the retransmission
timer running (and so inhibiting the immediate retransmission) when we
receive a potential duplicate ACK.  This seems to match the behaviour
of Linux observed via wireshark traces.

Fix the RST issue by sending RST only on out-of-range ACKs that occur
before the connection is fully established, as per RFC 793.

These problems were exposed during development of the 802.11 wireless
link layer; the 802.11 protocol has a failure mode that can easily
cause duplicated packets.  The fixes were tested in a controlled way
by faking large numbers of duplicated packets in the rtl8139 driver.

Originally-fixed-by: Joshua Oreman <oremanj@rwcr.net>
2009-06-23 09:40:26 +01:00
Michael Brown edfbd4e4fa [netdevice] Fix incorrect value for MAX_LL_HEADER_LEN
MAX_LL_HEADER_LEN is erroneously set to 6 rather than 14, resulting
in possible data corruption whenever we send an ARP packet.

Fix value and add a comment explaining why MAX_LL_ADDR_LEN is greater
than MAX_LL_HEADER_LEN.

Reported-by: Joshua Oreman <oremanj@rwcr.net>
2009-06-05 01:07:27 +01:00
Michael Brown 4c5f00f879 [script] Allow for DOS-style line endings in scripts
Windows text editors such as Notepad tend to use CRLF line endings,
which breaks gPXE's signature detection for script images.  Since
scripts are usually very small, they end up falling back to being
detected as valid PXE executable images (since there are no signature
checks for PXE executables).  Executing text files as x86 machine code
tends not to work well.

Fix by allowing for any isspace() character to terminate the "#!gpxe"
signature, and by ensuring that CR characters get stripped during
command line parsing.

Suggested-by: Shao Miller <Shao.Miller@yrdsb.edu.on.ca>
2009-06-03 10:13:29 +01:00
Michael Brown 5e51aaccaa [misc] Remove long-obsolete header files dating from Etherboot 5.4 2009-06-03 10:09:28 +01:00
Michael Brown a5cd8d1772 [misc] Fix source files erroneously marked as executable 2009-06-02 11:26:09 +01:00
Michael Brown 92a9978b44 [spi] Add address-length autodetection to the SPI bit-bashing code
Several SPI chips will respond to an SPI read command with a dummy
zero bit immediately prior to the first real data bit.  This can be
used to autodetect the address length, provided that the command
length and data length are already known, and that the MISO data line
is tied high.

Tested-by: Thomas Miletich <thomas.miletich@gmail.com>
Debugged-by: Thomas Miletich <thomas.miletich@gmail.com>
2009-05-28 19:32:03 +01:00
Daniel Verkamp 1f80b2dcd5 [ethernet] Add MII link status functions from Linux
Signed-off-by: Michael Brown <mcb30@etherboot.org>
2009-05-26 11:37:46 +01:00
Daniel Verkamp b8469eddaa [ethernet] Update mii.h and use it in drivers that had a private copy
Signed-off-by: Michael Brown <mcb30@etherboot.org>
2009-05-26 11:30:31 +01:00
Daniel Verkamp 005fce0258 [ethernet] Move struct mii_if_info to mii.h
Signed-off-by: Michael Brown <mcb30@etherboot.org>
2009-05-26 11:27:55 +01:00
Michael Brown 3c06277bbb [settings] Allow for arbitrarily-named settings
This provides a mechanism for using arbitrarily-named variables within
gPXE, using the existing syntax for settings.
2009-05-26 11:05:58 +01:00
Michael Brown c44a193d0d [legal] Add a selection of FILE_LICENCE declarations
Add FILE_LICENCE declarations to almost all files that make up the
various standard builds of gPXE.
2009-05-18 08:33:25 +01:00
Michael Brown a525fb7782 [legal] Add mechanism for explicit per-file licence declarations
For partly historical reasons, various files in the gPXE source tree
are licensed under different, though compatible, terms.  Most of the
code is licensed under GPLv2 with the "or later" clause, but there are
exceptions such as:

  The string.h file, which derives from Linux and is licensed as
  Public Domain.

  The EFI header files, which are taken from the EDK2 source tree and
  are licensed under BSD.

  The 3c90x driver, which has a custom GPL-like licence text.

Introduce a FILE_LICENCE() macro to make licensing more explicit.
This macro should be applied exactly once to each source (.c, .S or
.h) file.  It will cause a corresponding zero-sized common symbol to
be added to any .o files generated from that source file (and hence to
any final gPXE binaries generated from that source file).  Determining
the applicable licences to generated files can then be done using e.g.

  $ objdump -t bin/process.o | grep __licence
  00000000       O *COM*  00000001 .hidden __licence_gpl2_or_later

indicating that bin/process.o is covered entirely by the GPLv2
with the "or later" clause, or

  $ objdump -t bin/rtl8139.dsk.tmp | grep __licence
  00033e8c g     O .bss.textdata  00000000 .hidden __licence_gpl2_only
  00033e8c g     O .bss.textdata  00000000 .hidden __licence_gpl2_or_later
  00033e8c g     O .bss.textdata  00000000 .hidden __licence_public_domain

indicating that bin/rtl8139.dsk includes both code licensed under
GPLv2 (both with and without the "or later" clause) and code licensed
as Public Domain.

Determining the result of licence combinations is currently left as an
exercise for the reader.
2009-05-18 08:26:08 +01:00
Michael Brown a13fc96cb3 [legacy] Remove long-obsolete old dhcp.h file 2009-05-18 08:24:45 +01:00
Michael Brown 7c47ebd65c [build] Add {PROVIDE,REQUIRE}_SYMBOL macros and tidy up compiler.h 2009-04-27 14:04:35 +01:00
Timothy Stack cc4363acca [smbios] Add asset tag setting
Add SMBIOS asset tag as a named setting.

Signed-off-by: Michael Brown <mcb30@etherboot.org>
2009-04-15 17:23:18 +01:00
Michael Brown 7266aceb39 [efi] Fix compilation on Mac OS X.
The Mac compiler treats "#pragma pack()" as gcc's "#pragma pack(pop)",
and so dies if the pragma pack stack is empty.  Adding a "#pragma
pack(1)" immediately beforehand is enough to keep the Mac compiler
happy.

The combination of "#pragma pack(1)", "#pragma pack()" won't actually
achieve anything on a Mac, but it will at least build.  (With gcc, the
"#pragma pack()" overrides any previous pragmas, so is still useful.)

Suggested-by: Joshua Oreman <oremanj@rwcr.net>
2009-03-31 07:39:20 +01:00
Joshua Oreman 820b11dc0a [build] Use __SIZE_TYPE__ macro in definition of size_t
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>
2009-03-31 07:21:07 +01:00
Michael Brown 323cdf8c4c [xfer] Implement xfer_vreopen() to properly handle redirections
When handling a redirection event, we need to close the existing
connection before opening the new connection.
2009-03-30 13:24:56 +01:00
Thomas Miletich 3da6f1c7bd [pci] Add driver_data field to struct pci_device_id
Modified-by: Michael Brown <mcb30@etherboot.org>
Signed-off-by: Michael Brown <mcb30@etherboot.org>
2009-03-26 10:22:15 +00:00
Michael Brown 1c67623e37 [build] Enable building with the Intel C compiler (icc) 2009-03-26 07:27:19 +00:00
Michael Brown 3c68ff99ea [tables] Incorporate table data type information into table definition
Eliminate the potential for mismatches between table names and the
table entry data type by incorporating the data type into the
definition of the table, rather than specifying it explicitly in each
table accessor method.
2009-03-13 02:10:21 +00:00
Michael Brown 1266d7902b [tables] Redefine methods for accessing linker tables
Intel's C compiler (icc) chokes on the zero-length arrays that we
currently use as part of the mechanism for accessing linker table
entries.  Abstract away the zero-length arrays, to make a port to icc
easier.

Introduce macros such as for_each_table_entry() to simplify the common
case of iterating over all entries in a linker table.

Represent table names as #defined string constants rather than
unquoted literals; this avoids visual confusion between table names
and C variable or type names, and also allows us to force a
compilation error in the event of incorrect table names.
2009-03-13 02:06:30 +00:00
Michael Brown ec24672db7 [settings] Allow for autovivification of settings blocks
Allow for settings blocks to be created on demand.  This allows for
constructions such as

  set defaults/filename http://bootserver/bootfile
  set defaults/priority 0xff
  dhcp net0
  chain ${filename}

which will boot from the DHCP-provided filename, or from
"http://bootserver/bootfile" if the DHCP server does not provide a
filename.

(Note that "priority" gets interpreted as a signed integer, so setting
"defaults/priority" to 0xff will cause the "defaults" settings block
to have an effective priority of -1.)
2009-03-06 14:40:44 +00:00
Michael Brown 4f3bab1a55 [image] Allow for zero embedded images
Having a default script containing

  #!gpxe
  autoboot

can cause problems when entering commands to load and start a kernel
manually; the default script image will still be present when the
kernel is started and so will be treated as an initrd.  It is possible
to work around this by typing "imgfree" before any other commands, but
this is counter-intuitive.

Fix by allowing the embedded image list to be empty (in which case we
just call autoboot()), and making this the default.

Reported by alkisg@gmail.com.
2009-02-24 05:57:56 +00:00
Michael Brown 4dd746a725 [iscsi] Include credentials in iBFT only if used during iSCSI login
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.
2009-02-20 21:41:00 +00:00
Michael Brown 9937bf13c9 [crypto] Allow creation of arbitrary CBC cipher algorithms using CBC_CIPHER()
Given any block cipher, a corresponding CBC mode of behaviour for the
cipher can be created using the CBC_CIPHER() macro.
2009-02-19 01:53:25 +00:00
Michael Brown e950dc04ba [crypto] Add our own general-purpose cipher-block chaining routines 2009-02-19 01:23:50 +00:00
Michael Brown b4d3d686cc [crypto] Change cipher_{en,de}crypt() to void functions
It is a programming error, not a runtime error, if we attempt to use
block ciphers with an incorrect blocksize, so use an assert() rather
than an error status return.
2009-02-19 00:06:41 +00:00
Michael Brown a3219b24a8 [crypto] Split crypto_algorithm into {digest,cipher,pubkey}_algorithm
The various types of cryptographic algorithm are fundamentally
different, and it was probably a mistake to try to handle them via a
single common type.

pubkey_algorithm is a placeholder type for now.
2009-02-18 22:17:41 +00:00
Michael Brown 991f907d5b [crypto] Rename aes_algorithm to aes_cbc_algorithm 2009-02-18 21:28:46 +00:00
Michael Brown b5577553e5 [pxeprefix] Add .kkpxe image type and ability to return via PXE stack
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>.
2009-02-18 18:12:32 +00:00
Michael Brown 6de4db5da0 [login] Add "login" command and UI 2009-02-17 12:02:16 +00:00
Michael Brown 67ee41ad6d [editbox] Allow for password widgets that do not display their contents 2009-02-17 11:55:55 +00:00
Michael Brown 06b5132fdc [icmp] Add support for responding to pings 2009-02-17 06:59:15 +00:00
Michael Brown 14eafc5b8d [comboot] Fix reference counting on replacement images
When chaining COMBOOT images, the old images now get freed correctly.
2009-02-17 01:45:12 +00:00
Michael Brown 8904cd55f1 [comboot] Allow for tail recursion of COMBOOT images
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.
2009-02-17 00:47:35 +00:00
Michael Brown b08e255ef1 [build] Fix building on gcc 3
GCC did not support #pragma GCC visibility until version 4.0.
2009-02-16 02:15:17 +00:00
Michael Brown 076154a1c6 [image] Allow multiple embedded images
This patch extends the embedded image feature to allow multiple
embedded images instead of just one.

gPXE now always boots the first embedded image on startup instead of
doing the hardcoded DHCP boot (aka autoboot).

Based heavily upon a patch by Stefan Hajnoczi <stefanha@gmail.com>.
2009-02-16 00:30:36 +00:00
Michael Brown d900ae05d7 [base64] Add base64 encoding functions 2009-02-13 14:54:13 +00:00
Michael Brown 8e960eb67c [tls] Use our own ASN.1 routines for certificate parsing
Use our own, more robust, ASN.1 parsing routines to extract the RSA
public key from a server certificate.  Remove the now-unused AXTLS
ASN.1 parser.
2009-02-10 18:30:17 +00:00
Michael Brown 881f1f59ef [pxe] Obey lists of PXE Boot Servers and associated Discovery Control bits
Various combinations of options 43.6, 43.7 and 43.8 dictate which
servers we send Boot Server Discovery requests to, and which servers
we should accept responses from.  Obey these options, and remove the
explicit specification of a single Boot Server from start_pxebs() and
dependent functions.
2009-02-05 09:34:32 +00:00
Michael Brown ff2b308506 [pxe] Skip PXE boot server discovery if directed to do so
Option 43.6 can direct us to skip PXE boot server discovery and just
perform a standard DHCP filename boot.
2009-02-05 09:34:05 +00:00
Michael Brown dbe84c5aad [iobuf] Add iob_disown() and use it where it simplifies code
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.
2009-02-01 20:16:10 +00:00
Michael Brown 4502c04360 [dhcp] Send user class in DHCP requests 2009-02-01 20:06:09 +00:00
Michael Brown e65afc4b10 [dhcp] Split PXE menuing code out of dhcp.c
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.
2009-02-01 01:21:40 +00:00
Stefan Hajnoczi d10a7e7739 [dns] Append local domain to relative names
Try to qualify relative names in the DNS resolver using the DHCP Domain
Name.  For example:

  DHCP Domain Name: etherboot.org
  (Relative) Name: www

yields:

  www.etherboot.org

Only names with no dots ('.') will be modified.  A name with one or more
dots is unchanged.
2009-01-27 19:26:12 +00:00
Michael Brown a128973ecb [settings] Add fetch_string_setting_copy() 2009-01-27 19:13:47 +00:00
Michael Brown 027c72e0d0 [dhcp] Include support for PXE boot menus
PXE dictates a mechanism for boot menuing, involving prompting the
user with a variable message, waiting for a predefined keypress,
displaying a boot menu, and waiting for a selection.

This breaks the currently desirable abstraction that DHCP is a process
that can happen in the background without any user interaction.
2009-01-25 21:16:47 +00:00
Michael Brown ce9690ca39 [console] Allow KEY_xxx constants to cover F8 function key
F8 is represented by the ANSI escape sequence "^[[19~", which is not
representable as a KEY_xxx constant using the current encoding scheme.
Adapt the encoding scheme to allow F8 to be represented, since PXE
requires that we may need to prompt the user to press F8.
2009-01-25 21:10:48 +00:00
Michael Brown 3f814f08e5 [dhcp] Clarify language surrounding ProxyDHCP
Remove the lazy assumption that ProxyDHCP == "DHCP with option 60 set
to PXEClient", and explicitly separate the notion of ProxyDHCP from
the notion of packets containing PXE options.
2009-01-23 01:47:33 +00:00
Michael Brown 76d05a4da0 [dhcp] Pass PXE boot menu item to PXE Boot Server
Pick out the first boot menu item from the boot menu (option 43.9) and
pass it to the boot server as the boot menu item (option 43.71).

Also improve DHCP debug messages to include more details of the
packets being transmitted.
2009-01-23 01:13:50 +00:00
Michael Brown 6941793416 [dhcp] Add preliminary support for PXE Boot Servers
Some PXE configurations require us to perform a third DHCP transaction
(in addition to the real DHCP transaction and the ProxyDHCP
transaction) in order to retrieve information from a "Boot Server".

This is an experimental implementation, since the actual behaviour is
not well specified in the PXE spec.
2009-01-21 03:43:26 +00:00
Michael Brown d230b53df2 [tcpip] Allow for transmission to multicast IPv4 addresses
When sending to a multicast address, it may be necessary to specify
the source address explicitly, since the multicast destination address
does not provide enough information to deduce the source address via
the miniroute table.

Allow the source address specified via the data-xfer metadata to be
passed down through the TCP/IP stack to the IPv4 layer, which can use
it as a default source address.
2009-01-21 03:40:39 +00:00
Michael Brown aa86afe890 [efi] Add an EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL interface
This allegedly optional interface seems to be compulsory if you want
EFI's PXE code to bother trying to use your network interface.
2009-01-12 19:11:30 +00:00
Michael Brown cced04ef3b [efi] Provide component name protocol and device path protocol interfaces
Include a minimal component name protocol so that the driver name
shows up as something other than "<UNKNOWN>" in the driver list, and a
device path protocol so that the network interface shows up as a
separate device in the device list, rather than being attached
directly to the PCI device.

Incidentally, the EFI component name protocol reaches new depths for
signal-to-noise ratio in program code.  A typical instance within the
EFI development kit will use an additional 300 lines of code to
provide slightly less functionality than GNU gettext achieves with
three additional characters.
2009-01-12 19:10:53 +00:00
Michael Brown ba1016f378 [dhcp] Include gPXE version number within DHCP request 2009-01-08 08:39:05 +00:00
Michael Brown fb72336fe6 [efi] Add efirom utility and .efirom image format 2009-01-08 02:19:18 +00:00
Michael Brown 765efac771 [efi] Allow for .efidrv images as well as .efi images
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.
2009-01-07 23:43:26 +00:00
Michael Brown 314779eb36 [efi] Use elf2efi utility in place of efilink
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.
2009-01-07 22:59:05 +00:00
Michael Brown 85e5e25c52 [build] Avoid strict-aliasing warnings when building with gcc 4.4
Conventional usage of the various struct sockaddr_xxx types involves
liberal use of casting, which tends to trigger strict-aliasing
warnings from gcc.  Avoid these now and in future by marking all the
relevant types with __attribute__((may_alias)).
2009-01-05 19:20:26 -08:00
Michael Brown 53a7dd26cd [infiniband] Call ib_open() only when opening the IPoIB net device
Defer the call to ib_open() until we want to actually open the device,
rather than when the device is registered.
2009-01-02 21:04:31 +00:00
Michael Brown ce0a0ccf5c [x86_64] Add support for compilation as an x86_64 binary
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
2008-12-05 00:06:27 +00:00
Michael Brown 29480dd715 [efi] Use EFI-native mechanism for accessing SMBIOS table
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.
2008-12-04 23:19:12 +00:00
Michael Brown 045a22764a [efi] Allow use of EFI configuration tables
EFI passes in copies of SMBIOS and other system configuration tables
via the EFI system table.  Allow configuration tables to be requested
using a mechanism similar to the current method for requesting EFI
protocols.
2008-12-04 23:18:32 +00:00
Pantelis Koukousoulas 7166bc7b2d [b44] Add driver for Broadcom bcm44xx cards
This driver is based on Stefan Hajnoczi's summer work, which
is in turn based on version 1.01 of the linux b44 driver.
I just assembled the pieces and fixed/added a few pieces
here and there to make it work for my hardware.

The most major limitation is that this driver won't work
on systems with >1GB RAM due to the card not having enough
address bits for that and gPXE not working around this
limitation.

Still, other than that the driver works well enough for
at least 2 users :) and the above limitation can always
be fixed when somebody wants it bad enough :)

Signed-off-by: Pantelis Koukousoulas <pktoss@gmail.com>
2008-11-21 23:22:50 +00:00
Michael Brown 02a0215873 [netdevice] Provide function to retrieve the most recently opened net device
There are currently four places within the codebase that use a
heuristic to guess the "boot network device", with varying degrees of
success.  Add a feature to the net device core to maintain a list of
open network devices, in order of opening, and provide a function
last_opened_netdev() to retrieve the most recently opened net device.
This should do a better job than the current assortment of
guess_boot_netdev() functions.
2008-11-21 20:34:02 +00:00
Michael Brown 246ddf5ee4 [aoe] Use an AoE config query to identify the target MAC address
The AoE spec does not specify that the source MAC address of a
received packet actually matches the MAC address of the AoE target.
In principle an AoE server can respond to an AoE request on any
interface available to it, which may not be an address configured to
accept AoE requests.

This issue is resolved by implementing AoE device discovery.  The
purpose of AoE discovery is to find out which addresses an AoE target
can use for requests.  An AoE configuration command is sent when the
AoE attach is attempted.  The AoE target must respond to that
configuration query from an interface that can accept requests.

Based on a patch from Ryan Thomas <ryan@coraid.com>
2008-11-19 21:42:33 +00:00
Laurent Vivier a2686a55c4 [blockdev] Move block device operations to structure block_device_operations
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
2008-11-19 20:04:43 +00:00
Laurent Vivier b48f37e69a [virtio] Split virtio-net.c into several files.
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
2008-11-19 19:58:51 +00:00
Laurent Vivier d3d8f20626 [virtio] Remove dependency on nic for virtio PCI functions
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
2008-11-19 19:51:38 +00:00
Laurent Vivier fc49421c7e [virtio] Consolidate vring_get_buf() by using a buffer list to add to the vring
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
2008-11-19 19:50:51 +00:00
Laurent Vivier 5dd5107976 [virtio] Move virtio-pci.h and virtio-ring.h to include/gpxe
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
2008-11-19 19:48:30 +00:00
Michael Brown 0ebbbb95fa [x86_64] Fix assorted 64-bit compilation errors and warnings
Remove various 32-bit assumptions scattered throughout the codebase.
The code is still not necessarily 64-bit clean, but will at least
compile.
2008-11-19 19:33:05 +00:00
Michael Brown 3f85626fa9 [efi] Add efi_strerror()
EFI_STATUS is defined as an INTN, which maps to UINT32 (i.e. unsigned
int) on i386 and UINT64 (i.e. unsigned long) on x86_64.  This would
require a cast each time the error status is printed.

Add efi_strerror() to avoid this ickiness and simultaneously enable
prettier reporting of EFI status codes.
2008-11-19 19:22:49 +00:00
Michael Brown d9b3d09910 [i386] Move iSCSI and AoE boot code to arch/i386/interface/pcbios 2008-11-19 19:20:45 +00:00
Michael Brown dc60c24146 [i386] Rename __cdecl to __asmcall
__cdecl is a misleading name, since it currently encapsulates both
cdecl and regparm(0) attributes.  Rename to __asmcall.
2008-11-19 19:12:53 +00:00
Michael Brown 446b6d5fdd [pxe] Move all PXE files to arch/i386
The initial PXE implementation in Etherboot had the goal of being
architecture-agnostic, but this goal has not been realised.
2008-11-18 22:27:02 +00:00
Michael Brown fca2dcabb8 [elf] Kill off unused <bits/elf.h> and <bits/elf_x.h> header files 2008-11-18 22:16:15 +00:00
Michael Brown ab96932ab3 [efi] Update to latest UEFI headers 2008-11-18 21:54:51 +00:00
Michael Brown 54fbd11221 [build] Keep gcc 4.4 happy
gcc 4.4 adds another few warnings, and also seems to complain if we
place %ebp in the clobber list for any inline asm.
2008-11-18 01:52:40 +00:00
Michael Brown 1b3edd9e11 [infiniband] Respect hop pointer when building directed route SMP return path
The return path in directed route SMPs lists the egress ports in order
from SM to node, rather than from node to SM.

To write to the correct offset within the return path, we need to
parse the hop pointer.  This is held within the class-specific data
portion of the MAD header, which was previously unused by us and
defined to be a uint16_t.  Define this field to be a union type; this
requires some rearrangement of ib_mad.h and corresponding changes to
ipoib.c.
2008-11-12 15:35:45 +00:00
Michael Brown 125c6d66a8 [linda] Add support for QLogic 7220-based Infiniband HCAs
These cards very nearly support our current IB Verbs model.  There is
one minor difference: multicast packets will always be delivered by
the hardware to QP0, so the driver has to redirect them to the
appropriate QP.  This means that QP owners may see receive completions
for buffers that they never posted.  Nothing in our current codebase
will break because of this.
2008-11-11 05:58:47 +00:00
Michael Brown 9e5fd8ec59 [infiniband] Add raw packet parser and constructor
This can be used with cards that require the driver to construct and
parse packet headers manually.  Headers are optionally handled
out-of-line from the packet payload, since some such cards will split
received headers into a separate ring buffer.
2008-11-11 05:31:19 +00:00
Michael Brown c0ec00f47f [infiniband] Add a standalone subnet management agent
This generic SMA code can be used for any cards that do not provide
firmware-based embedded SMAs.
2008-11-11 05:31:18 +00:00
Michael Brown 9a35830d1f [ipoib] Kill off the IPoIB pseudo-header
Some Infiniband cards will not be as accommodating as the Arbel and
Hermon cards in providing enough space for us to push a fake extra
header at the start of the received packet.  We must therefore make do
with squeezing enough information to identify source and destination
addresses into the two bytes of padding within a genuine IPoIB
link-layer header.
2008-11-11 05:31:08 +00:00
Michael Brown 663904a7bc [infiniband] Split subnet management agent client out into ib_smc.c
Not all Infiniband cards have embedded subnet management agents.
Split out the code that communicates with such an embedded SMA into a
separate ib_smc.c file, and have drivers call ib_smc_update()
explicitly when they suspect that the answers given by the embedded
SMA may have changed.
2008-11-11 05:31:07 +00:00
Michael Brown 830e19eb54 [infiniband] Pass address vector in receive completions
Receive completion handlers now get passed an address vector
containing the information extracted from the packet headers
(including the GRH, if present), and only the payload remains in the
I/O buffer.

This breaks the symmetry between transmit and receive completions, so
remove the ib_completer_t type and use an ib_completion_queue_operations
structure instead.

Rename the "destination QPN" and "destination LID" fields in struct
ib_address_vector to reflect its new dual usage.

Since the ib_completion structure now contains only an IB status code,
("syndrome") replace it with a generic gPXE integer status code.
2008-11-11 05:31:07 +00:00
Michael Brown 0de5f7af6d [infiniband] Maintain queue fill level as a property of a work queue
Both queue owners and drivers often need to keep track of the fill
level, so let's make it a generic property.
2008-11-11 05:31:06 +00:00
Michael Brown d9751edafa [infiniband] Flush uncompleted work queue entries at QP teardown
Avoid leaking I/O buffers in ib_destroy_qp() by completing any
outstanding work queue entries with a generic error code.  This
requires the completion handlers to be available to ib_destroy_qp(),
which is done by making them static configuration parameters of the CQ
(set by ib_create_cq()) rather than being provided on each call to
ib_poll_cq().

This mimics the functionality of netdev_{tx,rx}_flush().  The netdev
flush functions would previously have been catching any I/O buffers
leaked by the IPoIB data queue (though not by the IPoIB metadata
queue).
2008-11-11 05:31:06 +00:00
Pantelis Koukousoulas dd34500188 [ne2k_isa] Restore support for ne2k isa cards
Add the simplified ne2k_isa driver.  It is just a selective copy+paste
of the relevant parts from ns8390.c plus a little trivial hacking to
make it actually work.

It is true that the code is pretty ugly, but:
  a) ns8390.c is worse
  b) It is only 372 lines and no #ifdefs
  c) It works both in qemu/bochs and in real hardware
     and we all know it is easier to cleanup working code

Hope someone will find the time to rewrite this driver properly,
but until then at least for me this is an ok solution.

Signed-off-by: Pantelis Koukousoulas <pktoss@gmail.com>
2008-11-08 13:01:20 +00:00
Michael Brown 9a52ba0cfa [netdevice] Retain and report detailed error breakdowns
netdev_rx_err() and netdev_tx_complete_err() get passed the error
code, but currently use it only in debug messages.

Retain error numbers and frequencey counts for up to
NETDEV_MAX_UNIQUE_ERRORS (4) different errors for each of TX and RX.
This allows the "ifstat" command to report the reasons for TX/RX
errors in most cases, even in non-debug builds.
2008-11-08 05:30:30 +00:00
Michael Brown 0a6c66a830 [settings] Add the notion of a "tag magic" to numbered settings
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.
2008-10-30 21:47:14 +00:00
Michael Brown c99b16c974 [efi] Add basic implementation of EFI SIMPLE_NETWORK_PROTOCOL
This implementation is tested and working, but not currently tied in
to the EFI build.
2008-10-16 05:38:23 +01:00
Michael Brown 3a505dfc35 [netdevice] Change link-layer push() and pull() methods to take raw types
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.
2008-10-16 05:13:40 +01:00
Michael Brown 6b9cc25556 [netdevice] Split multicast hashing out into an mc_hash method
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.
2008-10-16 05:12:56 +01:00
Michael Brown 832668105e [netdevice] Add maximum packet length as a net device property
Currently this length is set at device allocation time, and is never
changed.
2008-10-16 05:11:47 +01:00
Michael Brown 81d92c6d34 [efi] Add EFI image format and basic runtime environment
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.
2008-10-13 10:24:14 +01:00
Michael Brown 54c024e0af [sanboot] Quick and dirty hack to make SAN boot protocols selectable 2008-10-13 10:05:51 +01:00
Michael Brown 831e4cfc27 [umalloc] Formalise the user memory allocation API 2008-10-13 05:33:14 +01:00
Michael Brown 6554b79ff9 [uaccess] Formalise the uaccess API
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().
2008-10-13 04:10:34 +01:00
Michael Brown c0835339d0 [nap] Formalise the CPU sleeping API 2008-10-12 23:36:53 +01:00
Michael Brown 16f1e35775 [timer] Formalise the timer API
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().
2008-10-12 20:22:02 +01:00
Michael Brown f945d6d201 [retry] Use a separate flag to indicate that a retry timer is running
Using start==0 to indicate a stopped timer is dangerous, because 0 is a
valid value for the current tick counter.
2008-10-12 15:11:20 +01:00
Michael Brown 8a4ccebec9 [pci] Formalise the PCI I/O API 2008-10-12 12:54:12 +01:00
Michael Brown fd67452807 [legacy] Add missing #include <gpxe/io.h> 2008-10-12 12:52:56 +01:00
Michael Brown aef6d0df5c [ioapi] Absorb virt_to_phys() and phys_to_virt() into the I/O API 2008-10-12 02:15:34 +01:00
Michael Brown 8956a36be5 [ioapi] Formalise the I/O API as used in i386-pcbios 2008-10-12 01:03:17 +01:00
Michael Brown 2e812235f4 [makefile] Add -Wformat-nonliteral as an extra warning category
-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>.
2008-10-10 18:41:24 +01:00
Michael Brown ac663cf509 [efi] Add EFI headers from the EFI Development Kit (edk2)
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.
2008-10-10 04:04:07 +01:00
Michael Brown 160b950af8 [libc] Define wchar_t in a gcc-compatible way
gcc defines the magic __WCHAR_TYPE__ macro, in order to convey
information about whether or not the user selected -fshort-wchar.
2008-10-07 22:27:55 +01:00
Michael Brown 19a0452205 [libc] Add function declaration for main() in stdlib.h 2008-10-07 22:04:50 +01:00
Michael Brown 521549d900 [crypto] Rename <gpxe/bitops.h> to <gpxe/rotate.h> 2008-10-01 19:24:56 +01:00
Michael Brown 9dccbc0af2 [i2c] Generalise i2c bit-bashing support to addressless devices
Some devices (e.g. the Atmel AT24C11) have no concept of a device
address; they respond to every device address and use this value as
the word address.  Some other devices use part of the device address
field to extend the word address field.

Generalise the i2c bit-bashing support to handle this by defining the
device address length and word address length as properties of an i2c
device.  The word address is assumed to overflow into the device
address field if the address used exceeds the width of the word
address field.

Also add a bus reset mechanism.  i2c chips don't usually have a reset
line, so rebooting the host will not clear any bizarre state that the
chip may be in.  We reset the bus by clocking SCL until we see SDA
high, at which point we know we can generate a start condition and
have it seen by all devices.  We then generate a stop condition to
leave the bus in a known state prior to use.

Finally, add some extra debugging messages to i2c_bit.c.
2008-10-01 19:24:56 +01:00
Michael Brown afe1323c76 [compiler] Allow for selective disabling of debug levels at runtime
The usefulness of DBGLVL_IO is limited by the fact that many cards
require large numbers of uninteresting I/O reads/writes at device
probe time, typically when driving a bit-bashing I2C/SPI bus to read
the MAC address.

This patch adds the DBG_DISABLE() and DBG_ENABLE() macros, which can
be used to temporarily disable and re-enable selected debug levels.
Note that debug levels must still be enabled in the build in order to
function at all: you can't use DBG_ENABLE(DBGLVL_IO) in an object
built with DEBUG=object:1 and expect it to do anything.
2008-10-01 19:24:56 +01:00
Michael Brown 9b01a9fd9c [compiler] Add __always_inline macro 2008-10-01 19:24:56 +01:00
Michael Brown e2d5788716 [settings] Expose MAC address setting for general use 2008-09-26 03:39:17 +01:00
Michael Brown aa8d972581 [dhcp] Accept BOOTP as well as DHCP 2008-09-25 01:35:15 +01:00
Michael Brown b350b10b35 [uri] Add uri_encode() and uri_decode() functions for URI character encoding 2008-09-24 07:21:47 +01:00
Daniel Verkamp e8b22f203f [comboot] Add COMBOOT and COM32 support 2008-08-28 23:52:19 +01:00
Michael Brown 30fb3b3810 [undi] Fill in ProtType correctly in PXENV_UNDI_ISR
Determine the network-layer packet type and fill it in for UNDI
clients.  This is required by some NBPs such as emBoot's winBoot/i.

This change requires refactoring the link-layer portions of the
gPXE netdevice API, so that it becomes possible to strip the
link-layer header without passing the packet up the network stack.
2008-08-20 03:21:37 +01:00
Michael Brown 320b072c7a [pcbios] Support arbitrary splits of the e820 memory map
Allow for an arbitrary number of splits of the system memory map via
INT 15,e820.

Features of the new map-mangling algorithm include:

  Supports random access to e820 map entries.

  Requires only sequential access support from the underlying e820
  map, even if our caller uses random access.

  Empty regions will always be stripped.

  Always terminates with %ebx=0, even if the underlying map terminates
  with CF=1.

  Allows for an arbitrary number of hidden regions, with underlying
  regions split into as many subregions as necessary.

Total size increase to achieve this is 193 bytes.
2008-08-18 07:17:41 +01:00
Andrew Schran ff2b6a512d [retry] Added configurable timeouts to retry timer
New min_timeout and max_timeout fields in struct retry_timer allow
users of this timer to set their own desired minimum and maximum
timeouts, without being constrained to a single global minimum and
maximum. Users of the timer can still elect to use the default global
values by leaving the min_timeout and max_timeout fields as 0.
2008-08-12 01:05:26 +01:00
Michael Brown 5d4839b577 [iSCSI] Add support for mutual CHAP
Allow initiator to verify target authentication using CHAP.
2008-08-11 03:43:12 +01:00
Michael Brown 7ad2f652b4 [libc] Add missing __attribute__ (( format ( printf ) )) to ssnprintf() 2008-08-11 02:31:14 +01:00
Michael Brown 481a21798d [autoboot] Retain initial-slash (if present) when constructing TFTP URIs
When we boot from a DHCP-supplied filename, we previously relied on
the fact that the current working URI is set to tftp://[next-server]/
in order to resolve the filename into a full tftp:// URI.  However,
this process will eliminate the distinction between filenames with and
without initial slashes:

 cwuri="tftp://10.0.0.1/" filename="vmlinuz"  => URI="tftp://10.0.0.1/vmlinuz"
 cwuri="tftp://10.0.0.1/" filename="/vmlinuz" => URI="tftp://10.0.0.1/vmlinuz"

This distinction is important for some TFTP servers.  We now
explicitly construct a string of the form

 "tftp://[next-server]/filename"

so that a filename with an initial slash will result in a URI
containing a double-slash, e.g.

 "tftp://10.0.0.1//vmlinuz"

The TFTP code always strips a single initial slash, and so ends up
presenting the correct path to the server.

URIs entered explicitly by users at the command line must include a
double slash if they want an initial slash presented to the TFTP
server:

  "kernel tftp://10.0.0.1/vmlinuz"  => filename="vmlinuz"
  "kernel tftp://10.0.0.1//vmlinuz" => filename="/vmlinuz"
2008-07-31 16:55:46 +01:00
Andrew Schran 6b58992318 [tg3] Added support for tg3-5754.
In tg3_chip_reset(), the PCI_EXPRESS change is taken from the Linux
tg3 driver. I am not sure what exactly it does (it is not documented
in the Linux driver), but it is necessary for the NIC to work
correctly.
2008-07-24 19:55:53 +01:00
Michael Brown 03c80c12b8 [iSCSI] Support Windows Server 2008 direct iSCSI installation
Add yet another ugly hack to iscsiboot.c, this time to allow the user to
inhibit the shutdown/removal of the iSCSI INT13 device (and the network
devices, since they are required for the iSCSI device to function).

On the plus side, the fact that shutdown() now takes flags to
differentiate between shutdown-for-exit and shutdown-for-boot means that
another ugly hack (to allow returning via the PXE stack on BIOSes that
have broken INT 18 calls) will be easier.

I feel dirty.
2008-07-17 17:45:17 +01:00
Michael Brown dbe9269f3a [bzimage] Kill off the initrd image type
We can just treat all non-kernel images as initrds, which matches our
behaviour for multiboot kernels.  This allows us to eliminate initrd as
an image type, and treat the "initrd" command as just another synonym for
"imgfetch".
2008-07-08 01:30:11 +01:00
Michael Brown 3ad348e55a [phantom] Add support for NetXen Phantom NICs 2008-07-04 19:38:14 -07:00
Stefan Hajnoczi e9e1da131a [GDB] Provide functions to manually enter GDB stub. 2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 19386ec2c8 [GDB] Add watch and rwatch hardware watchpoints 2008-06-30 19:19:48 +01:00
Stefan Hajnoczi 6e670b5f38 [GDB] Remote debugging over UDP
This commit implements GDB over UDP.  Using UDP is more complex than
serial and has required some restructuring.

The GDB stub is now built using one or both of GDBSERIAL and GDBUDP
config.h options.

To enter the debugger, execute the gPXE shell command:
gdbstub <transport> [<options>...]

Where <transport> is "serial" or "udp".  For "udp", the name of a
configured network device is required:
gdbstub udp net0

The GDB stub listens on UDP port 43770 by default.
2008-06-30 19:19:48 +01:00
Michael Brown 4c75e9ded4 [nvs] Add support for ST M25P32 SPI flash devices 2008-06-27 14:39:25 -07:00
Michael Brown 0d91c37ce5 [legacy] Align legacy drivers' __shared data to the maximum possible
Some drivers that still use the legacy-driver wrapper (tg3 in particular)
apparently do not specify their alignment constraints properly.  This
hack forces any __shared data to be maximally aligned.

Note that this provides only 16-byte alignment; it is not possible to
request alignment to any greater than 16 bytes using
__attribute__((aligned)), since the relocation code will preserve only 16
byte alignment (and operation under -DKEEP_IT_REAL cannot preserve more
that 16 byte alignment).

Idea proposed by Tim Hockin <thockin@google.com>
2008-06-14 20:01:14 +01:00
Michael Brown 31c6df5365 [cleanup] Remove long-obsolete gpxe/async.h header file 2008-06-12 13:15:53 +01:00
Michael Brown 32e8ab4df0 [retry] Add start_timer_fixed()
Allow for timers to be started with fixed timeouts.
2008-06-11 09:37:58 +01:00
Michael Brown 72c1bb8224 [slam] Add Scalable Local Area Multicast (SLAM) protocol support
Tested against the mini-slamd server located in contrib/mini-slamd
with a single client, on a lossy network.
2008-06-10 00:04:19 +01:00
Michael Brown aa160211c2 [udp] Verify local socket address (if specified) for UDP sockets
UDP sockets can be used for multicast, at which point it becomes
plausible that we could receive packets that aren't destined for us
but that still match on a port number.
2008-06-10 00:01:29 +01:00
Michael Brown 77a5cc6b13 [ELF] Add ability to boot ELF images generated by wraplinux and mkelfImage
Delete ELF as a generic image type.  The method for invoking an
ELF-based image (as well as any tables that must be set up to allow it
to boot) will always depend on the specific architecture.  core/elf.c
now only provides the elf_load() function, to avoid duplicating
functionality between ELF-based image types.

Add arch/i386/image/elfboot.c, to handle the generic case of 32-bit
x86 ELF images.  We don't currently set up any multiboot tables, ELF
notes, etc.  This seems to be sufficient for loading kernels generated
using both wraplinux and coreboot's mkelfImage.

Note that while Etherboot 5.4 allowed ELF images to return, we don't.
There is no callback mechanism for the loaded image to shut down gPXE,
which means that we have to shut down before invoking the image.  This
means that we lose device state, protection against being trampled on,
etc.  It is not safe to continue afterwards.
2008-06-09 13:50:00 +01:00