13 years ago[USB] Assign proper names to devices. Fix pegasus driver to use it.
Balaji Rao [Wed, 23 Jul 2008 19:40:12 +0000 (01:10 +0530)]
[USB] Assign proper names to devices. Fix pegasus driver to use it.

13 years ago[USB] Improve TD token fix up logic to handle multiple queued URBs.
Balaji Rao [Wed, 23 Jul 2008 19:22:13 +0000 (00:52 +0530)]
[USB] Improve TD token fix up logic to handle multiple queued URBs.

13 years ago[USB] Move usb device initialization logic from uhci driver into usbcore.
Balaji Rao [Tue, 22 Jul 2008 07:52:56 +0000 (13:22 +0530)]
[USB] Move usb device initialization logic from uhci driver into usbcore.

13 years ago[USB] Reduce UHCI PR-deassert PE-assert interval to 10 us.
Balaji Rao [Tue, 22 Jul 2008 07:33:02 +0000 (13:03 +0530)]
[USB] Reduce UHCI PR-deassert PE-assert interval to 10 us.

13 years ago[USB] Add a 'reset_port' method to the hc_driver struct.
Balaji Rao [Tue, 22 Jul 2008 07:30:43 +0000 (13:00 +0530)]
[USB] Add a 'reset_port' method to the hc_driver struct.

13 years ago[USB] Add appropriate timing between PR and PE.
Balaji Rao [Wed, 16 Jul 2008 19:52:24 +0000 (01:22 +0530)]
[USB] Add appropriate timing between PR and PE.

13 years agoMerge branch 'master' into usb
Balaji Rao [Fri, 11 Jul 2008 01:54:56 +0000 (07:24 +0530)]
Merge branch 'master' into usb



13 years ago[USB] Use SPD (Sort Packet Detect) for control transfers as well. USB 2.0 devices
Balaji Rao [Thu, 10 Jul 2008 03:07:30 +0000 (08:37 +0530)]
[USB] Use SPD (Sort Packet Detect) for control transfers as well. USB 2.0 devices
are now configured.

13 years ago[udp] Avoid reusing auto-allocated ports after connection close.
Michael Brown [Thu, 10 Jul 2008 03:21:10 +0000 (04:21 +0100)]
[udp] Avoid reusing auto-allocated ports after connection close.

This duplicates a fix made to tcp.c in commit

13 years ago[dhcp] Verify DHCP server source port
Michael Brown [Thu, 10 Jul 2008 03:11:09 +0000 (04:11 +0100)]
[dhcp] Verify DHCP server source port

Verifying server ID and DHCP transaction ID is insufficient to
differentiate between DHCPACK and ProxyDHCPACK when the DHCP server and
Proxy DHCP server are the same machine.

13 years ago[USB] Fix uhci port reset code.
Balaji Rao [Thu, 10 Jul 2008 02:57:12 +0000 (08:27 +0530)]
[USB] Fix uhci port reset code.

13 years agoRevert "[USB] Fixed USB 2.0 device detection bug. Moved device initialization and"
Balaji Rao [Thu, 10 Jul 2008 02:52:53 +0000 (08:22 +0530)]
Revert "[USB] Fixed USB 2.0 device detection bug. Moved device initialization and"

This reverts commit b0394265d3a7b9c507bc12a5f697ceca8c3a574a.

13 years ago[forcedeth] Add support for PCI ID 10de:0373
Andrew Schran [Thu, 10 Jul 2008 00:19:08 +0000 (01:19 +0100)]
[forcedeth] Add support for PCI ID 10de:0373

13 years ago[USB] Fixed USB 2.0 device detection bug. Moved device initialization and
Balaji Rao [Wed, 9 Jul 2008 00:58:41 +0000 (06:28 +0530)]
[USB] Fixed USB 2.0 device detection bug. Moved device initialization and
configuration code away from uhci_hcd.c into usbcore.c.

13 years ago[hermon] Add support for MT26418 device
Michael Brown [Tue, 8 Jul 2008 23:53:03 +0000 (00:53 +0100)]
[hermon] Add support for MT26418 device

