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

2615 Commits

Author SHA1 Message Date
Michael Brown 35b7658877 [settings] Add the uristring setting type
This allows settings to be expanded in a way that is safe to include
within a URI string, such as

  kernel http://10.0.0.1/boot.php?mf=${manufacturer:uristring}

where the ${manufacturer} setting may contain characters that are not
permitted (or have reserved purposes) within a URI.

Since whitespace characters will be URI-encoded (e.g. "%20" for a
space character), this also works around the problem that spaces
within an expanded setting would cause the shell to split command-line
arguments incorrectly.
2008-09-24 07:22:42 +01:00
Michael Brown b350b10b35 [uri] Add uri_encode() and uri_decode() functions for URI character encoding 2008-09-24 07:21:47 +01:00
Michael Brown 9d44a06188 [romprefix] If we hook INT 19, prompt before attempting boot
On non-BBS systems we hook INT 19, since there is no other way we can
guarantee gaining control of the flow of execution.  If we end up
doing this, prompt the user before attempting boot, since forcibly
capturing INT 19 is rather antisocial.
2008-09-24 00:53:40 +01:00
Michael Brown 4011f9d956 [phantom] Skip command PEG initialisation if PEG is already running
It is possible for the BIOS to use the UNDI API to bring up the NIC
prior to system boot.  If this happens, UNM_NIC_REG_CMDPEG_STATE will
contain the value 0xf00f (UNM_NIC_REG_CMDPEG_STATE_INITIALIZE_ACK),
and we should skip initialising the command PEG.
2008-09-23 23:36:55 +01:00
Michael Brown 8b20e5d2b7 [pcbios] Sanity-check the INT15,e820 and INT15,e801 memory maps
Some systems seem to report insane memory maps (particularly at POST
time).  Detect and work around some of the common failure cases.
2008-09-23 23:35:19 +01:00
Michael Brown e13d793160 [phantom] Omit an initialisation step now performed by the firmware
The firmware will now determine the right port mode on all cards, so
the PXE driver doesn't have to set it.  (Setting the port mode
apparently breaks some newer cards.)
2008-09-23 23:11:05 +01:00
Michael Brown a2f9bf70d7 [pxe] Display PXE_LOADER debug message after call to initialise()
At least one Dell system calls the UNDI loader entry point with the
BIOS console disabled.  The serial console is active only after a call
to initialise(), so move the debug message in undi_loader() so that it
can be displayed via the serial console.
2008-09-23 04:15:56 +01:00
Michael Brown ca0b0f0616 [relocate] Guard against systems that report empty memory regions
If the INT 15,e820 memory map reports a region [0,0), this confuses
the "truncate to even megabytes" logic, which ends up rounding the
region 'down' to [0,fff00000).

Fix by ensuring that the region's end address is at least 1, before we
subtract 1 to obtain the "last byte in region" address.
2008-09-23 01:13:28 +01:00
Michael Brown 0fd1e54026 [memmap] Allow for 4GB+ systems in debug message
INT 15,e801 is capable of returning a memory range that extends to
4GB, so allow for this in the debug message that shows the data
returned by INT 15,e801.
2008-09-23 00:58:12 +01:00
Michael Brown 0e408658b9 [iscsi] Change default initiator name prefix to "iqn.2000-01.org.etherboot:"
The domain etherboot.org was actually registered on 2000-01-09, not
2000-09-01.  (To put it another way, it was registered on 1/9/2000 (US
date format) rather than 1/9/2000 (sensible date format); this may
illuminate the cause of the error.)

"iqn.2000-09.org.etherboot:" is still valid as per RFC3720, but may be
surprising to users, so change it to something less unexpected.

Thanks to the anonymous contributor for pointing this one out.
2008-09-19 17:46:07 +01:00
Michael Brown 6df82b1a9d [undi] Scan for UNDI ROMs on 512-byte boundaries rather than 2kB boundaries
Apparently some BIOSes will place option ROMs on 512-byte boundaries.
While this is against specification, it doesn't actually hurt
anything, so we may as well increase our scan granularity to 512
bytes.

