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

876 Commits

Author SHA1 Message Date
Michael Brown 82ecaaac91 [console] Remove "log message" usage from interactive console defaults
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-27 00:51:50 +01:00
Michael Brown 2834f9f6de [umalloc] Unhide umalloc()ed memory region when there are no allocations
At present, we always hide an extra sizeof(struct external_memory), to
account for the header on the lowest allocated block.  This header
ceases to exist when there are no allocated blocks remaining.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-27 00:31:01 +01:00
Michael Brown 920799a0ba [umalloc] Fail allocations when we run out of external memory
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-27 00:30:54 +01:00
Michael Brown c2875ae329 [console] Do not share ANSI escape context between lineconsole users
An ANSI escape sequence context cannot be shared between multiple
users.  Make the ANSI escape sequence context part of the line console
definition and provide individual contexts for each user.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-26 21:58:50 +01:00
Michael Brown 64d17dbd50 [console] Exclude text-based UI output from logfile-based consoles
The output from text-based user interfaces such as the "config"
command is not generally meaningful for logfile-based consoles such as
syslog and vmconsole.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-26 19:02:30 +01:00
Michael Brown e024cd39a8 [console] Allow usage to be defined independently for each console
Add the concept of a "console usage", such as "standard output" or
"debug messages".  Allow usages to be associated with each console
independently.  For example, to send debugging output via the serial
port, while preventing it from appearing on the local console:

  #define CONSOLE_SERIAL CONSOLE_USAGE_ALL
  #define CONSOLE_PCBIOS ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_DEBUG )

If no usages are explicitly specified, then a default set of usages
will be applied.  For example:

  #define CONSOLE_SERIAL

will have the same affect as

  #define CONSOLE_SERIAL CONSOLE_USAGE_ALL

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-26 17:40:01 +01:00
Michael Brown 1c127a6962 [image] Simplify image management commands and internal API
Remove the name, cmdline, and action parameters from imgdownload() and
imgdownload_string().  These functions now simply download and return
an image.

Add the function imgacquire(), which will interpret a "name or URI
string" parameter and return either an existing image or a newly
downloaded image.

Use imgacquire() to merge similar image-management commands that
currently differ only by whether they take the name of an existing
image or the URI of a new image to download.  For example, "chain" and
"imgexec" can now be merged.

Extend imgstat and imgfree commands to take an optional list of
images.

Remove the arbitrary restriction on the length of image names.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-24 23:12:04 +00:00
Michael Brown 4766b1455f [build] Fix compilation under Cygwin
Originally-fixed-by: Steve Goodrich <steve.goodrich@se-eng.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-22 23:52:24 +00:00
Michael Brown efb0c7fce4 [bios] Set character attributes only when necessary
There is no INT 10 call for "display character with attribute,
advancing the cursor and scrolling the screen as necessary".  We
therefore make two INT 10 calls: INT 10,09 to write the character with
its attribute at the current cursor position, and then INT 10,0e to
(re)write the character (leaving the attribute unchanged), advance the
cursor position and scroll as necessary.

This confuses the serial-over-LAN console redirection feature provided
by some BIOSes.

Fix by performing the INT10,09 only when necessary to change the
existing attribute.

Reported-by: Itay Gazit <itaygazit@gmail.com>
Tested-by: Itay Gazit <itaygazit@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-22 12:30:47 +00:00
Michael Brown 12002d6955 [time] Add RTC-based time source
Add a time source using the CMOS RTC to obtain the current time.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-19 22:13:32 +00:00
Michael Brown 846bde90e6 [time] Define an API for getting the current time
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-19 22:13:27 +00:00
Michael Brown 196f0bb081 [rng] Allow entropy_enable() to return an error
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-18 17:05:37 +00:00
Michael Brown b4bb39909e [prefix] Eliminate uninitialised variable
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-09 17:09:26 +00:00
Michael Brown 732bea2f88 [i386] Use memory address constraints in __bswap_16s() and __bswap_64s()
Minimise code size by forcing the use of memory addresses for
__bswap_16s() and __bswap_64s().  (__bswap_32s() cannot avoid loading the
value into a register.)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-04 21:41:24 +00:00
Michael Brown e187de7239 [i386] Fix building on older versions of gcc
Fix a strict-aliasing error on certain versions of gcc.

