12 years agoShare rm_idtr and idtr to save a few bytes.
Stefan Hajnoczi [Wed, 4 Jun 2008 08:08:17 +0000 (09:08 +0100)]
Share rm_idtr and idtr to save a few bytes.

12 years agoRemove unused gdbsym.c.
Stefan Hajnoczi [Wed, 4 Jun 2008 07:54:03 +0000 (08:54 +0100)]
Remove unused gdbsym.c.

The GDBSYM config.h option was an attempt at QEMU GDB debugging.  I have
removed the code since it is unused and may confuse people wanting to
use the GDB stub.

12 years agoSplit serial console from serial driver.
Stefan Hajnoczi [Tue, 3 Jun 2008 19:49:33 +0000 (20:49 +0100)]
Split serial console from serial driver.

12 years agoSplit librm and GDB IDT code without using #ifdef.
Stefan Hajnoczi [Tue, 3 Jun 2008 16:25:03 +0000 (17:25 +0100)]
Split librm and GDB IDT code without using #ifdef.

12 years agoTest suite for the GDB stub.
Stefan Hajnoczi [Mon, 2 Jun 2008 16:51:43 +0000 (17:51 +0100)]
Test suite for the GDB stub.

12 years agoNew config-local.h to avoid accidental commits.
Stefan Hajnoczi [Sat, 31 May 2008 10:03:52 +0000 (11:03 +0100)]
New config-local.h to avoid accidental commits.

During development it is often handy to change the config.h options from
their defaults, for example to enable debugging features.  I anticipate
this will increase once the GDB stub is merged into mainline.

To prevent accidental commits of debugging config.h changes, mdc
suggested having a config-local.h that is excluded from source control.
This file acts as a temporary config.h and can override any of the

This commit is an attempt to implement the config-local.h feature.

The config.h file now has the following as its last line:
/* @TRYSOURCE config-local.h */

The @TRYSOURCE directive causes config-local.h to be included at that
point in the file.  If config-local.h does not exist, no error will be
printed and parsing will continue as normal.  Therefore, is
"trying" to "source" config-local.h.

12 years agoIntroduce GDBSTUB config option.
Stefan Hajnoczi [Sat, 31 May 2008 07:30:04 +0000 (08:30 +0100)]
Introduce GDBSTUB config option.

This is a first attempt and still needs work.  This change adds #ifdefs
to librm.S.  Perhaps we can find a nicer way of doing this.  Also, the
serial console support used by the GDB stub is automatically pulled in.

To build without GDBSTUB in config.h:
 #undef GDBSTUB

12 years agoImplement retransmit and clean up code.
Stefan Hajnoczi [Thu, 29 May 2008 19:09:14 +0000 (20:09 +0100)]
Implement retransmit and clean up code.

12 years agoIsolate architecture-specific GDB functions.
Stefan Hajnoczi [Thu, 29 May 2008 16:15:16 +0000 (17:15 +0100)]
Isolate architecture-specific GDB functions.

12 years agoTry using process to detect serial activity.
Stefan Hajnoczi [Wed, 28 May 2008 20:24:51 +0000 (21:24 +0100)]
Try using process to detect serial activity.

12 years agoAdd license header.
Stefan Hajnoczi [Wed, 28 May 2008 16:56:52 +0000 (17:56 +0100)]
Add license header.

12 years agoFirst hack at a GDB stub.
Stefan Hajnoczi [Tue, 27 May 2008 18:56:54 +0000 (19:56 +0100)]
First hack at a GDB stub.

12 years agoChanges to reduce code size.
Stefan Hajnoczi [Mon, 26 May 2008 19:49:03 +0000 (20:49 +0100)]
Changes to reduce code size.

12 years agoIDT entry offset initialization and some cleanups.
Stefan Hajnoczi [Mon, 26 May 2008 17:15:59 +0000 (18:15 +0100)]
IDT entry offset initialization and some cleanups.

12 years agoSmall tweaks before discussing with mcb30.
Stefan Hajnoczi [Mon, 26 May 2008 14:52:27 +0000 (15:52 +0100)]
Small tweaks before discussing with mcb30.

12 years agoDistinguish between different interrupts.
Stefan Hajnoczi [Sun, 25 May 2008 20:15:44 +0000 (21:15 +0100)]
Distinguish between different interrupts.

