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

2843 Commits

Author SHA1 Message Date
Michael Brown bea828b9ed [settings] Allow store_setting() to access the root settings block 2009-02-17 11:57:31 +00:00
Michael Brown 54840039f6 [http] Send authentication information whenever username is present
Send authentication information if the username is present, even if
the password is empty.
2009-02-17 11:56:27 +00:00
Michael Brown 67ee41ad6d [editbox] Allow for password widgets that do not display their contents 2009-02-17 11:55:55 +00:00
Michael Brown cff419148c [pxe] Allow Escape to abort PXE menu selections
Other vendor PXE stacks tend to allow the Escape key to be used to
abort menu selection.  Allow Escape (as well as Ctrl-C) to abort
selection.
2009-02-17 07:35:57 +00:00
Michael Brown 06b5132fdc [icmp] Add support for responding to pings 2009-02-17 06:59:15 +00:00
Daniel Verkamp dbbd81c140 [comboot] Implement INT 22h AX=001Bh (Cleanup, shuffle, and boot to real mode) 2009-02-17 03:52:44 +00:00
Michael Brown 5026a35fef [comboot] Restore the real-mode stack pointer on exit from a COMBOOT image
COMBOOT images use INTs to issue API calls; these end up making calls
into gPXE from real mode, and so temporarily change the real-mode
stack pointer.  When our COMBOOT code uses a longjmp() to implement
the various "exit COMBOOT image" API calls, this leaves the real-mode
stack pointer stuck with its temporary value, which causes problems if
we eventually try to exit out of gPXE back to the BIOS.

Fix by adding rmsetjmp() and rmlongjmp() calls (analogous to
sigsetjmp()/siglongjmp()); these save and restore the additional state
needed for real-mode calls to function correctly.
2009-02-17 03:38:40 +00:00
Michael Brown 7f903f03af [comboot] Unhook interrupt vectors after returning from a COMBOOT image 2009-02-17 02:03:16 +00:00
Michael Brown 14eafc5b8d [comboot] Fix reference counting on replacement images
When chaining COMBOOT images, the old images now get freed correctly.
2009-02-17 01:45:12 +00:00
Michael Brown 8904cd55f1 [comboot] Allow for tail recursion of COMBOOT images
Multi-level menus via COMBOOT rely on the COMBOOT program being able
to exit and invoke a new COMBOOT program (the next menu).  This works,
but rapidly (within about five iterations) runs out of space in gPXE's
internal stack, since each new image is executed in a new function
context.

Fix by allowing tail recursion between images; an image can now
specify a replacement image for itself, and image_exec() will perform
the necessary tail recursion.
2009-02-17 00:47:35 +00:00
Michael Brown 349868b8fd [uri] Allow use of relative URIs when calling churi() 2009-02-16 04:56:55 +00:00
Michael Brown 7bc4093e1a [build] Cope with oddities in the Fedora 10 assembler
The version of the GNU assembler shipped with Fedora 10
(2.18.50.0.9-8.fc10) complains about character literals in some of our
assembly code.  Changing $'x' to $( 'x' ) seems to fix the problem.
Yes, the whitespace is required; using just $('x') does not work.

Reported by Kevin O'Connor <kevin@koconnor.net>.
2009-02-16 03:53:25 +00:00
Michael Brown b08e255ef1 [build] Fix building on gcc 3
GCC did not support #pragma GCC visibility until version 4.0.
2009-02-16 02:15:17 +00:00
Michael Brown 78a57a6f76 [build] Allow NO_WERROR=1 to inhibit --fatal-warnings as well as -Werror 2009-02-16 01:06:40 +00:00
Michael Brown 24e948f030 [image] Avoid claiming zero-length images as valid
Both the script and PXE images types will claim a zero-length image.
Inhibit this to avoid end-user surprises.
2009-02-16 00:30:48 +00:00
Michael Brown 076154a1c6 [image] Allow multiple embedded images
This patch extends the embedded image feature to allow multiple
embedded images instead of just one.

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

Based heavily upon a patch by Stefan Hajnoczi <stefanha@gmail.com>.
2009-02-16 00:30:36 +00:00
Michael Brown f16668dd60 [romprefix] Update ROM checksum even if PMM allocation fails
There are code paths other than PMM allocation that can result in our
changing the ROM checksum.  For example, we attempt to update our
product string to incorporate the PCI bus:dev.fn number.  In a system
that does not support PMM, we could therefore end up with an incorrect
checksum.

Fix by attempting to update the checksum unconditionally.
2009-02-15 11:44:21 +00:00
Michael Brown 79867d34ee [build] Treat warnings as errors in assembly files
Add --fatal-warnings to ASFLAGS; this is the equivalent of -Werror in
CFLAGS (which we have used since July 2007).
2009-02-15 11:05:00 +00:00
Michael Brown c9e5b12473 [i386] Add explicit flags and type on all .section declarations
Try to avoid future problems caused by implicit section flags and/or
type information by instituting a policy that all .section
declarations must explicitly state the flags and type.