Reported-by: Marko Myllynen <myllynen@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-04 21:34:46 +00:00
Michael Brown af96c4151c [i386] Optimise byte-swapping functions and provide __bswap_{16,32,64}s()
Use the "bswap" instruction to shrink the size of byte-swapping code,
and provide the in-place variants __bswap_{16,32,64}s.

"bswap" is available only on 486 and later processors.  (We already
assume the presence of "cpuid" and "rdtsc", which are available only
on Pentium and later processors.)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-04 15:14:47 +00:00
Michael Brown 6324bd9389 [undi] Allow underlying PXE stack to construct link-layer header
Some PXE stacks (observed with a QLogic 8242) will always try to
prepend a link-layer header, even if the caller uses P_UNKNOWN to
indicate that the link-layer header has already been filled in.  This
results in an invalid packet being transmitted.

Work around these faulty PXE stacks where possible by stripping the
existing link-layer header and allowing the PXE stack to (re)construct
the link-layer header itself.

Originally-fixed-by: Buck Huppmann <buckh@pobox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-02 18:02:03 +00:00
Michael Brown cd29df5c08 [vmware] Fix length returned by guestrpc_command()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-01 14:20:32 +00:00
Michael Brown fa538bdbc6 [vmware] Add VMware logfile console (CONSOLE_VMWARE)
Allow iPXE console output to be sent to the VMware logfile via the
GuestRPC mechanism.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-28 23:10:02 +00:00
Michael Brown 3a5823a126 [vmware] Add GuestRPC mechanism
Use the VMware backdoor I/O port to access the GuestRPC mechanism.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-28 23:10:02 +00:00
Michael Brown 05719804b9 [rng] Add RTC-based entropy source
The RTC-based entropy source uses the nanosecond-scale CPU TSC to
measure the time between two 1kHz interrupts generated by the CMOS
RTC.  In a physical machine these clocks are driven from independent
crystals, resulting in some observable clock drift.  In a virtual
machine, the CMOS RTC is typically emulated using host-OS
constructions such as SIGALRM.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-28 11:18:48 +00:00
Michael Brown 073f41085f [rng] Add ANS X9.82 Approved Source of Entropy Input
ANS X9.82 specifies several Approved Sources of Entropy Input (SEI).
One such SEI uses an entropy source as the Source of Entropy Input,
condensing each entropy source output after each GetEntropy call.
This can be implemented relatively cheaply in iPXE and avoids the need
to allocate potentially very large buffers.

(Note that the terms "entropy source" and "Source of Entropy Input"
are not synonyms within the context of ANS X9.82.)

Use the iPXE API mechanism to allow entropy sources to be selected at
compilation time.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-21 12:42:38 +00:00
Michael Brown 464ca5dbc0 [i386] Add missing #include <ipxe/io.h> in pic8259.h
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-19 22:09:13 +00:00
Till Straumann d3630b6a64 [prefix] Fix missing underscore in libprefix
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-10 14:12:04 +00:00
Michael Brown 3a4253868c [prefix] Delay initrd image copy until memory map is ready
initrd_init() calls umalloc() to allocate space for the initrd image,
but does so before hide_etherboot() has been called.  It is therefore
possible for the initrd to end up overwriting iPXE itself.

Fix by converting initrd_init() from an init_fn to a startup_fn.

Originally-fixed-by: Till Straumann <strauman@slac.stanford.edu>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-02-09 16:49:30 +00:00
Michael Brown f5bbe7ec4a [lkrnprefix] Copy command line before installing iPXE
The command line may be situated in an area of base memory that will
be overwritten by iPXE's real-mode segments, causing the command line
to be corrupted before it can be used.

Fix by creating a copy of the command line on the prefix stack (below
0x7c00) before installing the real-mode segments.

