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

3907 Commits

Author SHA1 Message Date
Michael Brown 3a2bda7c7c [rng] Add ANS X9.82 Approved DRBG mechanism
ANS X9.82 specifies that an Approved DRBG must consist of an Approved
algorithm wrapped inside an envelope which handles entropy gathering,
prediction resistance, automatic reseeding and other housekeeping
tasks.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-01-23 15:08:21 +00:00
Michael Brown fcc35bf487 [rng] Add dummy entropy source
Cryptographic random number generation requires an entropy source,
which is used as the input to a Deterministic Random Bit Generator
(DRBG).

iPXE does not currently have a suitable entropy source.  Provide a
dummy source to allow the DRBG code to be implemented.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-01-23 15:07:46 +00:00
Michael Brown 9ec80a3df1 [rng] Add NIST self-tests for HMAC_DRBG
NIST provides a set of known-answer tests for the HMAC_DRBG algorithm,
which can be used as part of the conformance testing for ANS X9.82.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-01-23 15:06:08 +00:00
Michael Brown 5c2d6fa399 [rng] Add ANS X9.82 Approved HMAC_DRBG algorithm
ANS X9.82 specifies several Approved algorithms for use in a
Deterministic Random Bit Generator (DRBG).  One such algorithm is
HMAC_DRBG, which can be implemented using the existing iPXE SHA-1 and
HMAC functionality.  This algorithm provides a maximum security
strength of 128 bits.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-01-23 15:03:43 +00:00
Michael Brown f5bbe7ec4a [lkrnprefix] Copy command line before installing iPXE
The command line may be situated in an area of base memory that will
be overwritten by iPXE's real-mode segments, causing the command line
to be corrupted before it can be used.

Fix by creating a copy of the command line on the prefix stack (below
0x7c00) before installing the real-mode segments.

Reported-by: Dave Hansen <dave@sr71.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-01-18 00:02:16 +00:00
Michael Brown 18d2887281 [test] Add self-tests for SHA-1 algorithm
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-01-11 10:38:28 +00:00
Michael Brown 187cd80106 [dns] Allow trailing dots in DNS names
Reported-by: Christian Hesse <list@eworm.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-01-10 23:25:00 +00:00
Michael Brown 55f6c88a27 [vmxnet3] Add VMware vmxnet3 driver
Reviewed-by: Pete Holland <pholland27@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-01-06 23:49:04 +00:00
Michael Brown 9a93db3f09 [pxe] Provide PXENV_FILE_EXIT_HOOK only for ipxelinux.0 builds
PXENV_FILE_EXIT_HOOK is designed to allow ipxelinux.0 to unload both
the iPXE and pxelinux components without affecting the underlying PXE
stack.  Unfortunately, it causes unexpected behaviour in other
situations, such as when loading a non-embedded pxelinux.0 via
undionly.kpxe.  For example:

  PXE ROM -> undionly.kpxe -> pxelinux.0 -> chain.c32 to boot hd0

would cause control to return to iPXE instead of booting from the hard
disk.  In some cases, this would result in a harmless but confusing
"No more network devices" message; in other cases stranger things
would happen, such as being returned to the iPXE shell prompt.

The fundamental problem is that when pxelinux detects
PXENV_FILE_EXIT_HOOK, it may attempt to specify an exit hook and then
exit back to iPXE, assuming that iPXE will in turn exit cleanly via
the specified exit hook.  This is not a valid assumption in the
general case, since the action of exiting back to iPXE does not
directly cause iPXE to exit itself.  (In the specific case of
ipxelinux.0, this will work since the embedded script exits as soon as
pxelinux.0 exits.)