Most of this change was achieved using

    perl -pi \
      -e 's/".text"$/".text", "ax", \@progbits/ ; ' \
      -e 's/".text16"$/".text16", "ax", \@progbits/ ; ' \
      -e 's/".text16.null"$/".text16.null", "ax", \@progbits/ ; ' \
      -e 's/".text16.data"$/".text16.data", "aw", \@progbits/ ; ' \
      -e 's/".data"$/".data", "aw", \@progbits/ ; ' \
      -e 's/".data16"$/".data16", "aw", \@progbits/ ; ' \
      -e 's/".bss"$/".bss", "aw", \@nobits/ ; ' \
      -e 's/".bss16"$/".bss16", "aw", \@nobits/ ; ' \
      -e 's/".prefix"$/".prefix", "ax", \@progbits/ ; ' \
      -e 's/".prefix.lib"$/".prefix.lib", "awx", \@progbits/ ; ' \
      -e 's/".prefix.data"$/".prefix.data", "aw", \@progbits/ ; ' \
      -e 's/".weak"$/".weak", "a", \@nobits/ ; ' \
      `git grep -l '\.section'`
2009-02-15 10:59:53 +00:00
Michael Brown ce2aa66d39 [i386] Add explicit ""aw", @nobits" declarations to stack sections
As reported by Stefan, commit 13d09e6 ("[i386] Simplify linker script
and standardise linker-defined symbol names") breaks gdb, readelf and
associated utilities.

This is caused by the .stack section overwriting a block in the middle
of the .debug_info section (despite being included in the
.bss.textdata section in the output file, which apparently has the
correct attributes for a .bss section).

Fixed by adding explicit flags and type to the stack section
declaration.
2009-02-15 10:02:26 +00:00
Michael Brown 8ae1cac050 [xfer] Make consistent assumptions that xfer metadata can never be NULL
The documentation in xfer.h and xfer.c does not say that the metadata
parameter is optional in calls such as xfer_deliver_iob_meta() and the
deliver_iob() method.  However, some code in net/ is prepared to
accept a NULL pointer, and xfer_deliver_as_iob() passes a NULL pointer
directly to the deliver_iob() method.

Fix this mess of conflicting assumptions by making everything assume
that the metadata parameter is mandatory, and fixing
xfer_deliver_as_iob() to pass in a dummy metadata structure (as is
already done in xfer_deliver_iob()).
2009-02-15 08:44:22 +00:00
Michael Brown 46da51703a [umalloc] Avoid problems when _textdata_memsz is a multiple of 4kB
If it happens that _textdata_memsz ends up being an exact multiple of
4kB, then this will cause the .textdata section (after relocation) to
start on a page boundary.  This means that the hidden memory region
(which is rounded down to the nearest page boundary) will start
exactly at virtual address 0, i.e. UNULL.  This means that
init_eheap() will erroneously assume that it has failed to allocate a
an external heap, since it typically ends up choosing the area that
lies immediately below .textdata, which in this case will be the
region with top==UNULL.

A subsequent error is that memtop_urealloc() passes through the error
return status -ENOMEM to the caller, which (rightly) assumes that the
result represents a valid userptr_t address.

Fixed by using alternative tests for heap non-existence, and by
returning UNULL in case of an error from init_eheap().
2009-02-15 07:56:16 +00:00
Michael Brown 816a32aaee [http] Allow for URI encodings within username and password 2009-02-13 16:26:43 +00:00
Michael Brown ef70f87997 [http] Add support for HTTP Basic authentication 2009-02-13 15:43:17 +00:00
Michael Brown d900ae05d7 [base64] Add base64 encoding functions 2009-02-13 14:54:13 +00:00
Michael Brown 4e6b62c946 [settings] Handle errors in fetchf_uristring()
fetchf_uristring() was failing to handle error values from
fetch_setting(), resulting in its attempting to allocate extremely
large temporary buffers on the stack (and so overrunning the stack and
locking up the machine).

Problem reported by Shao Miller <Shao.Miller@yrdsb.edu.on.ca>.
2009-02-12 09:16:53 +00:00
Michael Brown 8e960eb67c [tls] Use our own ASN.1 routines for certificate parsing
Use our own, more robust, ASN.1 parsing routines to extract the RSA
public key from a server certificate.  Remove the now-unused AXTLS
ASN.1 parser.
2009-02-10 18:30:17 +00:00
Michael Brown 5a99c586cf [crypto] Remove unused files 2009-02-10 15:47:44 +00:00
Itay Gazit 750c19466a [mtnic] Add multiport support and some minor fixes
Signed-off-by: Michael Brown <mcb30@etherboot.org>
2009-02-09 12:43:44 +00:00
Thomas Miletich e9c10ca158 [sundance] Added NIC variant
This previously unsupported NIC variant was was found to work using
the current driver:

     PCI_ROM(0x13f0, 0x0200, "ip100a", "IC+ IP100A"),

Signed-off-by: Marty Connor <mdc@etherboot.org>
2009-02-06 08:41:02 -05:00
Michael Brown 56066a6085 [pxe] Display the "Press F8" prompt rather than displaying menu with timeout
The PXE spec dictates the rather ugly feature that we have to present
a DHCP-specified prompt string to the user, then wait to see if they
press F8 before displaying the menu.

This seems to me to be a significant retrograde step from the current
situation of displaying the menu with the timeout counting down
against the default selected boot option, but apparently the lack of
the "Press F8" prompt causes some confusion.
2009-02-05 19:29:16 +00:00
Michael Brown 881f1f59ef [pxe] Obey lists of PXE Boot Servers and associated Discovery Control bits
Various combinations of options 43.6, 43.7 and 43.8 dictate which
servers we send Boot Server Discovery requests to, and which servers
we should accept responses from.  Obey these options, and remove the
explicit specification of a single Boot Server from start_pxebs() and
dependent functions.
2009-02-05 09:34:32 +00:00
Michael Brown ff2b308506 [pxe] Skip PXE boot server discovery if directed to do so
Option 43.6 can direct us to skip PXE boot server discovery and just
perform a standard DHCP filename boot.
2009-02-05 09:34:05 +00:00
Michael Brown 4b276b8df9 [pxe] Fall back to broadcast if no boot server multicast address exists
fetch_ipv4_setting() will zero its IPv4 address argument if no such
setting exists, rather than leaving it untouched.
2009-02-03 02:44:15 +00:00
Michael Brown dbe84c5aad [iobuf] Add iob_disown() and use it where it simplifies code
There are many functions that take ownership of the I/O buffer they
are passed as a parameter.  The caller should not retain a pointer to
the I/O buffer.  Use iob_disown() to automatically nullify the
caller's pointer, e.g.:

    xfer_deliver_iob ( xfer, iob_disown ( iobuf ) );

This will ensure that iobuf is set to NULL for any code after the call
to xfer_deliver_iob().

iob_disown() is currently used only in places where it simplifies the
code, by avoiding an extra line explicitly setting the I/O buffer
pointer to NULL.  It should ideally be used with each call to any
function that takes ownership of an I/O buffer.  (The SSA
optimisations will ensure that use of iob_disown() gets optimised away
in cases where the caller makes no further use of the I/O buffer
pointer anyway.)

If gcc ever introduces an __attribute__((free)), indicating that use
of a function argument after a function call should generate a
warning, then we should use this to identify all applicable function
call sites, and add iob_disown() as necessary.
2009-02-01 20:16:10 +00:00
Michael Brown 0171098212 [contrib] Update qemu documentation 2009-02-01 20:16:10 +00:00
Michael Brown 4502c04360 [dhcp] Send user class in DHCP requests 2009-02-01 20:06:09 +00:00
Michael Brown 6711ce18a7 [tftp] Guard against invalid data block numbers
A TFTP DATA packet with a block number of zero (representing a
negative offset within the file) could potentially cause problems.
Fixed by explicitly rejecting such packets.

Identified by Stefan Hajnoczi <stefanha@gmail.com>.
2009-02-01 13:07:17 +00:00
Michael Brown e65afc4b10 [dhcp] Split PXE menuing code out of dhcp.c
The DHCP client code now implements only the mechanism of the DHCP and
PXE Boot Server protocols.  Boot Server Discovery can be initiated
manually using the "pxebs" command.  The menuing code is separated out
into a user-level function on a par with boot_root_path(), and is
entered in preference to a normal filename boot if the DHCP vendor
class is "PXEClient" and the PXE boot menu option exists.
2009-02-01 01:21:40 +00:00
Michael Brown d2b0081740 [settings] Avoid duplicate settings block names
Automatically unregister any settings with the same name (and position
within the settings tree) as a newly registered settings block.

This functionality is generalised out from dhcp.c.
2009-01-31 07:32:20 +00:00
Michael Brown b111bdfb00 [scsi] Cope with targets that send multiple CHECK CONDITIONS at power-on
Some targets send a spurious CHECK CONDITION message in response to
the first SCSI command.  We issue (and ignore the status of) an
arbitary harmless SCSI command (a READ CAPACITY (10)) in order to draw
out this response.

The Solaris Comstar target seems to send more than one spurious CHECK
CONDITION response.  Attempt up to SCSI_MAX_DUMMY_READ_CAP dummy READ
CAPACITY (10) commands before assuming that error responses are
meaningful.

Problem reported by Kristof Van Doorsselaere <kvandoor@aserver.com>
and Shiva Shankar <802.11e@gmail.com>.
2009-01-30 13:32:53 +00:00
Michael Brown 52c596bafb [ui] Allow Ctrl-C to cancel wait for net device link-up
This really ought to be handled via monojob.c and the usual Ctrl-C
mechanism that handles cancelling DHCP or file downloads.
2009-01-27 20:09:50 +00:00
Stefan Hajnoczi d10a7e7739 [dns] Append local domain to relative names
Try to qualify relative names in the DNS resolver using the DHCP Domain
Name.  For example:

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

yields:

  www.etherboot.org

Only names with no dots ('.') will be modified.  A name with one or more
dots is unchanged.
2009-01-27 19:26:12 +00:00
Michael Brown a128973ecb [settings] Add fetch_string_setting_copy() 2009-01-27 19:13:47 +00:00
Michael Brown 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