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

2744 Commits

Author SHA1 Message Date
Michael Brown 1284773363 [tftp] Temporary fix for conveying TFTP block size to callers
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.
2009-01-27 15:47:00 +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 f1d17ae2be [bios] Add F8 function key as a recognised BIOS keycode 2009-01-25 21:12:48 +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 773d9631ef [dhcp] Handle missing ProxyDHCP servers
It is possible to configure a DHCP server to hand out PXE options
without a ProxyDHCP server present.  This requires setting option 60
to "PXEClient", which will cause gPXE to attempt ProxyDHCP.

We assume in several places that dhcp->proxydhcpack is set to the
DHCPACK packet containing option 60 set to "PXEClient".  When we
transition into ProxyDHCPREQUEST, set dhcp->proxydhcpack=dhcp->dhcpack
so that this assumption holds true.

We ought to rename several references to "proxydhcp" to something more
accurate, such as "pxedhcp".  Treating a single DHCP response as
potentially both DHCPOFFER and ProxyDHCPOFFER does make the code
smaller, but the variable names get confusing.
2009-01-23 01:32:04 +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 cf53998901 [tcp] Always set PUSH flag on TCP transmissions
Apparently this can cause a major speedup on some iSCSI targets, which
will otherwise wait for a timer to expire before responding.  It
doesn't seem to hurt other simple TCP test cases (e.g. HTTP
downloads).

Problem and solution identified by Shiva Shankar <802.11e@gmail.com>
2009-01-21 04:22:34 +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 b4a95a8974 [ethernet] Fix eth_mc_hash() return status
eth_mc_hash() was missing a return within a switch statement, and so
always falling through to the default case and returning failure.
2009-01-21 03:38:25 +00:00
Michael Brown 7be5fa82e3 [dhcp] Centralise DHCP successful state transitions
Move all the DHCP state transition logic into a single function
dhcp_next_state().  This will make it easier to add support for PXE
Boot Servers, since it abstracts away the difference between "mark
DHCP as complete" and "transition to boot server discovery".
2009-01-21 01:31:52 +00:00
Michael Brown d7de30e5e4 [dhcp] Allow for missing server ID in ProxyDHCPACK
The Linux PXE server (http://www.kano.org.uk/projects/pxe) does not
set the server identifier in its ProxyDHCP responses.  If the server
ID is missing, do not treat this as an error.

This resolves the "vague and unsettling memory" mentioned in commit
fdb8481d ("[dhcp] Verify server identifier on ProxyDHCPACKs").

Note that we already accept ProxyDHCPOFFERs without a server
identifier; they get treated as potential BOOTP packets.
2009-01-21 00:55:42 +00:00
Michael Brown 08f6d22410 [efi] Expose both GUIDs for the EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL
At some point, it seems that someone decided to change the GUID for
the EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL.  Current EFI builds
ignore the older GUID, older EFI builds ignore the newer GUID, so we
have to expose both.
2009-01-12 20:53:38 +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 8fd81349b3 [efi] Ensure EFI ROM checksum is zero
The UEFI specification does not mention ROM checksums, and reassigns
the field typically used as a checksum byte.  The UEFI shell
"loadpcirom" utility does not verify ROM checksums, but it seems that
some UEFI BIOSes do.
2009-01-09 20:52:26 +00:00
Michael Brown 48b2f70ee4 [util] Tidy up output of disrom.pl 2009-01-09 19:38:53 +00:00
Michael Brown ba1016f378 [dhcp] Include gPXE version number within DHCP request 2009-01-08 08:39:05 +00:00
Michael Brown 3e220aa73e [main] Print an "initialising devices" banner
Some devices take a very long time to initialise.  This can make it
difficult to visually distinguish between the error cases of failing
to start executing C code and failing to initialise a device.

Add a "gPXE initialising devices..." message.  The trailing ellipsis
indicates to the user that this may take some time, and the presence
of the message indicates to the developer that relocation etc. all
succeeded.
2009-01-08 03:48:30 +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 21cfab4fb8 [efi] Inhibit harmless ld warning on unresolved symbol check
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.
2009-01-05 12:54:40 -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
Marty Connor 8674bc05a0 [pcbios] Add additional sanity check for bogus e820 map
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").
2008-12-18 17:28:57 +00:00
Michael Brown 57bbf0ec98 [etherfabric] Make use of pci_bar_start() 64-bit clean
Driver was storing the result of pci_bar_start() and pci_bar_size() in
an int, rather than an unsigned long.

(Bug was introduced in the vendor's tree in commit eac85cd "Port
etherfabric driver to net_device api".)
2008-12-12 19:18:04 +00:00
Michael Brown 1941c933f8 [pci] Enable memory cycles in adjust_pci_device()
adjust_pci_device() has historically enabled bus-mastering and I/O
cycles, but has never previously needed to enable memory cycles.  Some
EFI systems seem not to enable memory cycles by default, so add that
to the list of PCI command register bits that we force on.
2008-12-12 19:15:00 +00:00
Marty Connor 1206999288 [e1000] Use PCI_BASE_ADDRESS_* symbols instead of integers
When compiling for the Linux kernel, PCI_BASE_ADDRESS_0 == 0, and
PCI_BASE_ADDRESS_1 == 1.  This is not so when compiling for gPXE.  We
must use the symbolic names rather than integers to get the correct
values.

Bug identified and patch supplied by:

   George Chou <george.chou@advantech.com>
2008-12-05 16:35:33 +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 b0d2c9a4d5 [hermon] Fix permissions broken in 3a799e9 ("Add PCI ID for ConnectX QDR card")
The patch file supplied for commit 3a799e9 ("[hermon] Add PCI ID for
ConnectX QDR card") accidentally marked drivers/infiniband/hermon.c as
being executable.
2008-12-04 23:27:21 +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
Michael Brown 3a799e99ca [hermon] Add PCI ID for ConnectX QDR card
Patch provided by Itay Gazit <itaygazit@gmail.com>.
2008-12-04 20:48:53 +00:00
Michael Brown 4d7c650164 [romprefix] Change from opt-in to opt-out when booting via INT19
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.
2008-12-04 16:46:16 +00:00
Marty Connor 708e6e0613 [release] Update version to 0.9.6+ post release 2008-11-23 17:01:17 -05:00
Marty Connor 74b7bc0954 [release] Update version to 0.9.6 for release 2008-11-23 16:44:45 -05: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 e78bcb6175 [netdevice] Kill off the various guess_boot_netdev() functions
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.
2008-11-21 20:34:42 +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 8e8a348fd4 [pxe] Select the correct network device on multiport cards
When trying to find the "first open network device", it helps to
actually check the NETDEV_OPEN flag.
2008-11-21 19:45:05 +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 14a739ba6a [virtio] Consolidate virtio-net static data into a struct vring_virtqueue
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
2008-11-19 19:55:54 +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