Reported-by: Dave Hansen <dave@sr71.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-01-18 00:02:16 +00:00
Michael Brown 9a93db3f09 [pxe] Provide PXENV_FILE_EXIT_HOOK only for ipxelinux.0 builds
PXENV_FILE_EXIT_HOOK is designed to allow ipxelinux.0 to unload both
the iPXE and pxelinux components without affecting the underlying PXE
stack.  Unfortunately, it causes unexpected behaviour in other
situations, such as when loading a non-embedded pxelinux.0 via
undionly.kpxe.  For example:

  PXE ROM -> undionly.kpxe -> pxelinux.0 -> chain.c32 to boot hd0

would cause control to return to iPXE instead of booting from the hard
disk.  In some cases, this would result in a harmless but confusing
"No more network devices" message; in other cases stranger things
would happen, such as being returned to the iPXE shell prompt.

The fundamental problem is that when pxelinux detects
PXENV_FILE_EXIT_HOOK, it may attempt to specify an exit hook and then
exit back to iPXE, assuming that iPXE will in turn exit cleanly via
the specified exit hook.  This is not a valid assumption in the
general case, since the action of exiting back to iPXE does not
directly cause iPXE to exit itself.  (In the specific case of
ipxelinux.0, this will work since the embedded script exits as soon as
pxelinux.0 exits.)

Fix the unexpected behaviour in the non-ipxelinux.0 cases by including
support for PXENV_FILE_EXIT_HOOK only when using a new .kkkpxe format.
The ipxelinux.0 build process should therefore now use undionly.kkkpxe
instead of undionly.kkpxe.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-12-11 02:28:04 +00:00
Michael Brown fa410e0a41 [pxe] Modularise PXE API provision
Use the linker table infrastructure to dispatch PXE API calls to the
relevant function.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-12-11 02:27:58 +00:00
Michael Brown 61944ed602 [pxe] Tidy up debugging output
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-12-08 02:56:46 +00:00
Michael Brown faf50e8fa3 [pxe] Check for a valid PXE network device when applicable
Very nasty things can happen if a NULL network device is used.  Check
that pxe_netdev is non-NULL at the applicable entry points, so that
this type of problem gets reported to the caller rather than being
allowed to crash the system.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-12-08 02:35:23 +00:00
Michael Brown fa3ca017ac [undi] Retry PXENV_UNDI_INITIALIZE multiple times
On at least one PXE stack (Realtek r8169), PXENV_UNDI_INITIALIZE has
been observed to fail intermittently due to a media test failure (PXE
error 0x00000061).  Retrying the call to PXENV_UNDI_INITIALIZE
succeeds, and the NIC is then usable.

It is worth noting that this particular Realtek PXE stack is already
known to be unreliable: for example, it repeatably fails its own
boot-time media test after every warm reboot.

Fix by attempting PXENV_UNDI_INITIALIZE multiple times, with a short
delay between each attempt to allow the link to settle.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-12-08 00:12:28 +00:00
Michael Brown caf98cf624 [pxe] Improve pxe_preboot debugging messages
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-14 13:13:45 +00:00
Michael Brown 524349c559 [pxe] Improve pxe_undi debugging messages
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-14 12:48:15 +00:00
Michael Brown 27fdb95572 [prefix] Allow an initrd to be passed to iPXE
Allow an initrd (such as an embedded script) to be passed to iPXE when
loaded as a .lkrn (or .iso) image.  This allows an embedded script to
be varied without recompiling iPXE.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-12 00:34:55 +00:00
Michael Brown 24226472b2 [prefix] Allow prefix to specify an arbitrary maximum address for relocation
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-11 23:20:52 +00:00
Michael Brown 6c5f1a342b [prefix] Use stack rather than %ebp as temporary storage area
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-11 22:24:00 +00:00
Michael Brown a05b89ef45 [undi] Ensure that native drivers are tried before the UNDI PCI driver
Suggested-by: Alessandro Salvatori <sandr8@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-11 21:32:09 +00:00
Michael Brown a1f618c625 [undi] Use meaningful driver and device names
Specify a driver name of "undionly" and a device name based on the
UNDI-reported underlying hardware device.  For example:

  net0: 52:54:00:12:34:56 using undionly on UNDI-PCI00:03.0 (open)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-28 22:52:55 +01:00