PCI ID supplied (and tested) by Frederic
Temporelli <>

13 years ago[phantom] Remove warning relating to now-fixed firmware bug
Michael Brown [Tue, 8 Jul 2008 21:37:36 +0000 (22:37 +0100)]
[phantom] Remove warning relating to now-fixed firmware bug

13 years ago[phantom] Add NetXen dual copyright
Michael Brown [Tue, 8 Jul 2008 21:36:07 +0000 (22:36 +0100)]
[phantom] Add NetXen dual copyright

13 years ago[phantom] Initialise RCVPEG before reading MAC addresses
Michael Brown [Tue, 8 Jul 2008 19:59:33 +0000 (20:59 +0100)]
[phantom] Initialise RCVPEG before reading MAC addresses

13 years ago[image] Fail "imgexec"/"boot" if the image to execute is ambiguous
Michael Brown [Tue, 8 Jul 2008 02:50:44 +0000 (03:50 +0100)]
[image] Fail "imgexec"/"boot" if the image to execute is ambiguous

If there is more than one loaded image, refuse to automatically select
the image to execute.  There are at least two possible cases, with
different "correct" answers:

1. User loads image A by mistake, then loads image B and types "boot".
   User wants to execute image B.

2. User loads image A, then loads image B (which patches image A), then
   types "boot".  User wants to execute image A.

If a user actually wants to load multiple images, they must explicitly
specify which image is to be executed.

13 years ago[image] Revert "clear LOADED flag" patch
Michael Brown [Tue, 8 Jul 2008 02:15:02 +0000 (03:15 +0100)]
[image] Revert "clear LOADED flag" patch

Clearing the LOADED flag actually prevents users from doing clever things
such as loading an image, then loading a patch image, then executing the
first image.  (image_exec() checks for IMAGE_LOADED, so this sequence of
operations will fail if the LOADED flag gets cleared.)

This reverts commit 14c080020fb37cb34fe74213393f47bd2ad8b9bc.

13 years ago[image] Clear LOADED flag on all other images when loading a new image
Michael Brown [Tue, 8 Jul 2008 02:03:48 +0000 (03:03 +0100)]
[image] Clear LOADED flag on all other images when loading a new image

Loading an image may overwrite part or all of any previously-loaded
images, so we should clear the LOADED flag for all images prior to
attempting to load a new image.

13 years ago[settings] Allow "config" command to access root settings block
Michael Brown [Tue, 8 Jul 2008 01:10:18 +0000 (02:10 +0100)]
[settings] Allow "config" command to access root settings block