12 years agoAdd simple GDB stub handler function to dump registers.
Stefan Hajnoczi [Sun, 25 May 2008 10:47:44 +0000 (11:47 +0100)]
Add simple GDB stub handler function to dump registers.

12 years agoAdd GDB register snapshot support in interrupt handler.
Stefan Hajnoczi [Sun, 25 May 2008 10:30:43 +0000 (11:30 +0100)]
Add GDB register snapshot support in interrupt handler.

12 years agoSet up IDT and a simple interrupt handler.
Stefan Hajnoczi [Sat, 24 May 2008 11:05:36 +0000 (12:05 +0100)]
Set up IDT and a simple interrupt handler.

12 years ago[Makefile] Remove obsolete SRCDIRS
Michael Brown [Fri, 23 May 2008 01:35:20 +0000 (02:35 +0100)]
[Makefile] Remove obsolete SRCDIRS

12 years ago[prefix] Prompt for entering gPXE shell during POST
Michael Brown [Thu, 22 May 2008 14:14:33 +0000 (15:14 +0100)]
[prefix] Prompt for entering gPXE shell during POST

The ROM prefix now prompts the user to enter the gPXE shell during POST;
this allows for configuring gPXE without needing to attempt to boot from
it.  (It also slows down system boot by three seconds per gPXE ROM, but

This is apparently a certain OEM's requirement for option ROMs.

12 years ago[prefix] Add PCI bus:dev.fn to ROM product string
Michael Brown [Wed, 21 May 2008 17:43:58 +0000 (18:43 +0100)]
[prefix] Add PCI bus:dev.fn to ROM product string

This allows multiple gPXE ROMs in a system to be disambiguated at boot
time; the PCI ID will show up in the boot menu for a BBS-compliant BIOS.

12 years ago[Contribs] Fix multi-line POSIX errno definitions.
Stefan Hajnoczi [Tue, 20 May 2008 18:06:56 +0000 (19:06 +0100)]
[Contribs] Fix multi-line POSIX errno definitions.

12 years ago[Contribs] Fix parsing bug in
Stefan Hajnoczi [Sun, 18 May 2008 10:37:18 +0000 (11:37 +0100)]
[Contribs] Fix parsing bug in

Make sure parser doesn't choke on line with space at end.

12 years ago[Contribs] Add simple IRC bot for looking up error codes.
Stefan Hajnoczi [Sat, 10 May 2008 17:42:29 +0000 (18:42 +0100)]
[Contribs] Add simple IRC bot for looking up error codes.

12 years ago[Contribs] Add README, license text, and invert error code dictionaries.
Stefan Hajnoczi [Sat, 10 May 2008 14:06:21 +0000 (15:06 +0100)]
[Contribs] Add README, license text, and invert error code dictionaries.

12 years ago[Contribs] Add a web interface for looking up error codes.
Stefan Hajnoczi [Sat, 10 May 2008 13:29:40 +0000 (14:29 +0100)]
[Contribs] Add a web interface for looking up error codes.

Add a PHP script to act as a web interface for looking up error codes.

12 years ago[Contribs] Add command-line utility for looking up gPXE error codes.
Stefan Hajnoczi [Sat, 10 May 2008 11:57:13 +0000 (12:57 +0100)]
[Contribs] Add command-line utility for looking up gPXE error codes.

12 years ago[SMBIOS] Interpret UUIDs as being in network-endian order
Michael Brown [Tue, 20 May 2008 17:41:36 +0000 (18:41 +0100)]
[SMBIOS] Interpret UUIDs as being in network-endian order

Various specification documents disagree about the byte ordering of
UUIDs.  However, SMBIOS seems to use the standard in which everything is
in network-endian order.

This doesn't affect anything sent on the wire; only what gets printed on
the screen when the "uuid" variable is displayed.

12 years ago[libc] Fix isdigit(), islower() and isupper().
Michael Brown [Mon, 19 May 2008 15:34:17 +0000 (16:34 +0100)]
[libc] Fix isdigit(), islower() and isupper().

From: Stefan Hajnoczi <>

12 years ago[tg3] Add support for tg3-5721
Michael Brown [Mon, 19 May 2008 15:22:13 +0000 (16:22 +0100)]
[tg3] Add support for tg3-5721

From: Daniel Mealha Cabrita <>

I've added tg3-5721 support for gPXE, the patch (against gpxe-0.9.3) is
attached to this message.

This chipset is present in HP ML150 G2 servers (possibly other HP machines
as well).

12 years ago[IPv4] Fix multicast address checking
Michael Brown [Mon, 19 May 2008 15:19:46 +0000 (16:19 +0100)]
[IPv4] Fix multicast address checking

From: Viswanath Krishnamurthy <>

The current ipv4 incorrectly checks the IP address for multicast address.
This causes valid IPv4 unicast address to be trated as multicast address

For e.g if the PXE/tftp server IP address is 192.168.4.XXX where XXX is
224 or greater, it gets treated as multicast address and a ethernet
multicast address is sent out on the wire causing timeouts

12 years ago[iSCSI] Offer CHAP authentication only if we have a username and password origin/HEAD origin/master
Michael Brown [Thu, 24 Apr 2008 12:48:29 +0000 (13:48 +0100)]
[iSCSI] Offer CHAP authentication only if we have a username and password

Some EMC targets will fail if we advertise that we can authenticate with
CHAP, but the target is configured to allow unauthenticated access to that
target.  We advertise AuthMethod=CHAP,None; the target should (I think)
select AuthMethod=None for unprotected targets.  IETD does this, but an
EMC Celerra NS83 doesn't.

Fix by offering only AuthMethod=None if the user hasn't supplied a
username and password; this means that we won't be offering CHAP
authentication unless the user is expecting to use it (in which case the
target is presumably configured appropriately).

Many thanks to Alessandro Iurlano <> for
reporting and helping to diagnose this problem.

12 years ago[Makefile] Quick hack: always define pci_{vendor,device}_id
Michael Brown [Wed, 23 Apr 2008 15:24:00 +0000 (16:24 +0100)]
[Makefile] Quick hack: always define pci_{vendor,device}_id

ROMs will refuse to build unless pci_vendor_id and pci_device_id are
defined.  We probably ought to fix up the Makefile (and the ROM prefix) so
that they're required only for PCI ROMs, but this will do for now.

12 years ago[MTNIC] Minor cleanups of vendor-provided driver for Mellanox 10GigE cards
Michael Brown [Tue, 22 Apr 2008 16:49:29 +0000 (17:49 +0100)]
[MTNIC] Minor cleanups of vendor-provided driver for Mellanox 10GigE cards

Drivers are not allowed to call printf().  Converted eprintf() to DBG(),
and removed spurious startup banner.

Fixed hardcoded inclusion of little_bswap.h

Use EIO rather than 1 as an error number.

12 years ago[NETDEV] Add notion of link state
Michael Brown [Tue, 22 Apr 2008 16:40:50 +0000 (17:40 +0100)]
[NETDEV] Add notion of link state

Add ability for network devices to flag link up/down state to the
networking core.

Autobooting code will now wait for link-up before attempting DHCP.

IPoIB reflects the Infiniband link state as the network device link state
(which is not strictly correct; we also need a succesful IPoIB IPv4
broadcast group join), but is probably more informative.

12 years ago[Infiniband] Fix event queue doorbell ringing on Arbel
Michael Brown [Tue, 22 Apr 2008 01:15:36 +0000 (02:15 +0100)]
[Infiniband] Fix event queue doorbell ringing on Arbel

12 years ago[Infiniband] Add multiport support for Arbel cards
Michael Brown [Tue, 22 Apr 2008 00:37:00 +0000 (01:37 +0100)]
[Infiniband] Add multiport support for Arbel cards

12 years ago[Infiniband] Move event-queue process from driver to Infiniband core
Michael Brown [Mon, 21 Apr 2008 12:23:11 +0000 (13:23 +0100)]
[Infiniband] Move event-queue process from driver to Infiniband core

12 years ago[Hermon] Fix event queue doorbells.
Michael Brown [Fri, 18 Apr 2008 04:33:39 +0000 (05:33 +0100)]
[Hermon] Fix event queue doorbells.

Event queue doorbells must use UAR pages 0-127 depending on event queue
number; other doorbells must use pages 128+ (and we choose to use page

12 years ago[Infiniband] Add preliminary multiple port support for Hermon cards
Michael Brown [Fri, 18 Apr 2008 01:50:48 +0000 (02:50 +0100)]
[Infiniband] Add preliminary multiple port support for Hermon cards

Infiniband devices no longer block waiting for link-up in

Hermon driver needs to create an event queue and poll for link-up events.

Infiniband core needs to reread MAD parameters when link state changes.

IPoIB needs to cope with Infiniband link parameters being only partially
available at probe and open time.

12 years ago[HCI] Display "Not an executable image" when appropriate
Michael Brown [Tue, 8 Apr 2008 15:28:00 +0000 (16:28 +0100)]
[HCI] Display "Not an executable image" when appropriate

PXE is a catch-all image format with no signature checks.  If an
unsupported image file is loaded, it will be treated as a PXE image.  In
most cases, the image will be too large to be loaded as a PXE image (which
has to fit in base memory), so the error returned to the user will be that
the segment could not fit within the memory region.

Add an explicit check to pxe_image.c to reject images larger than base
memory with ENOEXEC.

Add ENOEXEC to the error string table.

12 years ago[Drivers-r8169] Add support for newer rtl8169 variants from Hilko Bengen
Marty Connor [Mon, 31 Mar 2008 13:14:23 +0000 (09:14 -0400)]
[Drivers-r8169] Add support for newer rtl8169 variants from Hilko Bengen

03-19-2008, Hilko Bengen, Cleanups and fixes for newer cards
(successfully tested with 8110SC-d onboard NIC)

12 years ago[http] gPXE is a HTTP/1.0 client, not a HTTP/1.1 client
H. Peter Anvin [Mon, 31 Mar 2008 12:01:08 +0000 (05:01 -0700)]
[http] gPXE is a HTTP/1.0 client, not a HTTP/1.1 client

gPXE is not compliant with the HTTP/1.1 specification (RFC 2616),
since it lacks support for "Transfer-Encoding: chunked".  gPXE is,
however, compliant with the HTTP/1.0 specification (RFC 1945), which
does not require "Transfer-Encoding: chunked" to be supported.

The only HTTP/1.1 feature that gPXE uses is the "Host:" header, but
servers universally accept that one from HTTP/1.0 clients as an
optional extension (it is obligatory for HTTP/1.1).  gPXE does not,
for example, appear to support connection caching.  Advertising as a
HTTP/1.0 client will typically make the server close the connection
immediately upon sending the last data, which is actually beneficial
if we aren't going to keep the connection alive anyway.

12 years ago[Settings] Expose SMBIOS via settings API
Michael Brown [Fri, 28 Mar 2008 15:35:06 +0000 (15:35 +0000)]
[Settings] Expose SMBIOS via settings API

In particular, expose the system UUID as a setting ("smbios/uuid").

12 years ago[DHCP] Add support for ProxyDHCP requests
Michael Brown [Thu, 27 Mar 2008 16:31:31 +0000 (16:31 +0000)]
[DHCP] Add support for ProxyDHCP requests

The PXE spec is (as usual) unclear on precisely when ProxyDHCPREQUESTs
should be issued.  We adapt the following, slightly paranoid approach:

  If an offer contains an IP address, then it is a normal DHCPOFFER.

  If an offer contains an option #60 "PXEClient", then it is a
  ProxyDHCPOFFER.  Note that the same packet can be both a normal

  After receiving the normal DHCPACK, if we have received a
  ProxyDHCPOFFER, we unicast a ProxyDHCPREQUEST back to the ProxyDHCP
  server on port 4011.  If we time out waiting for a ProxyDHCPACK, we
  treat this as a non-fatal error.

12 years ago[Settings] find_child_settings() accepts a NULL parent
Michael Brown [Thu, 27 Mar 2008 06:07:19 +0000 (06:07 +0000)]
[Settings] find_child_settings() accepts a NULL parent

12 years ago[DHCP] Treat empty fields in DHCP packets as non-existent.
Michael Brown [Thu, 27 Mar 2008 06:06:36 +0000 (06:06 +0000)]
[DHCP] Treat empty fields in DHCP packets as non-existent.

This avoids confusing other code by insisting that we have e.g. a
filename consisting of 128 zero bytes.

12 years ago[usr] Offer user a second chance to enter the shell on boot failure
Michael Brown [Wed, 26 Mar 2008 23:16:20 +0000 (23:16 +0000)]
[usr] Offer user a second chance to enter the shell on boot failure

12 years ago[libc] Whitespace cleanup in errno.h
Michael Brown [Wed, 26 Mar 2008 22:57:25 +0000 (22:57 +0000)]
[libc] Whitespace cleanup in errno.h

12 years ago[PXEXT] Update documentation
H. Peter Anvin [Wed, 26 Mar 2008 22:14:55 +0000 (15:14 -0700)]
[PXEXT] Update documentation

Add documentation for the FILE_EXEC and FILE_CHECK_API extension
calls, and update the documentation for the FILE_READ call.

12 years ago[PXEXT] Change the PXE return code for EWOULDBLOCK
H. Peter Anvin [Wed, 26 Mar 2008 22:12:19 +0000 (15:12 -0700)]
[PXEXT] Change the PXE return code for EWOULDBLOCK

Change the PXE return code for EWOULDBLOCK from PXENV_STATUS_FAILURE
to PXENV_STATUS_TFTP_OPEN.  This code is only used by the FILE_READ
PXEXT call, and is necessary to distinguish "error" from "no data" in
that call.

(The only other nonblocking call is UDP_READ, where the caller doesn't
care about the distinction, however, gPXE doesn't use EWOULDBLOCK
internally to represent this condition in that code.)

12 years ago[PXEXT] Add FILE_API_CHECK API function
H. Peter Anvin [Wed, 26 Mar 2008 22:10:56 +0000 (15:10 -0700)]

Add FILE_API_CHECK to the PXEXT API so the NBP can query the
availability and status of the API.

12 years ago[DHCP] Save precious packet-aligned memory by copying DHCP responses
Michael Brown [Wed, 26 Mar 2008 12:25:59 +0000 (12:25 +0000)]
[DHCP] Save precious packet-aligned memory by copying DHCP responses

Copy DHCP responses to a standard malloc()ed buffer, rather than
retaining the I/O buffer that they arrived in.

12 years ago[PXEXT] Avoid queueing zero-length buffers in posix_io.c
Michael Brown [Tue, 25 Mar 2008 21:10:21 +0000 (21:10 +0000)]
[PXEXT] Avoid queueing zero-length buffers in posix_io.c

read_user() assumes that zero-length buffers don't exist, and optimises
around this.

12 years ago[Settings] Remove assumption that all settings have DHCP tag values
Michael Brown [Tue, 25 Mar 2008 20:46:16 +0000 (20:46 +0000)]
[Settings] Remove assumption that all settings have DHCP tag values

Allow for settings to be described by something other than a DHCP option
tag if desirable.  Currently used only for the MAC address setting.

Separate out fake DHCP packet creation code from dhcp.c to fakedhcp.c.

Remove notion of settings from dhcppkt.c.

Rationalise dhcp.c to use settings API only for final registration of the
DHCP options, rather than using {store,fetch}_setting throughout.

12 years ago[PXEXT] Avoid returning a false EOF when we have an empty buffer queued
Michael Brown [Tue, 25 Mar 2008 20:29:42 +0000 (20:29 +0000)]
[PXEXT] Avoid returning a false EOF when we have an empty buffer queued

12 years ago[DHCP] Fix DHCP state confusion.
Michael Brown [Tue, 25 Mar 2008 16:38:01 +0000 (16:38 +0000)]
[DHCP] Fix DHCP state confusion.

DHCP code was using an incorrect check for whether to construct a

12 years ago[Settings] Add named setting for next-server
Michael Brown [Mon, 24 Mar 2008 00:48:06 +0000 (00:48 +0000)]
[Settings] Add named setting for next-server

It's probably easier to have a named setting for next-server, rather
than to explain to people why they need to pretend it is option 175.3.

12 years ago[Makefile] Use -MM instead of -M in dependency generation
Michael Brown [Mon, 24 Mar 2008 00:28:55 +0000 (00:28 +0000)]
[Makefile] Use -MM instead of -M in dependency generation

Using -MM strips out any system header files from the dependency list,
which means that we could safely use an external stdarg.h if we wanted

12 years ago[libc] Use __builtin_va_list et al in stdarg.h
Michael Brown [Mon, 24 Mar 2008 00:23:11 +0000 (00:23 +0000)]
[libc] Use __builtin_va_list et al in stdarg.h

The home-grown versions don't work properly for static variadic
functions, when gcc can choose to use a non-standard calling convention.

12 years ago[Settings] copy_settings() should not fail if some settings are missing!
Michael Brown [Sun, 23 Mar 2008 23:28:21 +0000 (23:28 +0000)]
[Settings] copy_settings() should not fail if some settings are missing!

12 years ago[IPv4] Use default netmasks when no subnet mask is specified.
Michael Brown [Sun, 23 Mar 2008 22:20:47 +0000 (22:20 +0000)]
[IPv4] Use default netmasks when no subnet mask is specified.

12 years ago[IPv4] Tidy up some header files.
Michael Brown [Sun, 23 Mar 2008 22:05:29 +0000 (22:05 +0000)]
[IPv4] Tidy up some header files.

12 years ago[DHCP] Fix up fake-packet creation as used by PXENV_GET_CACHED_INFO
Michael Brown [Sun, 23 Mar 2008 21:58:05 +0000 (21:58 +0000)]
[DHCP] Fix up fake-packet creation as used by PXENV_GET_CACHED_INFO

Add dedicated functions create_dhcpdiscover(), create_dhcpack() and
create_proxydhcpack() for use by external code such as the PXE preboot

Register ProxyDHCP options under the global scope "proxydhcp".

Unregister previously-acquired DHCP and ProxyDHCP settings when DHCP

12 years ago[DHCP] FIXME: quick temporary settings fix, needs update for new API
Marty Connor [Sat, 22 Mar 2008 03:37:02 +0000 (23:37 -0400)]
[DHCP] FIXME: quick temporary settings fix, needs update for new API

12 years agoMerge branch 'master' of
Michael Brown [Sat, 22 Mar 2008 00:50:06 +0000 (00:50 +0000)]
Merge branch 'master' of

12 years ago[Settings] Bugfix: store_setting() now applies changes even on root block
Michael Brown [Sat, 22 Mar 2008 00:40:33 +0000 (00:40 +0000)]
[Settings] Bugfix: store_setting() now applies changes even on root block

12 years ago[Settings] Implement simple_settings backed with extensible DHCP options
Michael Brown [Sat, 22 Mar 2008 00:24:50 +0000 (00:24 +0000)]
[Settings] Implement simple_settings backed with extensible DHCP options

12 years ago[Settings] DHCP is now working using the new settings API.
Michael Brown [Fri, 21 Mar 2008 22:55:59 +0000 (22:55 +0000)]
[Settings] DHCP is now working using the new settings API.

12 years ago[Settings] Migrate DHCP and NVO code to the new settings API (untested)
Michael Brown [Fri, 21 Mar 2008 22:15:31 +0000 (22:15 +0000)]
[Settings] Migrate DHCP and NVO code to the new settings API (untested)

12 years ago[DHCP] Kill off some no-longer-used DHCP functions
Michael Brown [Fri, 21 Mar 2008 00:50:12 +0000 (00:50 +0000)]
[DHCP] Kill off some no-longer-used DHCP functions

12 years ago[Settings] Use a settings applicator in ibft.c
Michael Brown [Fri, 21 Mar 2008 00:49:44 +0000 (00:49 +0000)]
[Settings] Use a settings applicator in ibft.c

12 years ago[Settings] Use a settings applicator to set the default TFTP URI.
Michael Brown [Fri, 21 Mar 2008 00:26:29 +0000 (00:26 +0000)]
[Settings] Use a settings applicator to set the default TFTP URI.

12 years ago[Misc] Kill off long-redundant tests/dhcptest.c
Michael Brown [Fri, 21 Mar 2008 00:07:36 +0000 (00:07 +0000)]
[Misc] Kill off long-redundant tests/dhcptest.c

12 years ago[IPv4] Add a config option for IPv4
Michael Brown [Fri, 21 Mar 2008 00:06:28 +0000 (00:06 +0000)]
[IPv4] Add a config option for IPv4

IPv4 may not always be dragged into the link, so add a specific
configuration option for it.

12 years ago[Settings] Use a settings applicator to configure IPv4 routes.
Michael Brown [Fri, 21 Mar 2008 00:01:27 +0000 (00:01 +0000)]
[Settings] Use a settings applicator to configure IPv4 routes.

12 years ago[Settings] Convert code in src/usr to use settings API.
Michael Brown [Thu, 20 Mar 2008 23:42:11 +0000 (23:42 +0000)]
[Settings] Convert code in src/usr to use settings API.

12 years ago[Settings] Introduce settings applicators.
Michael Brown [Thu, 20 Mar 2008 23:15:48 +0000 (23:15 +0000)]
[Settings] Introduce settings applicators.

Convert DHCP option applicators in dns.c and iscsi.c to settings

Kill off DHCP option applicators.

12 years ago[Settings] Add per-netdevice settings block
Michael Brown [Thu, 20 Mar 2008 21:06:03 +0000 (21:06 +0000)]
[Settings] Add per-netdevice settings block

Add a configuration settings block for each net device.  This will
provide the parent scope for settings applicable only to that network
device (e.g. non-volatile options stored on the NIC, options obtained via
DHCP, etc.).

Expose the MAC address as a setting.

12 years ago[Settings] Add settings hierarchy
Michael Brown [Thu, 20 Mar 2008 21:01:32 +0000 (21:01 +0000)]
[Settings] Add settings hierarchy

Add the notion of the settings hierarchy, complete with
register/unregister routines.

Rename set->store and get->fetch to avoid naming conflicts with get/put
as used in reference counting.

12 years ago[Settings] Start revamping the configuration settings API.
Michael Brown [Thu, 20 Mar 2008 04:06:07 +0000 (04:06 +0000)]
[Settings] Start revamping the configuration settings API.

Add the concept of an abstract configuration setting, comprising a (DHCP)
tag value and an associated byte sequence.

Add the concept of a settings namespace.

Add functions for extracting string, IPv4 address, and signed and
unsigned integer values from configuration settings (analogous to
dhcp_snprintf(), dhcp_ipv4_option(), etc.).

Update functions for parsing and formatting named/typed options to work
with new settings API.

Update NVO commands and config UI to use new settings API.

12 years ago]Drivers] Update licensing for cs89x0.[ch] and cs89x0.txt
Marty Connor [Wed, 19 Mar 2008 02:31:26 +0000 (22:31 -0400)]
]Drivers] Update licensing for cs89x0.[ch] and cs89x0.txt
Russ Nelson sent an email requesting the license change to
GPL Version 2.