Contributed by Luca <lucarx76@gmail.com>
2008-09-12 03:10:27 +01:00
Michael Brown 8223084afc [util] Disable automatic CR->LF conversion in serial-console utility
DUET (the EFI test environment) seems not to handle LF, so inhibit the
CR->LF conversion that the pty does for us by default.  This doesn't
affect operation of gPXE, which will happily accept either CR or LF.
2008-09-07 22:08:40 +01:00
Michael Brown 18aa0e79d2 [pcbios] Add extra debugging messages relating to the system memory map 2008-09-07 21:38:41 +01:00
Michael Brown a30c70727a [contrib] Bring bochs/qemu READMEs up to date with latest upstream code 2008-09-07 11:31:42 +01:00
Michael Brown c0beec8baf [pxe] Add a dummy PXENV+ entry point at UNDI_CS:0000
Wyse Streaming Manager server (WLDRM13.BIN) assumes that the PXENV+
entry point is at UNDI_CS:0000; apparently, somebody at Wyse has
difficulty distinguishing between the words "may" and "must"...

Add a dummy entry point at UNDI_CS:0000, which just jumps to the
correct entry point.
2008-09-06 03:19:03 +01:00
Michael Brown 2e03610c0d [multiboot] Allow for unspecified {load,bss}_end_addr for raw images
The multiboot specification states that, for raw images, if
load_end_addr is zero then it should be interpreted as meaning "use
the entire file", and if bss_end_addr is zero it should be interpreted
as meaning "no bss".
2008-09-06 01:57:52 +01:00
Eygene Ryabinkin 6de45ad4ae [util] Avoid calling fclose(NULL) in zbin.c
Must check that argument to a fclose() is not NULL -- we can get to the
'err' label when file was not opened.  fclose(NULL) is known to produce
core dump on some platforms and we don't want zbin to fail so loudly.

Signed-off-by: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
2008-09-04 11:29:37 +01:00
Eygene Ryabinkin 99251f5b32 [libprefix] Add addr32 prefix required by older assemblers
Explicitly state that we are using 32-bit addressing in 16-bit code.

GNU as 2.15 (FreeBSD/amd64 7-STABLE) got confused that 32-bit registers
are used in the code that was declared as 16-bit.  Add explicit modifier
'addr32' to make assembler happy.

Signed-off-by: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
2008-09-04 11:27:20 +01:00
Daniel Verkamp e8b22f203f [comboot] Add COMBOOT and COM32 support 2008-08-28 23:52:19 +01:00
Daniel Verkamp aa28544373 [librm] Add rm stack copying functions 2008-08-28 23:09:08 +01:00
Daniel Verkamp 2539f5fa4a [librm] Make rm_sp and rm_ss globals again 2008-08-28 22:50:55 +01:00
Daniel Verkamp 179fa70d34 [libc] Mark setjmp and longjmp as __cdecl 2008-08-28 22:50:39 +01:00
Michael Brown fc0c40a5b0 [pxe] Fill in UNDIROMID pointer in !PXE structure
IBM's iSCSI Firmware Initiator checks the UNDIROMID pointer in the
!PXE structure that gets created by the UNDI loader.  We didn't
previously fill this value in.
2008-08-28 00:11:45 +01:00
Michael Brown 32e34683c0 [romprefix] Add UNDI ROMID structure bus type field
The IBM iSCSI Firmware Initiator complains that we don't have a bus
type field in the UNDI ROMID structure, so include one.
2008-08-27 22:08:57 +01:00
Michael Brown cb6fea0690 [phantom] Fix P3 B1 silicon bug workaround
Commit f58cc3f introduced a temporary workaround for a bug in current
prototype silicon, but failed to apply it to all eight PCI functions
within the device.
2008-08-27 21:25:06 +01:00
Michael Brown bd5189a96d [util] Fix interpretation of short jumps in Option::ROM
Option::ROM was assuming that ROM images using a short jump
instruction for the init entry point would have a zero byte at offset
5; this is not necessarily true.
2008-08-27 20:36:30 +01:00
Michael Brown d5732b0272 [romprefix] Preserve %edi when issuing INT 1A,B101
INT 1A,B101 (get PCI BIOS version) will overwrite %edi.
2008-08-26 05:03:19 +01:00
Michael Brown 07581d3faa [phantom] Remove comment that no longer matches reality 2008-08-26 04:45:31 +01:00
Michael Brown de7be480d6 [romprefix] Add more diagnostic messages to ROM prefix
Include PMM allocation result in POST banner.