13 years ago[bzimage] Kill off the initrd image type
Michael Brown [Tue, 8 Jul 2008 00:30:11 +0000 (01:30 +0100)]
[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

13 years ago[dhcp] Allow DHCP non-option settings to be cleared
Michael Brown [Tue, 8 Jul 2008 00:13:59 +0000 (01:13 +0100)]
[dhcp] Allow DHCP non-option settings to be cleared

dhcppkt_store() is supposed to clear the setting if passed NULL for the
setting data.  In the case of fixed-location fields (e.g. client IP
address), this requires setting the content of the field to all-zeros.

13 years ago[USB] Timeout if synch control message takes too much time.
Balaji Rao [Mon, 7 Jul 2008 14:30:24 +0000 (20:00 +0530)]
[USB] Timeout if synch control message takes too much time.

13 years ago[USB] Initialize a variable in pegasus.c to avoid compiler complaints.
Balaji Rao [Mon, 7 Jul 2008 12:55:10 +0000 (18:25 +0530)]
[USB] Initialize a variable in pegasus.c to avoid compiler complaints.

13 years ago[USB] Fix set_register function in pegasus to use size of 1 instead of 0.
Balaji Rao [Mon, 7 Jul 2008 07:30:29 +0000 (13:00 +0530)]
[USB] Fix set_register function in pegasus to use size of 1 instead of 0.

13 years ago[phantom] Add support for NetXen Phantom NICs
Michael Brown [Sat, 5 Jul 2008 02:38:14 +0000 (19:38 -0700)]
[phantom] Add support for NetXen Phantom NICs

13 years ago[USB] asix USB driver ready. Works only with DLink DUB E 100 but not with
Balaji Rao [Fri, 4 Jul 2008 00:56:49 +0000 (06:26 +0530)]
[USB] asix USB driver ready. Works only with DLink DUB E 100 but not with
Belklin F5D055 gigabit adapter.

13 years ago[tftp] Strip the initial '/' to keep Windows TFTP servers happy.
Michael Brown [Wed, 2 Jul 2008 22:01:25 +0000 (15:01 -0700)]
[tftp] Strip the initial '/' to keep Windows TFTP servers happy.

13 years ago[USB] Added asix driver. Only probe function written. MAC address read
Balaji Rao [Wed, 2 Jul 2008 01:35:15 +0000 (07:05 +0530)]
[USB] Added asix driver. Only probe function written. MAC address read

13 years ago[i386] Change semantics of __from_data16 and __from_text16
Michael Brown [Tue, 1 Jul 2008 01:52:13 +0000 (18:52 -0700)]
[i386] Change semantics of __from_data16 and __from_text16

__from_data16 and __from_text16 now take a pointer to a
.data16/.text16 variable, and return the real-mode offset within the
appropriate segment.  This matches the use case for every occurrence
of these macros, and prevents potential future bugs such as that fixed
in commit d51d80f.  (The bug arose essentially because "&pointer" is
still syntactically valid.)

13 years ago[pxe] Fix a typo in PXENV_GET_CACHED_INFO that broke Altiris
Michael Brown [Tue, 1 Jul 2008 01:35:51 +0000 (18:35 -0700)]
[pxe] Fix a typo in PXENV_GET_CACHED_INFO that broke Altiris

__from_data16 takes the value pointed to, rather than the pointer
itself.  This was silently causing gPXE to return a dud buffer pointer
when the caller did not supply a buffer for PXENV_GET_CACHED_INFO.

13 years ago[dhcp] Verify server identifier on ProxyDHCPACKs
Michael Brown [Tue, 1 Jul 2008 00:56:37 +0000 (17:56 -0700)]
[dhcp] Verify server identifier on ProxyDHCPACKs

Perform the same test for a matching DHCP_SERVER_IDENTIFIER on
ProxyDHCPACKs as we do for DHCPACKs.  Otherwise, a retransmitted
DHCPACK can end up being treated as the ProxyDHCPACK.

I have a vague and unsettling memory that this test was deliberately
omitted, but I can't remember why, and can't find anything in the VC

13 years ago[USB] pegasus driver completed. Works. Tested with QEMU.
Balaji Rao [Mon, 30 Jun 2008 20:27:57 +0000 (01:57 +0530)]
[USB] pegasus driver completed. Works. Tested with QEMU.

13 years ago[Config] remove src/Config
H. Peter Anvin [Mon, 30 Jun 2008 19:16:08 +0000 (12:16 -0700)]
[Config] remove src/Config

Remove src/Config as it has no more users, and conflicts with
src/config on case-deficient filesystems.

Signed-off-by: H. Peter Anvin <>
13 years ago[ns8390] Use stub files instead of src/Config
H. Peter Anvin [Mon, 30 Jun 2008 19:09:21 +0000 (12:09 -0700)]
[ns8390] Use stub files instead of src/Config

ns8390.c can produce four different drivers (one PCI, three ISA.)  The
ISA driver requires setting a few macros; do that by setting defines
in stub files instead of using src/Config.

Currently, all the ISA drivers are broken (they were not enabled by
default), so #if 0 them out.

Signed-off-by: H. Peter Anvin <>
13 years ago[lkrnprefix] Make gPXE .lkrn images conform to the zImage 2.07 format
Stefan Hajnoczi [Mon, 30 Jun 2008 18:53:28 +0000 (19:53 +0100)]
[lkrnprefix] Make gPXE .lkrn images conform to the zImage 2.07 format

13 years ago[bzImage] Support loading zImage kernels
Stefan Hajnoczi [Mon, 30 Jun 2008 18:51:41 +0000 (19:51 +0100)]
[bzImage] Support loading zImage kernels

zImage kernels require the real-mode portion to be loaded at 9000:0000
rather than 1000:0000.

13 years ago[GDB] Provide functions to manually enter GDB stub.
Stefan Hajnoczi [Mon, 16 Jun 2008 13:42:22 +0000 (14:42 +0100)]
[GDB] Provide functions to manually enter GDB stub.

13 years ago[GDB] Obey flow control when GDB connects.
Stefan Hajnoczi [Mon, 16 Jun 2008 12:18:20 +0000 (13:18 +0100)]
[GDB] Obey flow control when GDB connects.

13 years ago[GDB] Remove unused DR6 debug register variable
Stefan Hajnoczi [Fri, 13 Jun 2008 19:11:41 +0000 (20:11 +0100)]
[GDB] Remove unused DR6 debug register variable

13 years ago[GDB] UDP clean up and add netdev refcnt
Stefan Hajnoczi [Fri, 13 Jun 2008 16:14:12 +0000 (17:14 +0100)]
[GDB] UDP clean up and add netdev refcnt

13 years ago[GDB] Zero-extend 16-bit segment registers
Stefan Hajnoczi [Fri, 13 Jun 2008 09:26:49 +0000 (10:26 +0100)]
[GDB] Zero-extend 16-bit segment registers

When the 16-bit segment registers are accessed using 32-bit instructions
the high order bytes are undefined on older CPUs.  We now explicitly
zero the high order bytes when snapshotting the CPU state.  This ensures
that the GDB stub reports consistent values for the segment registers.

13 years ago[GDB] Add copyright header for gdbmach.c
Stefan Hajnoczi [Thu, 12 Jun 2008 17:19:55 +0000 (18:19 +0100)]
[GDB] Add copyright header for gdbmach.c

13 years ago[GDB] Add watch and rwatch hardware watchpoints
Stefan Hajnoczi [Thu, 12 Jun 2008 15:56:20 +0000 (16:56 +0100)]
[GDB] Add watch and rwatch hardware watchpoints

13 years ago[GDB] Remote debugging over UDP
Stefan Hajnoczi [Wed, 11 Jun 2008 11:12:46 +0000 (12:12 +0100)]
[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.

13 years ago[GDB] Atomic read/write for device memory
Stefan Hajnoczi [Thu, 5 Jun 2008 19:07:23 +0000 (20:07 +0100)]
[GDB] Atomic read/write for device memory

13 years ago[GDB] Handle kill and detach packets.
Stefan Hajnoczi [Thu, 5 Jun 2008 14:31:48 +0000 (15:31 +0100)]
[GDB] Handle kill and detach packets.

This commit also includes a test to ensure that single stepping works,
since continue, kill, detach, and single step all share code.

13 years ago[USB] Simplify dm9601 transmit code.
Balaji Rao [Mon, 30 Jun 2008 00:30:41 +0000 (06:00 +0530)]
[USB] Simplify dm9601 transmit code.

13 years ago[USB] Quick and dirty hack to include dm9601 and pegasus as drivers.
Balaji Rao [Sun, 29 Jun 2008 23:15:13 +0000 (04:45 +0530)]
[USB] Quick and dirty hack to include dm9601 and pegasus as drivers.

13 years ago[romprefix] Fix PMM detection start address
Michael Brown [Sat, 28 Jun 2008 22:18:11 +0000 (23:18 +0100)]
[romprefix] Fix PMM detection start address

Commit fd0aef9 introduced a typo that caused PMM detection to start at
paragraph 0xe00 rather than 0xe000.  (Detection would still work, since it
would scan until it ran out of base memory, but it would end up scanning
an unnecessarily large portion of base memory.)

Spotted by Sebastian Herbszt <>.

13 years ago[nvs] Add support for ST M25P32 SPI flash devices
Michael Brown [Tue, 24 Jun 2008 18:32:21 +0000 (11:32 -0700)]
[nvs] Add support for ST M25P32 SPI flash devices

13 years ago[misc] Fix building on OpenBSD
Michael Brown [Fri, 27 Jun 2008 21:35:26 +0000 (22:35 +0100)]
[misc] Fix building on OpenBSD

OpenBSD throws compiler warnings that we can't reproduce on Linux, for
some reason.

Original patch from Dewey Hylton <>.

13 years ago[a20] Send a null command to the KBC after changing A20
H. Peter Anvin [Fri, 27 Jun 2008 21:29:13 +0000 (22:29 +0100)]
[a20] Send a null command to the KBC after changing A20

Send a null command, specifically "pulse outputs" with no outputs
selected, to the KBC after changing A20.  This was apparently done by DOS,
presumably as a synchronization hack, and the authors of the UHCI spec
thought it was inherent.  Therefore, there are systems out there (e.g. HP
DL360 G5) which will stop responsing to "legacy USB" unless they see the
null command, 0xFF, written to port 0x64 at the end of the A20 toggling

Signed-off-by: H. Peter Anvin <>
13 years ago[libc] Remove unused le32_to_cpup(x) and cpu_to_le16p() macros
Michael Brown [Fri, 20 Jun 2008 10:40:08 +0000 (11:40 +0100)]
[libc] Remove unused le32_to_cpup(x) and cpu_to_le16p() macros

If we ever need these macros, they should be defined in
include/{big,little}_bswap.h, and the whole family should be defined.

13 years ago[tg3] Recognize the BCM5789
Steven Walter [Tue, 17 Jun 2008 21:37:43 +0000 (17:37 -0400)]
[tg3] Recognize the BCM5789

Add an entry to tg3_nics for the BCM5789

Signed-off-by: Steven Walter <>
13 years ago[cmdline] Fix image command-line construction for zero-length argument lists
Michael Brown [Fri, 27 Jun 2008 20:50:18 +0000 (21:50 +0100)]
[cmdline] Fix image command-line construction for zero-length argument lists

This fixes a bug introduced in commit 4c85017.

13 years ago[USB] Cleanup source code to use proper error handling. Some minor changes in
Balaji Rao [Thu, 26 Jun 2008 20:33:11 +0000 (02:03 +0530)]
[USB] Cleanup source code to use proper error handling. Some minor changes in
synchronous control URB submission.

13 years ago[USB] Cleanup code to handle errors graciously. Still a work in progress.
Balaji Rao [Thu, 26 Jun 2008 12:42:50 +0000 (18:12 +0530)]
[USB] Cleanup code to handle errors graciously. Still a work in progress.

13 years ago[USB] Added support for pegasus usb nic driver. Only the transmit part works.
Balaji Rao [Wed, 25 Jun 2008 21:58:25 +0000 (03:28 +0530)]
[USB] Added support for pegasus usb nic driver. Only the transmit part works.

13 years ago[USB] Added support for FSBR. Added some optimizations in the rx path.
Balaji Rao [Fri, 20 Jun 2008 17:48:01 +0000 (23:18 +0530)]
[USB] Added support for FSBR. Added some optimizations in the rx path.

13 years agoMerge commit 'origin/master' into usb
Balaji Rao [Fri, 20 Jun 2008 17:47:31 +0000 (23:17 +0530)]
Merge commit 'origin/master' into usb

13 years ago[USB] Use zero copy in dm9601 rx part. Data now comes directly into io_buffer.
Balaji Rao [Fri, 20 Jun 2008 11:58:55 +0000 (17:28 +0530)]
[USB] Use zero copy in dm9601 rx part. Data now comes directly into io_buffer.

13 years ago[USB] Add rx code to dm9601 and add routines to cleanup URBS. Also fixed
Balaji Rao [Thu, 19 Jun 2008 18:15:36 +0000 (23:45 +0530)]
[USB] Add rx code to dm9601 and add routines to cleanup URBS. Also fixed
improper toggle bit handling. Now we use SPD (Short Packet Detect) for TDs.

13 years ago[script] Remove arbitrary limit on script line lengths
Michael Brown [Tue, 17 Jun 2008 23:43:58 +0000 (00:43 +0100)]
[script] Remove arbitrary limit on script line lengths

13 years ago[USB] Added routines to get URB status. This may be used by drivers to check
Balaji Rao [Tue, 17 Jun 2008 12:27:14 +0000 (17:57 +0530)]
[USB] Added routines to get URB status. This may be used by drivers to check
for tx, rx completion.

13 years ago[USB] Introduced two lists in struct usbnet and two fields in struct urb to
Balaji Rao [Mon, 16 Jun 2008 22:58:44 +0000 (04:28 +0530)]
[USB] Introduced two lists in struct usbnet and two fields in struct urb to
allow it be enqueued in various queues.

13 years ago[USB] Change first_td to last_td. It is the last_td that tells us about the
Balaji Rao [Mon, 16 Jun 2008 22:19:42 +0000 (03:49 +0530)]
[USB] Change first_td to last_td. It is the last_td that tells us about the
status of the whole URB.

13 years ago[USB] Cleanup uhci_hcd.c to remove some unnecessary debugging code.
Balaji Rao [Mon, 16 Jun 2008 22:15:03 +0000 (03:45 +0530)]
[USB] Cleanup uhci_hcd.c to remove some unnecessary debugging code.

13 years agoReduced synchronous control message completion wait time to 50ms from 100ms.
Balaji Rao [Mon, 16 Jun 2008 22:03:37 +0000 (03:33 +0530)]
Reduced synchronous control message completion wait time to 50ms from 100ms.

13 years ago[DRIVERS] Added a device driver for DM9601 (USB Ehernet Fast Adapter). Only the
Balaji Rao [Mon, 16 Jun 2008 12:06:08 +0000 (17:36 +0530)]
[DRIVERS] Added a device driver for DM9601 (USB Ehernet Fast Adapter). Only the
transmit part works now.

13 years ago[USB] Changed UHCI port reset logic to allow time for debounce after reset.
Balaji Rao [Mon, 16 Jun 2008 12:02:43 +0000 (17:32 +0530)]
[USB] Changed UHCI port reset logic to allow time for debounce after reset.

13 years ago[USB] Add support for bulk URBs.
Balaji Rao [Mon, 16 Jun 2008 19:19:36 +0000 (00:49 +0530)]
[USB] Add support for bulk URBs.

13 years ago[USB] Changed the semantics of submit_control_urb. We now allocate a qh per
Balaji Rao [Mon, 16 Jun 2008 19:03:58 +0000 (00:33 +0530)]
[USB] Changed the semantics of submit_control_urb. We now allocate a qh per
endpoint. This allows transactions from/to different endpoints to be executed
in parallel.

13 years agoCorrected the uhci_print_td_info to properly extract Vf field.
Balaji Rao [Mon, 16 Jun 2008 18:56:03 +0000 (00:26 +0530)]
Corrected the uhci_print_td_info to properly extract Vf field.

13 years ago[legacy] Align legacy drivers' __shared data to the maximum possible
Michael Brown [Sat, 14 Jun 2008 19:01:14 +0000 (20:01 +0100)]
[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 <>

13 years ago[prefix] When we have to hook INT 19, chain to original handler if possible
Michael Brown [Sat, 14 Jun 2008 12:49:26 +0000 (13:49 +0100)]
[prefix] When we have to hook INT 19, chain to original handler if possible

When the BIOS doesn't support BBS, hooking INT 19 is the only way to add
ourselves as a boot device.  If we have to do this, we should at least
try to chain to the original INT 19 vector if our boot fails.

Idea suggested by Andrew Schran <>

13 years ago[via-rhine] Fix erroneous uses of memory I/O instead of port I/O
Stefan Hajnoczi [Thu, 12 Jun 2008 14:21:42 +0000 (15:21 +0100)]
[via-rhine] Fix erroneous uses of memory I/O instead of port I/O

13 years ago[cleanup] Remove long-obsolete gpxe/async.h header file
Michael Brown [Thu, 12 Jun 2008 12:15:53 +0000 (13:15 +0100)]
[cleanup] Remove long-obsolete gpxe/async.h header file

13 years ago[bzimage] Support kernel command lines of greater than 256 characters
Michael Brown [Thu, 12 Jun 2008 01:19:10 +0000 (02:19 +0100)]
[bzimage] Support kernel command lines of greater than 256 characters

2.6.22+ kernels have an extra field in the bzimage_header structure to
indicate the maximum permitted command-line length.  Use this if it is

13 years ago[cmdline] Remove arbitrary limit on the length of image command lines
Michael Brown [Thu, 12 Jun 2008 01:12:10 +0000 (02:12 +0100)]
[cmdline] Remove arbitrary limit on the length of image command lines

13 years ago[USB] Modified the endpoint descriptor code to use only Bluk and Control Endpoints.
Balaji Rao [Wed, 11 Jun 2008 15:25:40 +0000 (20:55 +0530)]
[USB] Modified the endpoint descriptor code to use only Bluk and Control Endpoints.

Changed the uhci schedule structure. In addition to two skeleton QHs for
control and bulk xfer types, we now have one QH for every Bulk endpoint.

13 years ago[smbios] Fix SMBIOS string fetching
Michael Brown [Wed, 11 Jun 2008 12:43:58 +0000 (13:43 +0100)]
[smbios] Fix SMBIOS string fetching

A bug in read_smbios_string() was causing the starting offset of the
SMBIOS structure to be added twice, resulting in completely the wrong
strings being returned.

Bug identified by Martin Herweg <>

13 years ago[slam] Add support for SLAM window lengths of greater than one packet
Michael Brown [Wed, 11 Jun 2008 12:16:02 +0000 (13:16 +0100)]
[slam] Add support for SLAM window lengths of greater than one packet

Add the definition of SLAM_MAX_BLOCKS_PER_NACK, which is roughly
equivalent to a TCP window size; it represents the maximum number of
packets that will be requested in a single NACK.

Note that, to keep the code size down, we still limit ourselves to
requesting only a single range per NACK; if the missing-block list is
discontiguous then we may request fewer than SLAM_MAX_BLOCKS_PER_NACK

13 years ago[USB] Added code to obtain the configuration, interface and endpoint descriptors
Balaji Rao [Wed, 11 Jun 2008 12:04:38 +0000 (17:34 +0530)]
[USB] Added code to obtain the configuration, interface and endpoint descriptors
from the device.

13 years ago[console] Call cpu_nap() only if there is no input waiting
Michael Brown [Wed, 11 Jun 2008 11:06:10 +0000 (12:06 +0100)]
[console] Call cpu_nap() only if there is no input waiting

Avoid calling cpu_nap() until after we have determined that there is
no input ready to read.  This avoids delaying for one timer interrupt
(~50ms) in the case of

  if ( iskey() )
     char = getkey()

which happens to be present in monojob.c, which is where we spend most
of our time looping (e.g. during any download).

This should eliminate the irritating tendency of gPXE to lose

Discovered on a Dell system where the serial port seems to send in a
constant stream of 0xff characters; this wouldn't be a problem in
itself except that each one triggers the 50ms delay (as mentioned
above), which really kills performance.

13 years ago[slam] Implement SLAM flow control
Michael Brown [Wed, 11 Jun 2008 08:41:31 +0000 (09:41 +0100)]
[slam] Implement SLAM flow control

On any fast network, or with any driver that may drop packets
(e.g. Infiniband, which has very small RX rings), the traditional
usage of the SLAM protocol will result in enormous numbers of packet
drops and a consequent large number of retransmissions.

By adapting the client behaviour, we can force the server to act more
like a multicast TFTP server, with flow control provided by a single
master client.

This behaviour should interoperate with any traditional SLAM client
(e.g. Etherboot 5.4) on the network.  The SLAM protocol isn't actually
documented anywhere, so it's hard to define either behaviour as
compliant or otherwise.

13 years ago[retry] Add start_timer_fixed()
Michael Brown [Wed, 11 Jun 2008 08:37:58 +0000 (09:37 +0100)]
[retry] Add start_timer_fixed()

Allow for timers to be started with fixed timeouts.

13 years ago[dhcp] Do not transition to DHCPREQUEST without a valid DHCPOFFER
Michael Brown [Wed, 11 Jun 2008 05:20:49 +0000 (06:20 +0100)]
[dhcp] Do not transition to DHCPREQUEST without a valid DHCPOFFER

A missing test for dhcp->dhcpoffer in dhcp_timer_expired() was causing
the client to transition to DHCPREQUEST after timing out on waiting
for ProxyDHCP even if no DHCPOFFERs had been received.

13 years ago[USB] Some minor code cleanup. Changed device detection code semantics a bit.
Balaji Rao [Tue, 10 Jun 2008 14:53:15 +0000 (20:23 +0530)]
[USB] Some minor code cleanup. Changed device detection code semantics a bit.
We first call GET DESCRIPTOR, get endpoint zero's MaxPacket size and then call

13 years ago[slam] Request all remaining blocks if we run out of space for the blocklist
Michael Brown [Tue, 10 Jun 2008 11:30:43 +0000 (12:30 +0100)]
[slam] Request all remaining blocks if we run out of space for the blocklist

In a SLAM NACK packet, if we run out of space to represent the
missing-block list, then indicate all remaining blocks as missing.
This avoids the need to wait for the one-second timeout before
receiving the blocks that otherwise wouldn't have been requested due
to running out of space.

13 years ago[slam] Speed up NACK transmission by restricting the block-list length
Michael Brown [Tue, 10 Jun 2008 10:23:34 +0000 (11:23 +0100)]
[slam] Speed up NACK transmission by restricting the block-list length

Shorter NACK packets take less time to construct and spew out less
debug output, and there's a limit to how useful it is to send a
complete missing-block list anyway; if the loss rate is high then
we're going to have to retransmit an updated missing-block list

Also add pretty debugging output to show the list of requested blocks.

13 years ago[slam] Fix multicast address parsing
Michael Brown [Tue, 10 Jun 2008 09:03:31 +0000 (10:03 +0100)]
[slam] Fix multicast address parsing

slam_parse_multicast_address() was failing to strip the initial "/"
from the URI path.

13 years ago[undi] Ask for promiscuous packet reception when using UNDI driver
Michael Brown [Tue, 10 Jun 2008 07:56:44 +0000 (08:56 +0100)]
[undi] Ask for promiscuous packet reception when using UNDI driver

We never set up specific multicast filters; native drivers will ask
the card to receive all multicast packets.  The only way to achieve
this via the UNDI API is to enable promiscuous mode.

13 years ago[slam] Add Scalable Local Area Multicast (SLAM) protocol support
Michael Brown [Mon, 9 Jun 2008 23:04:19 +0000 (00:04 +0100)]
[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.

13 years ago[udp] Verify local socket address (if specified) for UDP sockets
Michael Brown [Mon, 9 Jun 2008 21:56:48 +0000 (22:56 +0100)]
[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.

13 years agoAdded support for SET_ADDRESS transaction. Device successfully accepts new
Balaji Rao [Mon, 9 Jun 2008 13:05:33 +0000 (18:35 +0530)]
Added support for SET_ADDRESS transaction. Device successfully accepts new
address as verified by calling GET_DESCRIPTOR on the new device address.

13 years ago[ELF] Add ability to boot ELF images generated by wraplinux and mkelfImage
Michael Brown [Mon, 9 Jun 2008 12:11:46 +0000 (13:11 +0100)]
[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.

13 years ago[Makefile] Add $(BIN)/undionly.kpxe as default build target
Marty Connor [Mon, 9 Jun 2008 12:44:11 +0000 (08:44 -0400)]
[Makefile] Add $(BIN)/undionly.kpxe as default build target