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

2749 Commits

Author SHA1 Message Date
Michael Brown 19a0452205 [libc] Add function declaration for main() in stdlib.h 2008-10-07 22:04:50 +01:00
Michael Brown 521549d900 [crypto] Rename <gpxe/bitops.h> to <gpxe/rotate.h> 2008-10-01 19:24:56 +01:00
Michael Brown 9dccbc0af2 [i2c] Generalise i2c bit-bashing support to addressless devices
Some devices (e.g. the Atmel AT24C11) have no concept of a device
address; they respond to every device address and use this value as
the word address.  Some other devices use part of the device address
field to extend the word address field.

Generalise the i2c bit-bashing support to handle this by defining the
device address length and word address length as properties of an i2c
device.  The word address is assumed to overflow into the device
address field if the address used exceeds the width of the word
address field.

Also add a bus reset mechanism.  i2c chips don't usually have a reset
line, so rebooting the host will not clear any bizarre state that the
chip may be in.  We reset the bus by clocking SCL until we see SDA
high, at which point we know we can generate a start condition and
have it seen by all devices.  We then generate a stop condition to
leave the bus in a known state prior to use.

Finally, add some extra debugging messages to i2c_bit.c.
2008-10-01 19:24:56 +01:00
Michael Brown 91802c6e85 [makefile] Fix -fno-stack-protector test on older versions of gcc
Some older versions of gcc don't complain about unknown compiler flags
unless you ask them to actually compile; asking them to merely
preprocess won't trigger the error.

Fix the -fno-stack-protector test by making it attempt to compile an
empty file, rather than preprocess an empty file.
2008-10-01 19:24:56 +01:00
Michael Brown afe1323c76 [compiler] Allow for selective disabling of debug levels at runtime
The usefulness of DBGLVL_IO is limited by the fact that many cards
require large numbers of uninteresting I/O reads/writes at device
probe time, typically when driving a bit-bashing I2C/SPI bus to read
the MAC address.

This patch adds the DBG_DISABLE() and DBG_ENABLE() macros, which can
be used to temporarily disable and re-enable selected debug levels.
Note that debug levels must still be enabled in the build in order to
function at all: you can't use DBG_ENABLE(DBGLVL_IO) in an object
built with DEBUG=object:1 and expect it to do anything.
2008-10-01 19:24:56 +01:00
Michael Brown 9b01a9fd9c [compiler] Add __always_inline macro 2008-10-01 19:24:56 +01:00
Marty Connor 60c3b69c31 [release] Update version to 0.9.5+ post release 2008-10-01 13:46:16 -04:00
Marty Connor 8c3e95ce42 [release] Update version to 0.9.5 for release 2008-10-01 13:38:45 -04:00
Michael Brown df02c54f86 [arbel] Fix off-by-one error in the failure path in arbel_probe() 2008-10-01 08:11:03 +01:00
Michael Brown 76f6cad8af [hermon] Fix off-by-one error in the failure path in hermon_probe() 2008-10-01 08:10:50 +01:00
H. Peter Anvin e899f100ca [makefile] Quote argument to sed containing []
[] are shell metacharacters, and they can get confused by files in the
local directory.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-09-30 21:54:41 +01:00
H. Peter Anvin e8b6077566 [makefile] Avoid using ?=
?= in a Makefile means that that variable can be overridden by the
environment.  This is confusing to users, especially with a generic
name like "ARCH".

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-09-30 21:53:34 +01:00
Michael Brown 6f87d622e1 [tg3] Add PCI ID
Reported working by Martin Kreiner <m.kreiner@levigo.de>
2008-09-29 16:00:09 +01:00
Michael Brown 1dda75c9cd [pcbios] Allow for larger-than-20-byte buffers in e820mangler.S
Although the E820 API allows for a caller to provide only a 20-byte
buffer, there exists at least one combination (HP BIOS, 32-bit WinPE)
that relies on information found only in the "extended attributes"
field, which requires a 24-byte buffer.

Allow for up to a 64-byte E820 buffer, in the hope of coping with
future idiocies like this one.
2008-09-29 05:11:51 +01:00
Michael Brown 040f7cdf3a [pcbios] Print INT 15,E820 extended attributes, if present
The ACPI specification defines an additional 4-byte field at offset 20
for an E820 memory map entry.  This field is presumably optional,
since generally E820 gets given only a 20-byte buffer to fill.
However, the bits of this optional field are defined as:

  bit 0 : region is enabled
  bit 1 : region is non-volatile memory rather than RAM