Include full product string in "starting execution" message.

Also mark ourselves as supporting DDIM in PnP header, for
completeness.
2008-08-25 23:36:24 +01:00
Michael Brown f58cc3fca8 [phantom] Temporary workaround for bug in prototype (P3 B1) silicon 2008-08-25 23:25:33 +01:00
Michael Brown d5e07dfe92 [romprefix] Fix regression in UNDI loader
Commit 12f203c introduced a bug that caused the UNDI loader to attempt
to load the UNDI code and data segments to incorrect addresses.
2008-08-22 23:58:46 +01:00
Michael Brown 82baea0a4b [romprefix] On a PCI3.0, non-BBS system, use the correct %cs for INT19
On a system that doesn't support BBS, we end up hooking INT19 to gain
control of the boot process.  If the system is PCI3.0, we must take
care to use the runtime value for %cs, rather than the POST-time
value, otherwise we end up pointing INT19 to the temporary option ROM
POST scratch area.
2008-08-22 03:01:46 +01:00
Michael Brown 4815188dfc [elf] Add execution entry point debug messages for elf/multiboot images 2008-08-22 02:12:44 +01:00
Michael Brown 0ffc3f6285 [pxe] Add extra debug messages to the PXE UDP API calls 2008-08-21 16:52:08 +01:00
Michael Brown 2090aade04 [pxe] Fix broadcast transmissions via PXENV_UDP_WRITE
pxenv_udp_write() needs to specify a net device, otherwise ipv4 is
unable to route broadcast transmissions.
2008-08-21 16:50:51 +01:00
Michael Brown 30fb3b3810 [undi] Fill in ProtType correctly in PXENV_UNDI_ISR
Determine the network-layer packet type and fill it in for UNDI
clients.  This is required by some NBPs such as emBoot's winBoot/i.