12 years ago[Contribs] Add updated wake-on-LAN patch from Bill <>
Michael Brown [Wed, 19 Mar 2008 01:08:38 +0000 (01:08 +0000)]
[Contribs] Add updated wake-on-LAN patch from Bill <>

12 years ago[Settings] Allow named settings to have their type specified explicitly
Michael Brown [Tue, 18 Mar 2008 15:51:03 +0000 (15:51 +0000)]
[Settings] Allow named settings to have their type specified explicitly

Allow setting names such as "ip:hex".

12 years ago[Timers] Initialise timers on first use
Michael Brown [Tue, 18 Mar 2008 15:23:10 +0000 (15:23 +0000)]
[Timers] Initialise timers on first use

Timers are sometimes required before the call to initialise(), so we
cannot rely on initialise() to set up the timers before use.

Also fix a potential integer overflow issue in generic_currticks_udelay()

12 years ago[Timers] Miscellaneous timer system fixes
Michael Brown [Tue, 18 Mar 2008 14:48:28 +0000 (14:48 +0000)]
[Timers] Miscellaneous timer system fixes

Add missing comments to timer code.

Lock system if no suitable timer source is found.

Fix initialisation order so that timers are initialised before code that
needs to use them.

12 years ago[Settings] Allow encapsulated options to be specified as named settings
Michael Brown [Tue, 18 Mar 2008 04:13:11 +0000 (04:13 +0000)]
[Settings] Allow encapsulated options to be specified as named settings