Fix the unexpected behaviour in the non-ipxelinux.0 cases by including
support for PXENV_FILE_EXIT_HOOK only when using a new .kkkpxe format.
The ipxelinux.0 build process should therefore now use undionly.kkkpxe
instead of undionly.kkpxe.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-12-11 02:28:04 +00:00
Michael Brown fa410e0a41 [pxe] Modularise PXE API provision
Use the linker table infrastructure to dispatch PXE API calls to the
relevant function.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-12-11 02:27:58 +00:00
Michael Brown 61944ed602 [pxe] Tidy up debugging output
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-12-08 02:56:46 +00:00
Michael Brown faf50e8fa3 [pxe] Check for a valid PXE network device when applicable
Very nasty things can happen if a NULL network device is used.  Check
that pxe_netdev is non-NULL at the applicable entry points, so that
this type of problem gets reported to the caller rather than being
allowed to crash the system.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-12-08 02:35:23 +00:00
Michael Brown 29651e0c02 [lotest] Accept non-loopback packets during test
It can sometimes be awkward to prevent additional packets from being
received during a loopback test.  Allow such additional packets to be
present without terminating the test.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-12-08 00:30:28 +00:00
Michael Brown f289391134 [e1000e] Strip the Ethernet CRC from received packets
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-12-08 00:29:33 +00:00
Michael Brown fa3ca017ac [undi] Retry PXENV_UNDI_INITIALIZE multiple times
On at least one PXE stack (Realtek r8169), PXENV_UNDI_INITIALIZE has
been observed to fail intermittently due to a media test failure (PXE
error 0x00000061).  Retrying the call to PXENV_UNDI_INITIALIZE
succeeds, and the NIC is then usable.

It is worth noting that this particular Realtek PXE stack is already
known to be unreliable: for example, it repeatably fails its own
boot-time media test after every warm reboot.

Fix by attempting PXENV_UNDI_INITIALIZE multiple times, with a short
delay between each attempt to allow the link to settle.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-12-08 00:12:28 +00:00
Michael Brown 8926c233f6 [dhcp] Add PXE-mandated DHCP options [128,135] to parameter request list
The PXE specification requires us to request DHCP options 128 to 135
inclusive, although these have no defined purpose.

Suggested-by: Ralf Buettner <rab@bootix.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-12-06 13:54:45 +00:00
Michael Brown d5e273e5c2 [e1000] Request notification of TX completions
The RS bit is used to instruct the NIC to update the TX descriptor
status byte.  The RPS bit is used to instruct the NIC to defer this
update until after the packet has been transmitted on the wire (rather
than merely read into the transmit FIFO).

The driver currently sets RPS but not RS.  Some e1000 models seem to
interpret this as implying that the status byte should be updated;
some don't.  On the ones that don't, we never see any TX completions
and so rapidly run out of TX buffers.

Fix by setting the RS bit in the TX descriptor.  (We don't care about
when the packet reaches the wire, so don't bother setting the RPS
bit.)

Reported-by: Miroslav Halas <miroslav.halas@bankofamerica.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-12-06 01:50:28 +00:00
Michael Brown bd718b2110 [iscsi] Fail immediately if target rejects any of our parameters
Some iSCSI targets (observed with stgt) can be configured to reject
connections that do not use header or data digests, and will respond
with "HeaderDigest=Reject" and/or "DataDigest=Reject", while still
allowing the connection to proceed to the full feature phase.

According to a strict reading of RFC3720, we are perfectly safe to
ignore these "Reject" messages: upon such a rejection "the negotiated
key is left at its current value (or default if no value was set)".
Since the default value for both HeaderDigest and DataDigest is
"None", then the only viable conclusion to be drawn is that the value
resulting from "Reject" is still "None".

Unfortunately, stgt doesn't seem to agree with this interpretation of
events, causing us to eventually report an unhelpful "connection timed
out" message to the user when we don't get any response to our first
PDU in full feature phase.

Fix by detecting any rejected parameters and immediately reporting an
error, which at least gives the user some insight as to what the real
problem may be.