This change requires refactoring the link-layer portions of the
gPXE netdevice API, so that it becomes possible to strip the
link-layer header without passing the packet up the network stack.
2008-08-20 03:21:37 +01:00
Michael Brown f6f6f626f7 [undi] Work around broken UNDI polling behaviour in winBoot/i
Some dumb NBPs (e.g. emBoot's winBoot/i) never call PXENV_UNDI_ISR
with FuncFlag=PXENV_UNDI_ISR_START; they just sit in a tight polling
loop merrily violating the PXE spec with repeated calls to
PXENV_UNDI_ISR_IN_PROCESS.  Force a extra calls to netdev_poll() to
cope with these out-of-spec clients.
2008-08-20 02:02:51 +01:00
Michael Brown 0c7618771e [smbios] Print SMBIOS version number in debugging messages 2008-08-19 22:01:38 +01:00
Michael Brown 320b072c7a [pcbios] Support arbitrary splits of the e820 memory map
Allow for an arbitrary number of splits of the system memory map via
INT 15,e820.

Features of the new map-mangling algorithm include:

  Supports random access to e820 map entries.

  Requires only sequential access support from the underlying e820
  map, even if our caller uses random access.

  Empty regions will always be stripped.

  Always terminates with %ebx=0, even if the underlying map terminates
  with CF=1.

  Allows for an arbitrary number of hidden regions, with underlying
  regions split into as many subregions as necessary.

Total size increase to achieve this is 193 bytes.
2008-08-18 07:17:41 +01:00
Michael Brown 9737095d49 [pcbios] Prepare for multiple splits of hidden e820 memory regions
Define a list of N allowed memory regions, and split each underlying
e820 region into up to N subregions.  Strip resulting empty regions
out of the map, avoiding using the "return with CF set to strip last
empty region" trick, because it seems that bootmgr.exe in Win2k8 gets
upset if the memory map is terminated with CF set.

This is an intermediate checkin that defines a single allowed memory
region covering the entire 64-bit address space, and uses the existing
map-mangling code on top of the new region-splitting code.  This
sanitises the memory map to the point that Win2k8 is able to boot even
on a system that defines a final zero-length region at the 4GB mark.

I'm checking this in because it may be useful for future debugging
efforts to be able to run with the existing and known-working map
mangling code together with the map sanitisation capabilities of the
new map mangling code.
2008-08-18 01:01:45 +01:00
Michael Brown 23bca8f9d8 [util] Allow Option::ROM to understand and modify initialisation entry point
Add support for manipulating the jump instruction that forms the
option ROM initialisation entry point, so that mergerom.pl can treat
it just like other entry points.

Add support for merging the initialisation entry point (and IBM BOFM
table) to mergerom.pl; this is another slightly icky but unfortunately
necessary GPL vs. NDA workaround.  When mergerom.pl replaces an entry
point in the original ROM, it now fills in the corresponding entry
point in the merged ROM with the original value; this allows (for
example) a merged initialisation entry point to do some processing and
then jump back to the original entry point.
2008-08-15 04:10:35 +01:00
Michael Brown 8f8f5acf09 [settings] Avoid overwriting the start of .text in fetch_string_setting()
fetch_string_setting() was subtracting one from the length of the
to-be-NUL-terminated buffer in order to obtain the length of the
unterminated buffer to be passed to fetch_setting().  This works
extremely well unless the length of the to-be-NUL-terminated buffer is
zero, at which point we end up giving fetch_setting() a buffer of
length -1UL, thereby inviting it to overwrite as much memory as it
wants...
2008-08-14 03:03:53 +01:00
Michael Brown a1d0f6ed2e [dhcp] Do not restrict minimum retry time for ProxyDHCPREQUEST
The ProxyDHCPREQUEST is a unicast packet, so the first request will
almost always be lost due to not having the IP address in the ARP
cache.  If the minimum retry time is set to one second (as per commit
ff2b6a5), then ProxyDHCP will time out and give up before managing to
successfully transmit a request.

The DHCP timers need to be reworked anyway, so this mild hack is
acceptable for now.
2008-08-13 21:51:53 +01:00
Andrew Schran ff2b6a512d [retry] Added configurable timeouts to retry timer
New min_timeout and max_timeout fields in struct retry_timer allow
users of this timer to set their own desired minimum and maximum
timeouts, without being constrained to a single global minimum and
maximum. Users of the timer can still elect to use the default global
values by leaving the min_timeout and max_timeout fields as 0.
2008-08-12 01:05:26 +01:00
Michael Brown 5d4839b577 [iSCSI] Add support for mutual CHAP
Allow initiator to verify target authentication using CHAP.
2008-08-11 03:43:12 +01:00
Michael Brown 7ad2f652b4 [libc] Add missing __attribute__ (( format ( printf ) )) to ssnprintf() 2008-08-11 02:31:14 +01:00
Michael Brown 8332ddf556 [romprefix] Fix ROM image copy on PCI 3.0 BIOSes
Add the missing instructions to the code path that I never tested due
to not having a PCI 3.0 system available.

(D'oh)
2008-08-05 23:18:07 +01:00
Michael Brown f178436bb1 [pxe] If no ProxyDHCPACK exists, use DHCPACK for the fake ProxyDHCPACK packet
WinPE seems to have a bug that causes it to always use the TFTP server
IP address and filename from the ProxyDHCPACK packet, even if the
ProxyDHCPACK packet doesn't exist.  This causes it to end up
attempting to fetch a file such as

  tftp://0.0.0.0/bootmgr.exe

If we don't have a ProxyDHCPACK to use, we pretend that it was a copy
of the DHCPACK packet.  This works around the problem, and hopefully
won't surprise any NBPs.
2008-08-02 03:03:42 +01:00
Michael Brown ed73d53503 [dhcp] Work around a bug in Altiris RDP
Altiris erroneously cares about the ordering of DHCP options, and will
get confused if we don't construct them in the order it expects.

This is observed (so far) only when attempting to deploy 64-bit Win2k3.
2008-08-01 21:49:11 +01:00
Stefan Hajnoczi 50babca5da [virtio] Add legacy driver for KVM virtio-net
This patch adds support for the virtio-net adapter provided by KVM.

Written by Laurent Vivier <Laurent.Vivier@bull.net> for Etherboot.
Wrapped as legacy driver for gPXE by Stefan Hajnoczi
<stefanha@gmail.com>.
2008-08-01 16:55:49 +01:00