Allow encapsulated options to be specified as e.g. "175.3".  As a
side-effect, change the separator character for the type field from "." to
":"; for example, the IP address pseudo-option is now "175.3:ipv4".

12 years ago[Settings] Add int16, int32 and hex-string configuration setting types
Michael Brown [Tue, 18 Mar 2008 03:23:36 +0000 (03:23 +0000)]
[Settings] Add int16, int32 and hex-string configuration setting types

Add parse and display routines for 16-bit and 32-bit integer configuration

Add parse and display routines for hex-string configuration settings.

Assume hex-string as a configuration setting type if no type is explicitly

12 years ago[libc] Fix a validation bug in strtoul()
Michael Brown [Tue, 18 Mar 2008 03:14:05 +0000 (03:14 +0000)]
[libc] Fix a validation bug in strtoul()

strtoul() was accepting the characters immediately above ASCII 0..9 as
valid hex digits, due to a missing comparison.

12 years ago[Settings] show_setting() functions return snprintf()-style length.
Michael Brown [Tue, 18 Mar 2008 00:48:23 +0000 (00:48 +0000)]
[Settings] show_setting() functions return snprintf()-style length.

show_setting() and related functions now return an "actual length" in the
style of snprintf().  This is to allow consumers to allocate buffers large
enough to hold the formatted setting.

