summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [comboot] Fix reference counting on replacement imagesMichael Brown2009-02-175-18/+23
| | | | When chaining COMBOOT images, the old images now get freed correctly.
* [comboot] Allow for tail recursion of COMBOOT imagesMichael Brown2009-02-178-111/+176
| | | | | | | | | | | | 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.
* [uri] Allow use of relative URIs when calling churi()Michael Brown2009-02-161-1/+4
|
* [build] Cope with oddities in the Fedora 10 assemblerMichael Brown2009-02-163-15/+15
| | | | | | | | | 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>.
* [build] Fix building on gcc 3Michael Brown2009-02-161-0/+2
| | | | GCC did not support #pragma GCC visibility until version 4.0.
* [build] Allow NO_WERROR=1 to inhibit --fatal-warnings as well as -WerrorMichael Brown2009-02-161-1/+1
|
* [image] Avoid claiming zero-length images as validMichael Brown2009-02-162-0/+12
| | | | | Both the script and PXE images types will claim a zero-length image. Inhibit this to avoid end-user surprises.
* [image] Allow multiple embedded imagesMichael Brown2009-02-1612-91/+138
| | | | | | | | | | 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>.
* [romprefix] Update ROM checksum even if PMM allocation failsMichael Brown2009-02-151-7/+9
| | | | | | | | | | 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.
* [build] Treat warnings as errors in assembly filesMichael Brown2009-02-151-0/+1
| | | | | Add --fatal-warnings to ASFLAGS; this is the equivalent of -Werror in CFLAGS (which we have used since July 2007).
* [i386] Add explicit flags and type on all .section declarationsMichael Brown2009-02-1510-102/+85Star
| | | | | | | | | | | | | | | | | | | | | | | 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'`
* [i386] Add explicit ""aw", @nobits" declarations to stack sectionsMichael Brown2009-02-152-2/+2
| | | | | | | | | | | | | | 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.
* [xfer] Make consistent assumptions that xfer metadata can never be NULLMichael Brown2009-02-157-32/+18Star
| | | | | | | | | | | | | 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()).
* [umalloc] Avoid problems when _textdata_memsz is a multiple of 4kBMichael Brown2009-02-151-3/+3
| | | | | | | | | | | | | | | | | | | 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().
* [http] Allow for URI encodings within username and passwordMichael Brown2009-02-131-2/+15
|
* [http] Add support for HTTP Basic authenticationMichael Brown2009-02-131-0/+28
|
* [base64] Add base64 encoding functionsMichael Brown2009-02-132-0/+90
|
* [settings] Handle errors in fetchf_uristring()Michael Brown2009-02-121-1/+4
| | | | | | | | | 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>.
* [tls] Use our own ASN.1 routines for certificate parsingMichael Brown2009-02-108-954/+354Star
| | | | | | 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.
* [crypto] Remove unused filesMichael Brown2009-02-107-1851/+0Star
|
* [mtnic] Add multiport support and some minor fixesItay Gazit2009-02-092-600/+702
| | | | Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [sundance] Added NIC variantThomas Miletich2009-02-061-0/+1
| | | | | | | | | 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>
* [pxe] Display the "Press F8" prompt rather than displaying menu with timeoutMichael Brown2009-02-051-58/+112
| | | | | | | | | | | 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.
* [pxe] Obey lists of PXE Boot Servers and associated Discovery Control bitsMichael Brown2009-02-056-62/+195
| | | | | | | | 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.
* [pxe] Skip PXE boot server discovery if directed to do soMichael Brown2009-02-052-6/+30
| | | | | Option 43.6 can direct us to skip PXE boot server discovery and just perform a standard DHCP filename boot.
* [pxe] Fall back to broadcast if no boot server multicast address existsMichael Brown2009-02-031-1/+2
| | | | | fetch_ipv4_setting() will zero its IPv4 address argument if no such setting exists, rather than leaving it untouched.
* [iobuf] Add iob_disown() and use it where it simplifies codeMichael Brown2009-02-018-18/+31
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* [contrib] Update qemu documentationMichael Brown2009-02-011-18/+11Star
|
* [dhcp] Send user class in DHCP requestsMichael Brown2009-02-013-3/+29
|
* [tftp] Guard against invalid data block numbersMichael Brown2009-02-011-0/+5
| | | | | | | | 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>.
* [dhcp] Split PXE menuing code out of dhcp.cMichael Brown2009-02-0117-961/+1367
| | | | | | | | | 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.
* [settings] Avoid duplicate settings block namesMichael Brown2009-01-311-0/+5
| | | | | | | 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.
* [scsi] Cope with targets that send multiple CHECK CONDITIONS at power-onMichael Brown2009-01-301-5/+19
| | | | | | | | | | | | | | | 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>.
* [ui] Allow Ctrl-C to cancel wait for net device link-upMichael Brown2009-01-271-0/+9
| | | | | This really ought to be handled via monojob.c and the usual Ctrl-C mechanism that handles cancelling DHCP or file downloads.
* [dns] Append local domain to relative namesStefan Hajnoczi2009-01-272-11/+66
| | | | | | | | | | | | | | | 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.
* [settings] Add fetch_string_setting_copy()Michael Brown2009-01-272-0/+35
|
* [tftp] Temporary fix for conveying TFTP block size to callersMichael Brown2009-01-272-8/+23
| | | | | | | | | | | | | | | | | | | | | 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.
* [dhcp] Include support for PXE boot menusMichael Brown2009-01-252-14/+197
| | | | | | | | | 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.
* [bios] Add F8 function key as a recognised BIOS keycodeMichael Brown2009-01-251-1/+3
|
* [console] Allow KEY_xxx constants to cover F8 function keyMichael Brown2009-01-252-22/+21Star
| | | | | | | 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.
* [dhcp] Clarify language surrounding ProxyDHCPMichael Brown2009-01-232-55/+56
| | | | | | 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.
* [dhcp] Handle missing ProxyDHCP serversMichael Brown2009-01-231-1/+8
| | | | | | | | | | | | | | | | 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.
* [dhcp] Pass PXE boot menu item to PXE Boot ServerMichael Brown2009-01-233-75/+133
| | | | | | | | Pick out the first boot menu item from the boot menu (option 43.9) and pass it to the boot server as the boot menu item (option 43.71). Also improve DHCP debug messages to include more details of the packets being transmitted.
* [tcp] Always set PUSH flag on TCP transmissionsMichael Brown2009-01-211-1/+1
| | | | | | | | | Apparently this can cause a major speedup on some iSCSI targets, which will otherwise wait for a timer to expire before responding. It doesn't seem to hurt other simple TCP test cases (e.g. HTTP downloads). Problem and solution identified by Shiva Shankar <802.11e@gmail.com>
* [dhcp] Add preliminary support for PXE Boot ServersMichael Brown2009-01-213-1/+109
| | | | | | | | | Some PXE configurations require us to perform a third DHCP transaction (in addition to the real DHCP transaction and the ProxyDHCP transaction) in order to retrieve information from a "Boot Server". This is an experimental implementation, since the actual behaviour is not well specified in the PXE spec.
* [tcpip] Allow for transmission to multicast IPv4 addressesMichael Brown2009-01-217-20/+29
| | | | | | | | | | | When sending to a multicast address, it may be necessary to specify the source address explicitly, since the multicast destination address does not provide enough information to deduce the source address via the miniroute table. Allow the source address specified via the data-xfer metadata to be passed down through the TCP/IP stack to the IPv4 layer, which can use it as a default source address.
* [ethernet] Fix eth_mc_hash() return statusMichael Brown2009-01-211-0/+1
| | | | | eth_mc_hash() was missing a return within a switch statement, and so always falling through to the default case and returning failure.
* [dhcp] Centralise DHCP successful state transitionsMichael Brown2009-01-211-19/+35
| | | | | | | Move all the DHCP state transition logic into a single function dhcp_next_state(). This will make it easier to add support for PXE Boot Servers, since it abstracts away the difference between "mark DHCP as complete" and "transition to boot server discovery".
* [dhcp] Allow for missing server ID in ProxyDHCPACKMichael Brown2009-01-211-9/+13
| | | | | | | | | | | | The Linux PXE server (http://www.kano.org.uk/projects/pxe) does not set the server identifier in its ProxyDHCP responses. If the server ID is missing, do not treat this as an error. This resolves the "vague and unsettling memory" mentioned in commit fdb8481d ("[dhcp] Verify server identifier on ProxyDHCPACKs"). Note that we already accept ProxyDHCPOFFERs without a server identifier; they get treated as potential BOOTP packets.
* [efi] Expose both GUIDs for the EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOLMichael Brown2009-01-121-7/+12
| | | | | | | At some point, it seems that someone decided to change the GUID for the EFI_NETWORK_INTERFACE_IDENTIFIER_PROTOCOL. Current EFI builds ignore the older GUID, older EFI builds ignore the newer GUID, so we have to expose both.