Michael Brown a05a3613a5 [undi] Use current (rather than permanent) link-layer address
Requested-by: Savitha Hiriyannaia <Savitha.Hiriyannaiah@emulex.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-28 22:41:15 +01:00
Michael Brown c77aece36a [liba20] Preserve all non-segment registers when calling INT 15,2401
Some BIOSes are reported to corrupt %ebx when using INT 15,2401 (see
http://opensolaris.org/jive/thread.jspa?messageID=377026).  Guard
against this by preserving all (non-segment) registers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-25 16:05:02 +01:00
Michael Brown 4d8a009ccf [librm] Avoid (harmless) collisions with linker symbols
The symbol_text16 is defined globally by the linker.  Use rm_text16
instead of _text16 for the local variable within librm.S to avoid
confusion when reading linker maps.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-25 16:05:02 +01:00
Michael Brown 790035f78d [image] Eliminate the register_and_xxx_image() functions
All users of imgdownload() require registration of the image, so make
registration an integral part of imgdownload() itself and simplify the
"action" parameter to be one of image_select(), image_exec() et al.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-10-25 01:41:41 +01:00
Valentine Barshak 8a86a848dc [lkrnprefix] Fix lost command line passed by grub
iPXE specifies a value of 0 for cmdline_size, causing GRUB to not pass
in a command line.  Fix by setting cmdline_size to the maximum value
of 2047.

Signed-off-by: Valentine Barshak <gvaxon@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-08-06 23:03:40 +01:00
Valentine Barshak 24b62e0e1e [romprefix] Fix romprefix build with certain versions of binutils
Signed-off-by: Valentine Barshak <gvaxon@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-08-06 23:00:39 +01:00
Michael Brown a667bf044a [netdevice] Allow link layer to report broadcast/multicast packets via pull()
Allow the link layer to directly report whether or not a packet is
multicast or broadcast at the time of calling pull(), rather than
relying on heuristics to determine this at a later stage.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-07-15 18:48:46 +01:00
Michael Brown 9cf2f9dc2b [dhcp] Add symbolic definitions for DHCP client architecture values
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-07-06 15:26:43 +01:00
Michael Brown 69f5b2e8dc [int13] Provide a permanently closed window via the control interface
Allow objects to support both streaming and block device protocols, by
starting streaming data only when the data transfer window opens.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-06-28 14:45:13 +01:00
Michael Brown be600ed996 [prefix] Cope with BOOT_IMAGE= anywhere within command line
Some bootloaders seem to add "BOOT_IMAGE=..." at the end of the
command line; some at the start.  Cope with either variation.

Reported-by: Dave Hansen <dave@sr71.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-06-28 11:33:39 +01:00
Michael Brown d4f0c5d088 [romprefix] Force PnP header to a 16-byte boundary for IBM BIOSes
IBM BIOSes ignore the PnP header offset stored at address 0x1a and
instead scan for the $PnP signature on a 16-byte boundary.  (This
alignment is not mandated by the PnP specification.)

Force PnP header to a 16-byte boundary to work around these BIOSes.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-05-17 22:48:52 +01:00
Michael Brown fcd55f7500 [romprefix] Do not fall back to hooking INT19 by default
Several BIOSes (including most IBM BIOSes and many virtual machine
BIOSes) do not provide detectable PnP support, but will use the BEV
entry point for a PnP option ROM.  On these semi-PnP BIOSes, iPXE will
respond to the absence of detectable PnP support by hooking INT19,
which disrupts the boot order.

BIOSes that genuinely require hooking INT19 seem to be very rare
nowadays.  It may therefore be preferable to assume that the absence
of detectable PnP support indicates a semi-PnP BIOS rather than a
non-PnP BIOS.

Change the default behaviour so that INT19 will never be hooked unless
the compile-time option NONPNP_HOOK_INT19 is enabled.  Leave the
redundant PnP detection routine in-place to allow for debugging via
the ROM banner line.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-05-17 15:35:23 +01:00