so it seems as though callers that pass in only a 20-byte buffer may
be missing out on some rather important information.
2008-09-29 03:55:13 +01:00
Michael Brown 0015601f0b [gdb] Fix a compiler warning that shows up only when assertions are enabled
gcc should (I think) be warning about this anyway, but seems to do so
only when assertions are enabled for this object.
2008-09-29 01:00:14 +01:00
Michael Brown 50dc9344b7 [pcbios] Save/restore %es in INT 15,e820
Our INT 15,e820 code was setting %es=%ss (as part of the "look ahead
in the memory map" logic), but failing to restore %es afterwards.
This is a serious bug, but wasn't affecting many platforms because
almost all callers seem to set %es=%ss anyway.
2008-09-29 00:36:11 +01:00
Michael Brown e3c5507178 [i386] Add dump_regs() debug call
Use as "call dump_regs" from any real-mode code within .text16.
Should preserve all registers and flags.
2008-09-28 23:06:53 +01:00
Michael Brown 39047c5636 [hermon] Allocate only as much memory as is needed for ICM and ICM AUX
Use individual page mappings rather than a single whole-region
mapping, to avoid the waste of memory that occurs due to the
constraint that each mapped block must be aligned on its own size.
2008-09-28 20:43:18 +01:00
Michael Brown 2d41dead08 [iscsi] Fix LUN parsing in the iSCSI root-path 2008-09-27 23:53:31 +01:00
Marty Connor 6eaefa16a8 [release] Update version post release to 0.9.4+ 2008-09-26 16:05:55 -04:00
Marty Connor 601d244a8e [release] Update version information for 0.9.4 release 2008-09-26 15:14:34 -04:00
Michael Brown 6936c40fef [settings] Allow for setting fetchers to fail in fetchf_hex() 2008-09-26 03:39:35 +01:00
Michael Brown e2d5788716 [settings] Expose MAC address setting for general use 2008-09-26 03:39:17 +01:00
Michael Brown 9d72636da1 [romprefix] Fully clear the "Press B to boot..." message when INT19 is used 2008-09-26 01:36:22 +01:00
Michael Brown 3392cfa7df [pcbios] Fetch INT 15,e820 entry directly into our e820 cache
Some BIOSes require us to pass in not only the continuation value (in
%ebx) as returned by the previous call to INT 15,e820 but also the
unmodified buffer (at %es:%di) as returned by the previous call to INT
15,e820.  Apparently, someone thought it would be a worthwhile
optimisation to fill in only the low dword of the "length" field and
the low byte of the "type field", assuming that the buffer would
remain unaltered from the previous call.

This problem was being triggered by the "peek ahead" logic in
get_mangled_e820(), which would read the next entry into a temporary
buffer in order to be able to guarantee terminating the map with
%ebx=0 rather than CF=1.  (Terminating with CF=1 upsets some Windows
flavours, despite being documented legal behaviour.)

Work around this problem by always fetching directly into our e820
cache; that way we can guarantee that the underlying call always sees
the previous buffer contents (and the same buffer address).
2008-09-25 18:52:49 +01:00
Michael Brown fa880ec70a [arbel] Allocate sufficient space for firmware buffer
We were accidentally allocating only half the required amount of
memory (given the alignment method) for the firmware buffer, leading
to conflicts between the firmware buffer and gPXE code/data segments.
2008-09-25 07:23:34 +01:00
Michael Brown b45b39260c [hermon] Allocate sufficient space for firmware buffer
We were accidentally allocating only half the required amount of
memory (given the alignment method) for the firmware buffer, leading
to conflicts between the firmware buffer and gPXE code/data segments.
2008-09-25 07:22:06 +01:00
Michael Brown c24bc349ea [pcbios] Add facility for testing arbitrary E820 memory maps
We seem to be having issues with various E820 memory maps.  These
problems are often difficult to reproduce, requiring access to the
specific system exhibiting the problem.

Add a facility for hooking in a fake E820 map generator, using an
arbitrary map defined in a C array, solely in order to be able to test
the map-mangling code against arbitrary E820 maps.
2008-09-25 03:34:26 +01:00
Michael Brown 9c71949d1f [crypto] Remove spurious #include "config.h" 2008-09-25 01:55:48 +01:00
Michael Brown 539f94b980 [romprefix] Allow BANNER_TIMEOUT to control banners in romprefix.S
In particular, allow BANNER_TIMEOUT=0 to inhibit the prompt banners
altogether.

Ironically, this request comes from the same OEM that originally
required the prompts to be present during POST.
2008-09-25 01:53:42 +01:00
Michael Brown aa8d972581 [dhcp] Accept BOOTP as well as DHCP 2008-09-25 01:35:15 +01:00
Michael Brown fed106b7fb [pxe] Enable interrupts before starting PXE NBP execution
Based on a patch provided by XenSource for Etherboot 5.4.
2008-09-24 21:23:50 +01:00
Michael Brown 887d77c27a [pcbios] Inhibit INT 15 memory map hiding on brain-dead BIOSes
Some really moronic BIOSes bring up the PXE stack via the UNDI loader
entry point during POST, and then don't bother to unload it before
overwriting the code and data segments.  If this happens, we really
don't want to leave INT 15 hooked, because that will cause any loaded
OS to die horribly as soon as it attempts to fetch the system memory
map.

We use a heuristic to detect whether or not we are being loaded at the
top of free base memory.  If we determine that we are being loaded at
some other arbitrary location in base memory, then we assume that it's
not safe to hook INT 15.
2008-09-24 18:33:31 +01:00
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