12 years agoMerge branch 'pxerom-pmm'
Michael Brown [Tue, 11 Mar 2008 16:11:51 +0000 (16:11 +0000)]
Merge branch 'pxerom-pmm'

12 years ago[PXE] PMM now tested and working
Michael Brown [Tue, 11 Mar 2008 16:08:04 +0000 (16:08 +0000)]
[PXE] PMM now tested and working

Minor bugfix: 4 x 2 = 8, not 16

12 years ago[prefix] Cope with image source addresses outside base memory
Michael Brown [Tue, 11 Mar 2008 13:26:46 +0000 (13:26 +0000)]
[prefix] Cope with image source addresses outside base memory

When PMM is used, the gPXE image source will no longer be in base memory.
Decompression of .text16 and .data16 can therefore no longer be done in
real mode.

12 years ago[PXE] Improve PnP/BBS detection
Michael Brown [Tue, 11 Mar 2008 12:02:12 +0000 (12:02 +0000)]
[PXE] Improve PnP/BBS detection

Use BBS installation check to see if we need to hook INT19 even on a PnP

Verify that $PnP signature is paragraph-aligned; bochs/qemu BIOS provides
a dummy $PnP signature with no valid entry point, and deliberately
unaligns the signature to indicate that it is not properly valid.

Print message if INT19 is hooked.