Reported-by: Michal Suchanek <hramrach@centrum.cz>
Tested-by: Michal Suchanek <hramrach@centrum.cz>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-12-05 20:39:07 +00:00
Michael Brown c46acda672 [build] Include UNDI PCI driver within all-drivers build
Commit 9b99d2a ("[build] Avoid generating ROMs with "match-any" vendor
or device IDs") introduced a regression which caused the UNDI PCI
driver to be omitted from the list of all drivers, and thus to be
excluded from the all-drivers build.

Fix by ensuring that the per-driver section of the Makefile is
generated even when there are no ROMs to be built.

Reported-by: Sven Dreyer <sven@dreyer-net.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-16 00:22:30 +00:00
Michael Brown 8ef5f6065d [arbel] Ensure hardware is quiescent when no interfaces are open
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-15 23:53:26 +00:00
Michael Brown 6c73a8b51d [arbel] Reorder code in preparation for quiescing patch
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-15 04:13:29 +00:00
Michael Brown 6dd4ac77e5 [hermon] Ensure hardware is quiescent when no interfaces are open
WinPE has been observed to call PXENV_UNDI_SHUTDOWN but not
PXENV_STOP_UNDI.  This means that Hermon hardware is left partially
active (firmware running and one event queue mapped) when WinPE starts
up, which can cause a Blue Screen of Death.

Fix by ensuring that the hardware is left quiescent (with the firmware
stopped) when no interfaces are open.

Reported-by: Itay Gazit <itayg@mellanox.co.il>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-15 04:12:07 +00:00
Michael Brown a02f9e0ca5 [hermon] Reorder code in preparation for quiescing patch
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-15 03:59:10 +00:00
Michael Brown 18178b087f [infiniband] Reset port state after closing device
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-15 03:59:10 +00:00
Michael Brown 1e7fbc5bf3 [infiniband] Open device prior to creating SMI and GSI queue pairs
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-15 03:59:10 +00:00
Michael Brown 774ea3d263 [infiniband] Poll event queues only for devices that are open
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-15 03:59:09 +00:00
Michael Brown 8ccaec5adf [ipoib] Report packets as broadcast when ambiguous
Avoid spurious matches for peer key 0 against empty peer cache
entries, and set the LL_MULTICAST flag in addition to LL_BROADCAST.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-15 03:59:09 +00:00
Julian Pidancet 91dd64ad25 [rtl8139] Perform only 8-bit ioport access on the ChipCmd register
The ChipCmd register is only an 8-bit register.  The 16-bit access
used by iPXE was causing an issue when used with qemu emulated rtl8139
device which was improperly aligning IOs.

Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-14 22:23:06 +00:00
Michael Brown caf98cf624 [pxe] Improve pxe_preboot debugging messages
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-14 13:13:45 +00:00
Michael Brown 524349c559 [pxe] Improve pxe_undi debugging messages
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-14 12:48:15 +00:00
Michael Brown 27fdb95572 [prefix] Allow an initrd to be passed to iPXE
Allow an initrd (such as an embedded script) to be passed to iPXE when
loaded as a .lkrn (or .iso) image.  This allows an embedded script to
be varied without recompiling iPXE.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-12 00:34:55 +00:00
Michael Brown 24226472b2 [prefix] Allow prefix to specify an arbitrary maximum address for relocation
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-11 23:20:52 +00:00
Michael Brown 6c5f1a342b [prefix] Use stack rather than %ebp as temporary storage area
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-11 22:24:00 +00:00
Michael Brown a05b89ef45 [undi] Ensure that native drivers are tried before the UNDI PCI driver
Suggested-by: Alessandro Salvatori <sandr8@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-11 21:32:09 +00:00
Marin Hannache be90241ec2 [getopt] Accept "--" as an end-of-options marker
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-02 00:23:57 +00:00
Michael Brown a1f618c625 [undi] Use meaningful driver and device names
Specify a driver name of "undionly" and a device name based on the
UNDI-reported underlying hardware device.  For example:

  net0: 52:54:00:12:34:56 using undionly on UNDI-PCI00:03.0 (open)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-28 22:52:55 +01:00
Michael Brown a05a3613a5 [undi] Use current (rather than permanent) link-layer address
Requested-by: Savitha Hiriyannaia <Savitha.Hiriyannaiah@emulex.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-28 22:41:15 +01:00
Michael Brown 4f4369064b [netdevice] Allow driver to preinitialise the link-layer address
Drivers are currently expected to initialise only the hardware
address, with the link-layer protocol code taking care of converting
this into a valid link-layer address.  Some drivers (e.g. undinet) can
legitimately determine both the hardware and link-layer addresses,
which may differ.

Allow for this situation by checking to see if the link-layer address
is empty before initialising it from the hardware address.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-28 22:32:33 +01:00
Michael Brown b0d65b5f0c [cmdline] Make "reboot" command available by default
Requested-by: Sven Dreyer <sven@dreyer-net.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-26 16:52:42 +01:00
Michael Brown c77aece36a [liba20] Preserve all non-segment registers when calling INT 15,2401
Some BIOSes are reported to corrupt %ebx when using INT 15,2401 (see
http://opensolaris.org/jive/thread.jspa?messageID=377026).  Guard
against this by preserving all (non-segment) registers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-25 16:05:02 +01:00
Michael Brown 4d8a009ccf [librm] Avoid (harmless) collisions with linker symbols
The symbol_text16 is defined globally by the linker.  Use rm_text16
instead of _text16 for the local variable within librm.S to avoid
confusion when reading linker maps.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-25 16:05:02 +01:00
Michael Brown 790035f78d [image] Eliminate the register_and_xxx_image() functions
All users of imgdownload() require registration of the image, so make
registration an integral part of imgdownload() itself and simplify the
"action" parameter to be one of image_select(), image_exec() et al.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-25 01:41:41 +01:00
Michael Brown 59e4c37741 [cmdline] Allow "sleep" command to be interrupted
Allow Ctrl-C to be used to abort a "sleep" command.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-24 15:52:57 +01:00
Michael Brown f177a6f09f [cmdline] Fix up "sleep" argument parsing
Use parse_integer() rather than strtoul() to allow parsing errors to
be reported in a meaningful way.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-24 15:52:14 +01:00
Michael Brown bf2da3122b [cmdline] Make "sleep" command available by default
The "sleep" command is generally useful to have.  For example:

  :dhcp_retry
  dhcp && goto dhcp_done
  sleep 5
  goto dhcp_retry
  :dhcp_done

Make the "sleep" command available by default, leaving TIME_CMD
controlling only the (fairly specialist) "time" command.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-24 15:39:05 +01:00
Michael Brown 7a84cc593a [arbel] Add (not-yet-functional) support for RC queue pairs
Arbel seems to crash the system as soon as the first send WQE
completes on an RC queue pair.  (NOPs complete successfully, so this
is a problem specific to the work queue rather than the completion
queue.)  The cause of this problem has remained unknown for over a
year.

Check in the non-functioning code to avoid bit-rot, and in the hope
that someone will find the fix.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-24 15:29:38 +01:00
Scott K Logan aaf7a35207 [ath9k] Add ath9k driver
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-14 15:34:52 +01:00
Michael Brown c28053027b [list] Add list functions required by ath9k driver
Originally-implemented-by: Scott K Logan <logans@cottsay.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-14 14:33:32 +01:00
Michael Brown d40bd11c62 [test] Add self-tests for list manipulation functions
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-14 14:33:32 +01:00
Michael Brown eac134f8dc [test] Add a basic infrastructure for running self-tests
This self-test mechanism is inspired by Perl's Test::Simple and
similar modules.  The aim is to encourage the use of self-tests by
making it as easy as possible to create self-test code

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-14 14:33:31 +01:00