Attempt to use PMM even if BBS check failed.

12 years ago[prefix] Add printing functions to libprefix.S
Michael Brown [Tue, 11 Mar 2008 11:32:19 +0000 (11:32 +0000)]
[prefix] Add printing functions to libprefix.S

Move the printing functions from pxeprefix.S into libprefix.S, so they
are available for debug from any prefix.

12 years agoMerge branch 'xl0-timer'
Michael Brown [Mon, 10 Mar 2008 13:02:53 +0000 (13:02 +0000)]
Merge branch 'xl0-timer'

12 years ago[PXE] Work around a buffer-size bug in WinPE
Michael Brown [Mon, 10 Mar 2008 11:46:55 +0000 (11:46 +0000)]
[PXE] Work around a buffer-size bug in WinPE

WinPE's pxeboot.n12 takes the BufferLimit returned by gPXE (indicating
the size of gPXE's internal DHCP packet buffers) and erroneously passes
it in as BufferSize (indicating the size of pxeboot.n12's DHCP packet
buffer).  If these don't match, then pxeboot.n12 ends up instructing gPXE
to overwrite parts of its data segment.

Change gPXE's internal DHCP packet buffers to be exactly
sizeof(BOOTPLAYER_t) bytes to work around this problem.

12 years ago[PXE] Add PMM support to romprefix.S (untested)
Michael Brown [Sun, 9 Mar 2008 22:13:07 +0000 (22:13 +0000)]
[PXE] Add PMM support to romprefix.S (untested)

ROM initialisation vector now attempts to allocate a 2MB block using
PMM.  If successful, it copies the ROM image to this block, then
shrinks the ROM image to allow for more option ROMs.  If unsuccessful,
it leaves the ROM as-is.

ROM BEV now attempts to return to the BIOS, resorting to INT 18 only
if the BIOS stack has been corrupted.

12 years ago[Makefile] Use bin/VVVVDDDD.rom instead of bin/pci_VVVV_DDDD.rom
Michael Brown [Thu, 6 Mar 2008 15:37:34 +0000 (15:37 +0000)]
[Makefile] Use bin/VVVVDDDD.rom instead of bin/pci_VVVV_DDDD.rom

The generate-by-PCI-device-ID rules (bin/pci_VVVV_DDDD.rom) are generally
used for building actual ROM images to be burned, and the burning
utilities generally run under some DOS variant.  Change the filename from
pci_VVVV_DDDD.rom to VVVVDDDD.rom so that it is compatible with the DOS
8.3-character filename limit.