]> git.ipfire.org Git - thirdparty/ipxe.git/log
thirdparty/ipxe.git
11 years ago[librm] Speed up real-to-protected mode transition under KVM
Michael Brown [Fri, 2 May 2014 12:18:55 +0000 (13:18 +0100)] 
[librm] Speed up real-to-protected mode transition under KVM

Ensure that all segment registers have zero in the low two bits before
transitioning to protected mode.  This allows the CPU state to
immediately be deemed to be "valid", and eliminates the need for any
further emulated instructions.

Load the protected-mode interrupt descriptor table after switching to
protected mode, since this avoids triggering an EXCEPTION_NMI and
corresponding VM exit.

This reduces the time taken by real_to_prot under KVM by around 50%.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[librm] Speed up protected-to-real mode transition under KVM
Michael Brown [Thu, 1 May 2014 13:58:24 +0000 (14:58 +0100)] 
[librm] Speed up protected-to-real mode transition under KVM

On an Intel CPU supporting VMX, KVM will emulate instructions while
the CPU state remains "invalid".  In real mode, the CPU state is
defined to be "invalid" if any segment register has a base which is
not equal to (sreg<<4) or a limit which is not equal to 64kB.

We don't actually use the base stored in the REAL_DS descriptor for
any significant purpose.  Change the base stored in this descriptor to
be equal to (REAL_DS<<4).  A segment register loaded with REAL_DS is
then automatically valid in both real and protected modes.  This
allows KVM to stop emulating instructions much sooner.

The only use of REAL_DS for memory accesses currently occurs in the
indirect ljmp within prot_to_real.  Change this to a direct ljmp,
storing rm_cs in .text16 as part of the ljmp instruction.  This
removes the only memory access via REAL_DS (thereby allowing for the
above descriptor base address hack), and also simplifies the ljmp
instruction (which will still have to be emulated).

Load the real-mode interrupt descriptor table register before
switching to real mode, since this avoids triggering an EXCEPTION_NMI
and corresponding VM exit.

This reduces the time taken by prot_to_real under KVM by around 65%.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[librm] Add meaningful labels at section changes
Michael Brown [Wed, 30 Apr 2014 17:03:10 +0000 (18:03 +0100)] 
[librm] Add meaningful labels at section changes

The mode-transition code involves paths which switch back and forth
between the .text and .text16 sections.  At present, only the start of
each function is labelled, which makes it difficult to decode
addresses within the parts of the function existing in a different
section.

Add explicit labels at the start of each section change, so that
addresses can be meaningfully decoded to the nearest label.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[librm] Add a profiling self-test for measuring mode transition times
Michael Brown [Fri, 2 May 2014 14:20:56 +0000 (15:20 +0100)] 
[librm] Add a profiling self-test for measuring mode transition times

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[test] Print out profiling statistics after a successful test run
Michael Brown [Fri, 2 May 2014 14:20:12 +0000 (15:20 +0100)] 
[test] Print out profiling statistics after a successful test run

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[pcbios] Do not switch to real mode to sleep the CPU
Michael Brown [Tue, 29 Apr 2014 17:17:17 +0000 (18:17 +0100)] 
[pcbios] Do not switch to real mode to sleep the CPU

Now that we can handle interrupts while in protected mode, there is no
need to switch to real mode just to halt the CPU.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[pcbios] Do not switch to real mode to check for timer interrupt
Michael Brown [Mon, 28 Apr 2014 19:20:44 +0000 (20:20 +0100)] 
[pcbios] Do not switch to real mode to check for timer interrupt

The currticks() function is called at least once per TCP packet, and
so is performance-critical.  Switching to real mode just to allow the
timer interrupt to fire is expensive when running inside a virtual
machine, and imposes a significant performance cost.

Fix by enabling interrupts without switching to real mode.  This
results in an approximately 100% increase in download speed when
running under KVM.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[comboot] Use built-in interrupt reflector
Michael Brown [Mon, 28 Apr 2014 20:11:04 +0000 (21:11 +0100)] 
[comboot] Use built-in interrupt reflector

We now have the ability to handle interrupts while in protected mode,
and so no longer need to set up a dedicated interrupt descriptor table
while running COM32 executables.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[librm] Allow interrupts in protected mode
Michael Brown [Mon, 28 Apr 2014 19:17:15 +0000 (20:17 +0100)] 
[librm] Allow interrupts in protected mode

When running in a virtual machine, switching to real mode may be
expensive.  Allow interrupts to be enabled while in protected mode and
reflected down to the real-mode interrupt handlers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[build] Allow for a debug level of zero
Michael Brown [Mon, 28 Apr 2014 13:43:19 +0000 (14:43 +0100)] 
[build] Allow for a debug level of zero

Allow for an explicit debug level of zero, which will enable
assertions and profiling (i.e. anything controlled by NDEBUG) without
generating any debug messages.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[downloader] Profile receive datapath
Michael Brown [Mon, 28 Apr 2014 11:31:39 +0000 (12:31 +0100)] 
[downloader] Profile receive datapath

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[http] Profile receive datapath
Michael Brown [Mon, 28 Apr 2014 11:31:23 +0000 (12:31 +0100)] 
[http] Profile receive datapath

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[tcp] Profile transmit and receive datapaths
Michael Brown [Mon, 28 Apr 2014 11:30:57 +0000 (12:30 +0100)] 
[tcp] Profile transmit and receive datapaths

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[ipv4] Profile transmit and receive datapaths
Michael Brown [Mon, 28 Apr 2014 11:30:09 +0000 (12:30 +0100)] 
[ipv4] Profile transmit and receive datapaths

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[librm] Use genuine real mode to accelerate operation in virtual machines
Michael Brown [Mon, 28 Apr 2014 00:21:08 +0000 (01:21 +0100)] 
[librm] Use genuine real mode to accelerate operation in virtual machines

We currently use flat real mode wherever real mode is required.  This
guarantees that we will not surprise some unsuspecting external caller
which has carefully set up flat real mode by suddenly reducing the
segment limits to 64kB.

However, operating in flat real mode imposes a severe performance
penalty in some virtualisation environments, since some CPUs cannot
fully virtualise flat real mode and so the hypervisor must fall back
to emulation.  In particular, operating under KVM on a pre-Westmere
Intel CPU will be at least an order of magnitude slower, to the point
that there is a visible teletype effect when printing anything to the
BIOS console.  (Older versions of KVM used to cheat and ignore the
"flat" part of flat real mode, which masked the problem.)

Switch (back) to using genuine real mode with 64kB segment limits
instead of flat real mode.  Hopefully this won't break anything.

Add an explicit switch to flat real mode before returning to the BIOS
from the ROM prefix, since we know that a PMM BIOS will call the ROM
initialisation point (and potentially the BEV) in flat real mode.

As noted in previous commit messages, it is not possible to restore
the real-mode segment limits after a transition to protected mode,
since there is no way to know which protected-mode segment descriptor
was originally used to initialise the limit portion of the segment
register.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[intel] Push new RX descriptors in batches
Michael Brown [Sun, 27 Apr 2014 21:35:48 +0000 (22:35 +0100)] 
[intel] Push new RX descriptors in batches

Inside a virtual machine, writing the RX ring tail pointer may incur a
substantial overhead of processing inside the hypervisor.  Minimise
this overhead by writing the tail pointer once per batch of
descriptors, rather than once per descriptor.

Profiling under qemu-kvm (version 1.6.2) shows that this reduces the
amount of time taken to refill the RX descriptor ring by around 90%.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[intel] Profile common virtual machine operations
Michael Brown [Sun, 27 Apr 2014 20:51:26 +0000 (21:51 +0100)] 
[intel] Profile common virtual machine operations

Operations which are negligible on physical hardware (such as issuing
a posted write to the transmit ring tail register) may involve
substantial amounts of processing within the hypervisor if running in
a virtual machine.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[netdevice] Profile common operations
Michael Brown [Sun, 27 Apr 2014 20:51:03 +0000 (21:51 +0100)] 
[netdevice] Profile common operations

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[cmdline] Add "profstat" command to display profiling statistics
Michael Brown [Sun, 27 Apr 2014 18:31:25 +0000 (19:31 +0100)] 
[cmdline] Add "profstat" command to display profiling statistics

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[profile] Add generic profiling infrastructure
Michael Brown [Wed, 23 Apr 2014 16:43:18 +0000 (17:43 +0100)] 
[profile] Add generic profiling infrastructure

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[libc] Add flsll()
Michael Brown [Sun, 27 Apr 2014 15:11:44 +0000 (16:11 +0100)] 
[libc] Add flsll()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[libc] Add isqrt() function to find integer square roots
Michael Brown [Sat, 26 Apr 2014 17:19:49 +0000 (18:19 +0100)] 
[libc] Add isqrt() function to find integer square roots

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[test] Check for correct -mrtd assumption on libgcc arithmetic functions
Michael Brown [Sat, 26 Apr 2014 15:00:26 +0000 (16:00 +0100)] 
[test] Check for correct -mrtd assumption on libgcc arithmetic functions

As observed in commit 082cedb ("[build] Fix __libgcc attribute for
recent gcc versions"), recent versions of gcc have changed the
semantics of -mrtd as applied to the implicit arithmetic functions.

It is possible for tests to succeed even if our assumptions about
gcc's interpretation of -mrtd are incorrect.  In particular, if gcc
chooses to utilise a frame pointer in the calling function, then it
can tolerate a temporarily incorrect stack pointer (since the stack
pointer will shortly afterwards be restored from the frame pointer
anyway).

Add tests designed specifically to check that our implementations of
the implicit arithmetic functions manipulate the stack pointer as
expected by gcc.

The effect of these tests can be observed by temporarily reverting
commit 082cedb ("[build] Fix __libgcc attribute for recent gcc
versions"): without this fix in place, the tests will fail on gcc 4.7
and later.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[build] Fix __libgcc attribute for recent gcc versions
Michael Brown [Fri, 25 Apr 2014 14:55:36 +0000 (15:55 +0100)] 
[build] Fix __libgcc attribute for recent gcc versions

We observed some time ago (in commit 4ce8d61 "Import various libgcc
functions from syslinux") that gcc seems to treat calls to the
implicit arithmetic functions (e.g. __udivdi3()) as being affected by
-mregparm but unaffected by -mrtd.

This seems to be no longer the case with current gcc versions, which
treat calls to these functions as being affected by both -mregparm and
-mrtd, as expected.

There is nothing obvious in the gcc changelogs to indicate precisely
when this happened.  From experimentation with available gcc versions,
the change occurred sometime between v4.6.3 and v4.7.2.  We assume
that only versions up to v4.6.x require the special treatment.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[test] Add tests for 64-bit division
Michael Brown [Thu, 24 Apr 2014 23:04:25 +0000 (00:04 +0100)] 
[test] Add tests for 64-bit division

On a 32-bit system, 64-bit division is implemented using the libgcc
functions provided in __udivmoddi4.c etc.  Calls to these functions
are generated automatically by gcc, with a calling convention that is
somewhat empirical in nature.  Add these self-tests primarily as a
check that we are using the correct calling convention.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[libc] Add inline assembly implementation of flsl() using BSR instruction
Michael Brown [Thu, 24 Apr 2014 13:49:08 +0000 (14:49 +0100)] 
[libc] Add inline assembly implementation of flsl() using BSR instruction

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[test] Add self-tests for flsl()
Michael Brown [Thu, 24 Apr 2014 12:38:53 +0000 (13:38 +0100)] 
[test] Add self-tests for flsl()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[test] Rewrite TCP/IP tests using okx()
Michael Brown [Wed, 23 Apr 2014 16:21:06 +0000 (17:21 +0100)] 
[test] Rewrite TCP/IP tests using okx()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[serial] Enable UART FIFOs
Peter Pickford [Tue, 22 Apr 2014 12:45:42 +0000 (13:45 +0100)] 
[serial] Enable UART FIFOs

Escape sequences received via the serial console can fail since the
cpu_nap() in getchar_timeout() can delay processing for more than the
time it takes for a single character to arrive.

Fix by enabling the UART FIFOs.

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[intel] Avoid completely filling the TX descriptor ring
Michael Brown [Tue, 22 Apr 2014 12:12:54 +0000 (13:12 +0100)] 
[intel] Avoid completely filling the TX descriptor ring

It is unclear from the datasheets whether or not the TX ring can be
completely filled (i.e. whether writing the tail value as equal to the
current head value will cause the ring to be treated as completely
full or completely empty).  It is very plausible that this edge case
could differ in behaviour between real hardware and the many
implementations of an emulated Intel NIC found in various virtual
machines.  Err on the side of caution and always leave at least one
ring entry empty.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[crypto] Allow wildcard matches on commonName as well as subjectAltName
Michael Brown [Tue, 1 Apr 2014 10:36:11 +0000 (11:36 +0100)] 
[crypto] Allow wildcard matches on commonName as well as subjectAltName

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[crypto] Add support for subjectAltName and wildcard certificates
Michael Brown [Mon, 31 Mar 2014 00:11:06 +0000 (01:11 +0100)] 
[crypto] Add support for subjectAltName and wildcard certificates

Originally-implemented-by: Alex Chernyakhovsky <achernya@google.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[test] Add subject alternative names to X.509 server test certificate
Michael Brown [Mon, 31 Mar 2014 12:32:26 +0000 (13:32 +0100)] 
[test] Add subject alternative names to X.509 server test certificate

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[test] Add tests for x509_check_name()
Michael Brown [Mon, 31 Mar 2014 12:15:42 +0000 (13:15 +0100)] 
[test] Add tests for x509_check_name()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[test] Rewrite CMS tests using okx()
Michael Brown [Mon, 31 Mar 2014 12:06:07 +0000 (13:06 +0100)] 
[test] Rewrite CMS tests using okx()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[test] Rewrite X.509 tests using okx()
Michael Brown [Mon, 31 Mar 2014 12:00:54 +0000 (13:00 +0100)] 
[test] Rewrite X.509 tests using okx()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[crypto] Allow signed timestamp error margin to be configured at build time
Michael Brown [Sun, 30 Mar 2014 19:07:14 +0000 (20:07 +0100)] 
[crypto] Allow signed timestamp error margin to be configured at build time

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[crypto] Use fingerprint when no common name is available for debug messages
Michael Brown [Fri, 28 Mar 2014 18:42:41 +0000 (18:42 +0000)] 
[crypto] Use fingerprint when no common name is available for debug messages

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[crypto] Generalise X.509 cache to a full certificate store
Michael Brown [Fri, 28 Mar 2014 15:45:10 +0000 (15:45 +0000)] 
[crypto] Generalise X.509 cache to a full certificate store

Expand the concept of the X.509 cache to provide the functionality of
a certificate store.  Certificates in the store will be automatically
used to complete certificate chains where applicable.

The certificate store may be prepopulated at build time using the
CERT=... build command line option.  For example:

  make bin/ipxe.usb CERT=mycert1.crt,mycert2.crt

Certificates within the certificate store are not implicitly trusted;
the trust list is specified using TRUST=... as before.  For example:

  make bin/ipxe.usb CERT=root.crt TRUST=root.crt

This can be used to embed the full trusted root certificate within the
iPXE binary, which is potentially useful in an HTTPS-only environment
in which there is no HTTP server from which to automatically download
cross-signed certificates or other certificate chain fragments.

This usage of CERT= extends the existing use of CERT= to specify the
client certificate.  The client certificate is now identified
automatically by checking for a match against the private key.  For
example:

  make bin/ipxe.usb CERT=root.crt,client.crt TRUST=root.crt KEY=client.key

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[crypto] Add pubkey_match() to check for matching public/private key pairs
Michael Brown [Wed, 26 Mar 2014 23:12:56 +0000 (23:12 +0000)] 
[crypto] Add pubkey_match() to check for matching public/private key pairs

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[build] Add dependency of generated files upon Makefile
Michael Brown [Wed, 26 Mar 2014 21:36:41 +0000 (21:36 +0000)] 
[build] Add dependency of generated files upon Makefile

Ensure that any generated files (such as DER forms of X.509
certificates) are rebuilt if the Makefile changes.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[build] Disable ccache for all relevant build targets
Michael Brown [Wed, 26 Mar 2014 21:27:55 +0000 (21:27 +0000)] 
[build] Disable ccache for all relevant build targets

The build process currently attempts to disable ccache for files using
the .incbin directive, but the rule fails to apply to anything beyond
the simple object target.  Fix by applying to all relevant build
targets (including debug objects, assembly listings, and so on).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[build] Remove long-obsolete mechanism for wrapping embedded images
Michael Brown [Wed, 26 Mar 2014 21:26:17 +0000 (21:26 +0000)] 
[build] Remove long-obsolete mechanism for wrapping embedded images

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[crypto] Remove dynamically-allocated storage for certificate OCSP URI
Michael Brown [Tue, 25 Mar 2014 16:09:16 +0000 (16:09 +0000)] 
[crypto] Remove dynamically-allocated storage for certificate OCSP URI

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[crypto] Remove dynamically-allocated storage for certificate name
Michael Brown [Tue, 25 Mar 2014 15:01:32 +0000 (15:01 +0000)] 
[crypto] Remove dynamically-allocated storage for certificate name

iPXE currently allocates a copy the certificate's common name as a
string.  This string is used by the TLS and CMS code to check
certificate names against an expected name, and also appears in
debugging messages.

Provide a function x509_check_name() to centralise certificate name
checking (in preparation for adding subjectAlternativeName support),
and a function x509_name() to provide a name to be used in debugging
messages, and remove the dynamically allocated string.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[ocsp] Handle OCSP responses that don't provide certificates
Alexander Chernyakhovsky [Tue, 15 Oct 2013 20:03:11 +0000 (16:03 -0400)] 
[ocsp] Handle OCSP responses that don't provide certificates

Certificate authorities are not required to send the certificate used
to sign the OCSP response if the response is signed by the original
issuer.

Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[http] Accept Content-Length header with trailing whitespace
Michael Brown [Tue, 25 Mar 2014 15:42:46 +0000 (15:42 +0000)] 
[http] Accept Content-Length header with trailing whitespace

At least one HTTP server (Google's OCSP responder) has been observed
to generate a Content-Length header with trailing whitespace.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[bios] Fix screen clearing on even more buggy BIOSes
Michael Brown [Fri, 21 Mar 2014 11:07:29 +0000 (11:07 +0000)] 
[bios] Fix screen clearing on even more buggy BIOSes

Some BIOSes (observed with a ProLiant DL360p Gen8 SE) perform no range
checking whatsoever on the parameters passed to INT10,06 and will
therefore happily write to an area beyond the end of video RAM.  The
area immediately following the video RAM tends to be the VGA BIOS ROM
image.  Overwriting the VGA BIOS leads to an interesting variety of
crashes and reboots.

Fix by specifying an exact width and height to be cleared, rather than
passing in large values and relying upon the BIOS to truncate them to
the appropriate range.

Reported-by: Alex Davies <adavies@jumptrading.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[realtek] Clear bit 24 of RCR
Michael Brown [Mon, 17 Mar 2014 17:15:18 +0000 (17:15 +0000)] 
[realtek] Clear bit 24 of RCR

On an Asus Z87-K motherboard with an onboard 8168 NIC, booting into
Windows 7 and then warm rebooting into iPXE results in a broken RX
datapath: packets can be transmitted successfully but garbage is
received.  A cold reboot clears the problem.

A dump of the PHY registers reveals only one difference: in the
failure case the bits ADVERTISE_PAUSE_CAP and ADVERTISE_PAUSE_ASYM are
cleared.  Explicitly setting these bits does not fix the problem.

A dump of the MAC registers reveals a few differences, of which the
most obvious culprit is the undocumented bit 24 of the Receive
Configuration Register (RCR), which is set in the failure case.
Explicitly clearing this bit does fix the problem.

Reported-by: Sebastian Nielsen <ipxe@sebbe.eu>
Reported-by: Oliver Rath <rath@mglug.de>
Debugged-by: Sebastian Nielsen <ipxe@sebbe.eu>
Tested-by: Sebastian Nielsen <ipxe@sebbe.eu>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[realtek] Add ability to dump all internal registers
Michael Brown [Fri, 14 Mar 2014 12:46:23 +0000 (12:46 +0000)] 
[realtek] Add ability to dump all internal registers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[efi] Disable SNP devices when running iPXE as the application
Michael Brown [Fri, 14 Mar 2014 14:16:05 +0000 (14:16 +0000)] 
[efi] Disable SNP devices when running iPXE as the application

Some UEFI builds will set up a timer to continuously poll any SNP
devices.  This can drain packets from the network device's receive
queue before iPXE gets a chance to process them.

Use netdev_rx_[un]freeze() to explicitly indicate when we expect our
network devices to be driven via the external SNP API (as we do with
the UNDI API on the standard BIOS build), and disable the SNP API
except when receive queue processing is frozen.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[efi] Unload our own image before exiting UEFI application
Michael Brown [Fri, 14 Mar 2014 15:56:36 +0000 (15:56 +0000)] 
[efi] Unload our own image before exiting UEFI application

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[efi] Avoid accidentally calling main() twice
Michael Brown [Fri, 14 Mar 2014 15:15:14 +0000 (15:15 +0000)] 
[efi] Avoid accidentally calling main() twice

EFIRC() uses PLATFORM_TO_ERRNO(), which evaluates its argument twice
(and can't trivially use a braced-group expression or an inline
function to avoid this, since it gets used outside of function
context).

The expression "EFIRC(main())" will therefore end up calling main()
twice, which is not the intended behaviour.  Every other instance of
EFIRC() is of the simple form "EFIRC(rc)", so fix by converting this
instance to match.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[netdevice] Notify upper-layer drivers when RX processing is (un)frozen
Michael Brown [Fri, 14 Mar 2014 14:05:38 +0000 (14:05 +0000)] 
[netdevice] Notify upper-layer drivers when RX processing is (un)frozen

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[lotest] Allow loopback testing on shared networks
Michael Brown [Thu, 13 Mar 2014 23:35:18 +0000 (23:35 +0000)] 
[lotest] Allow loopback testing on shared networks

Allow for extraneous packets to be received during loopback testing,
and so permit loopback tests to be performed when ports are connected
to a switch (rather than requiring ports to be directly connected with
a loopback cable).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[console] Fix display of characters with top bit set
Michael Brown [Thu, 13 Mar 2014 14:20:10 +0000 (14:20 +0000)] 
[console] Fix display of characters with top bit set

Inhibit implicit sign-padding of characters with the top bit set
(e.g. accented characters), which confuses the mucurses library by
colliding with the bits used to store character attributes and
colours.

Reported-by: Marc Delisle <Marc.Delisle@cegepsherbrooke.qc.ca>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[efi] Connect driver to devices as part of installation
Michael Brown [Tue, 11 Mar 2014 15:34:47 +0000 (15:34 +0000)] 
[efi] Connect driver to devices as part of installation

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[efi] Allow driver to be unloaded
Michael Brown [Mon, 10 Mar 2014 15:42:21 +0000 (15:42 +0000)] 
[efi] Allow driver to be unloaded

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[efi] Allow for 64-bit EFI_STATUS codes
Michael Brown [Mon, 10 Mar 2014 16:36:21 +0000 (16:36 +0000)] 
[efi] Allow for 64-bit EFI_STATUS codes

On a 64-bit build, EFI_STATUS codes are 64-bit quantities, with the
"error/warning" bit located in bit 63.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[image] Add "--timeout" parameter to image downloading commands
Michael Brown [Mon, 10 Mar 2014 13:32:39 +0000 (13:32 +0000)] 
[image] Add "--timeout" parameter to image downloading commands

iPXE will detect timeout failures in several situations: network
link-up, DHCP, TCP connection attempts, unacknowledged TCP data, etc.
This does not cover all possible circumstances.  For example, if a
connection to a web server is successfully established and the web
server acknowledges the HTTP request but never sends any data in
response, then no timeout will be triggered.  There is no timeout
defined within the HTTP specifications, and the underlying TCP
connection will not generate a timeout since it has no way to know
that the HTTP layer is expecting to receive data from the server.

Add a "--timeout" parameter to "imgfetch", "chain", etc.  If no
progress is made (i.e. no data is downloaded) within the timeout
period, then the download will be aborted.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[monojob] Reset timeout when progress is made
Michael Brown [Mon, 10 Mar 2014 13:16:18 +0000 (13:16 +0000)] 
[monojob] Reset timeout when progress is made

Redefine the timeout parameter from "time since start of job" to "time
since progress was last made".  This does not affect any existing
behaviour, since all existing users of the timeout parameter do not
provide progress indication.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[realtek] Dump all MII register contents when link status changes
Michael Brown [Mon, 10 Mar 2014 12:22:23 +0000 (12:22 +0000)] 
[realtek] Dump all MII register contents when link status changes

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[mii] Add mii_dump() to dump all MII registers
Michael Brown [Mon, 10 Mar 2014 12:21:54 +0000 (12:21 +0000)] 
[mii] Add mii_dump() to dump all MII registers

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[http] Automatically retry request on a 503 Service Unavailable
Michael Brown [Fri, 7 Mar 2014 17:19:36 +0000 (17:19 +0000)] 
[http] Automatically retry request on a 503 Service Unavailable

A web server may return a 503 Service Unavailable response along with
a Retry-After header to direct the client to retry the request at a
later time.

The Retry-After header may be a number of seconds, or a full HTTP
timestamp (e.g. "Fri, 7 Mar 2014 17:22:14 GMT").  We have no
reasonable way of parsing a full HTTP timestamp; if the server chooses
to use this format then we simply retry after a fixed 5-second delay.

As per RFC 2616, in the absence of a Retry-After header we treat a
status code of 503 Service Unavailable as being equivalent to 500
Internal Server Error, and immediately fail the request.

Requested-by: Suresh Sundriyal <ssundriy@vmware.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[http] Use a retry timer to trigger retried requests
Michael Brown [Fri, 7 Mar 2014 16:45:45 +0000 (16:45 +0000)] 
[http] Use a retry timer to trigger retried requests

Use a retry timer to allow for the possibility of deferring a retried
request.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[linux] Avoid starting currticks() from zero every time
Michael Brown [Fri, 7 Mar 2014 16:40:36 +0000 (16:40 +0000)] 
[linux] Avoid starting currticks() from zero every time

iPXE uses currticks() (along with the MAC address(es) of any network
devices) to seed the (non-cryptographic) random number generator.  The
current implementation of linux_currticks() ensures that the first
call to currticks() will always return zero; this results in identical
random number sequences on each run of iPXE on a given machine.  This
can cause odd-looking behaviour due to e.g. the reuse of local TCP
port numbers.

Fix by effectively rounding down the start time recorded by
linux_currticks() to the nearest whole second; this makes it unlikely
that consecutive runs of iPXE will use the exact same RNG sequence.

(Note that none of this affects the cryptographic RNG, which uses
/dev/random as a source of entropy.)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[tcp] Update window even if ACK does not acknowledge new data
Michael Brown [Wed, 5 Mar 2014 17:30:06 +0000 (17:30 +0000)] 
[tcp] Update window even if ACK does not acknowledge new data

iPXE currently ignores ACKs which do not acknowledge any new data.
(In particular, it does not stop the retransmission timer; this is
done to prevent an immediate retransmission if a duplicate ACK is
received while the transmit queue is non-empty.)

If a peer provides a window size of zero and later sends a duplicate
ACK to update the window size, this update will therefore be ignored
and iPXE will never be able to transmit data.

Fix by updating the window size even for ACKs which do not acknowledge
new data.

Reported-by: Wissam Shoukair <wissams@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[netdevice] Mark devices as open before calling open() method
Michael Brown [Wed, 5 Mar 2014 15:25:08 +0000 (15:25 +0000)] 
[netdevice] Mark devices as open before calling open() method

When opening a VLAN device, vlan_open() will call netdev_open() on the
trunk device.  This will result in a call to netdev_notify(), which
will cause vlan_notify() to call vlan_sync() on the original VLAN
device, which will see that the trunk device is now open but the VLAN
device apparently isn't (since it has not yet been flagged as open by
netdev_open()).  The upshot is a second attempt to open the VLAN
device, which will result in an erroneous second call to vlan_open().
This convoluted chain of events then terminates harmlessly since
vlan_open() calls netdev_open() on the trunk device, which just
returns immediately since the trunk device is by now flagged as being
already open.

Prevent this from happening by having netdev_open() flag the device as
open prior to calling the device's open() method, and reflagging it as
closed if the open() method fails.

Originally-fixed-by: Wissam Shoukair <wissams@mellanox.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[romprefix] Do not clobber stack segment when returning to BIOS
Michael Brown [Wed, 5 Mar 2014 12:25:21 +0000 (12:25 +0000)] 
[romprefix] Do not clobber stack segment when returning to BIOS

Commit c429bf0 ("[romprefix] Store boot bus:dev.fn address as autoboot
device location") introduced a regression by using register %cx to
temporarily hold the PCI bus:dev.fn address, despite the fact that %cx
was already being used to hold the stored BIOS stack segment.
Consequently, when returning to the BIOS after a failed or cancelled
boot attempt, iPXE would end up calling INT 18 with the stack segment
set equal to the PCI bus:dev.fn address.  Writing to essentially
random areas of memory tends to upset even the more robust BIOSes.

Fix by using register %ax to temporarily hold the PCI bus:dev.fn
address.

Reported-by: Anton D. Kachalov <mouse@yandex-team.ru>
Tested-by: Anton D. Kachalov <mouse@yandex-team.ru>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[realtek] Include link status register details in debug messages
Michael Brown [Tue, 4 Mar 2014 16:30:06 +0000 (16:30 +0000)] 
[realtek] Include link status register details in debug messages

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[bzimage] Report exact initrd length via bzImage header
Michael Brown [Tue, 4 Mar 2014 14:30:45 +0000 (14:30 +0000)] 
[bzimage] Report exact initrd length via bzImage header

iPXE currently pads initrd images to a multiple of 4kB and inserts
zero padding between images, as required by some versions of the Linux
kernel.  The overall length reported via the ramdisk_size field in the
bzImage header includes this zero padding.

This causes problems when using memdisk to load a gzip-compressed disk
image.  memdisk treats the ramdisk_size field as containing the exact
length of the initrd image, and uses this length to locate the 8-byte
gzip footer.  This will generally cause memdisk to fail to decompress
the disk image.

Fix by reporting the exact length of the initrd image set, including
any padding inserted between images but excluding any padding added at
the end of the final image.

Reported-by: Levente LEVAI <levail@aviatronic.hu>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[tcp] Calculate correct MSS from peer address
Michael Brown [Tue, 4 Mar 2014 13:14:13 +0000 (13:14 +0000)] 
[tcp] Calculate correct MSS from peer address

iPXE currently advertises a fixed MSS of 1460, which is correct only
for IPv4 over Ethernet.  For IPv6 over Ethernet, the value should be
1440 (allowing for the larger IPv6 header).  For non-Ethernet link
layers, the value should reflect the MTU of the underlying network
device.

Use tcpip_mtu() to calculate the transport-layer MTU associated with
the peer address, and calculate the MSS to allow for an optionless TCP
header as per RFC 6691.

As a side benefit, we can now fail a connection immediately with a
meaningful error message if we have no route to the destination
address.

Reported-by: Anton D. Kachalov <mouse@yandex-team.ru>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[tcpip] Provide tcpip_mtu() to determine the maximum transmission unit
Michael Brown [Tue, 4 Mar 2014 13:10:07 +0000 (13:10 +0000)] 
[tcpip] Provide tcpip_mtu() to determine the maximum transmission unit

Provide the function tcpip_mtu() to allow external code to determine
the (transport-layer) maximum transmission unit for a given socket
address.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[tcpip] Provide tcpip_netdev() to determine the transmitting network device
Michael Brown [Tue, 4 Mar 2014 12:54:21 +0000 (12:54 +0000)] 
[tcpip] Provide tcpip_netdev() to determine the transmitting network device

Provide the function tcpip_netdev() to allow external code to
determine the transmitting network device for a given socket address.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[prefix] Ignore PCI autoboot device location if set to 00:00.0
Michael Brown [Mon, 3 Mar 2014 16:23:41 +0000 (16:23 +0000)] 
[prefix] Ignore PCI autoboot device location if set to 00:00.0

qemu can load an option ROM which is not associated with a particular
PCI device using the "-option-rom" syntax.  Under these circumstances,
we should ignore the PCI bus:dev.fn address that we expect to find in
%ax on entry to the initialisation vector.

Fix by using the PCI bus:dev.fn address only if it is non-zero.  Since
00:00.0 will always be the host bridge, it can never be the address of
a network card.

Reported-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[romprefix] Store boot bus:dev.fn address as autoboot device location
Alex Williamson [Tue, 25 Feb 2014 23:00:44 +0000 (16:00 -0700)] 
[romprefix] Store boot bus:dev.fn address as autoboot device location

Per the BIOS Boot Specification, the initialization phase of the ROM
is called with the PFA (PCI Function Address) in the %ax register.
The intention is that the ROM code will store that device address
somewhere and use it for booting from that device when the Boot Entry
Vector (BEV) is called.  iPXE does store the PFA, but doesn't use it
to select the boot network device.  This renders BIOS IPL lists fairly
ineffective.

Fix by using the BBS-specified bus:dev.fn address as the autoboot
device location.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[prefix] Allow prefix to specify a PCI autoboot device location
Alex Williamson [Tue, 25 Feb 2014 23:00:39 +0000 (16:00 -0700)] 
[prefix] Allow prefix to specify a PCI autoboot device location

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[autoboot] Enable infrastructure to specify an autoboot device location
Alex Williamson [Tue, 25 Feb 2014 23:00:23 +0000 (16:00 -0700)] 
[autoboot] Enable infrastructure to specify an autoboot device location

iPXE will currently attempt to boot from every network device for
which it has a driver.  Where a system has more than one network
device supported by iPXE, this renders BIOS IPL lists ineffective.

Allow an autoboot device location to be specified.  If such a location
is specified, then only devices matching that location will be used as
part of the automatic boot sequence.  If no such location is
specified, then all devices will be used.

Note that this does not affect the "autoboot" command, which will
continue to use all devices.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[romprefix] Allow ROM banner timeout to be configured independently
Alex Williamson [Tue, 25 Feb 2014 23:33:08 +0000 (16:33 -0700)] 
[romprefix] Allow ROM banner timeout to be configured independently

iPXE currently prints a "Press Ctrl-B" banner twice: once when the ROM
is first called for initialisation and again if we attempt to boot
from the ROM.  This slows boot, especially when the NIC is not the
primary boot device.  Tools such as libguestfs make use of QEMU VMs
for performing maintenance on disk images and may make use of NICs in
the VM for network support.  If iPXE introduces a static init-time
delay, that directly translates to increased runtime for the tools.

Fix by allowing the ROM banner timeout to be configured independently
of the main banner timeout.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Modified-by: Michael Brown <mcb30@ipxe.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[cmdline] Add the "ipstat" command
Michael Brown [Sun, 2 Mar 2014 20:35:13 +0000 (20:35 +0000)] 
[cmdline] Add the "ipstat" command

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[tcpip] Add IP statistics collection as per RFC 4293
Michael Brown [Sun, 2 Mar 2014 20:33:35 +0000 (20:33 +0000)] 
[tcpip] Add IP statistics collection as per RFC 4293

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[image] Ensure every image has a fully resolved URI
Michael Brown [Tue, 25 Feb 2014 15:29:00 +0000 (15:29 +0000)] 
[image] Ensure every image has a fully resolved URI

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[uri] Refactor URI parsing and formatting
Michael Brown [Thu, 27 Feb 2014 13:32:53 +0000 (13:32 +0000)] 
[uri] Refactor URI parsing and formatting

Add support for parsing of URIs containing literal IPv6 addresses
(e.g. "http://[fe80::69ff:fe50:5845%25net0]/boot.ipxe").

Duplicate URIs by directly copying the relevant fields, rather than by
formatting and reparsing a URI string.  This relaxes the requirements
on the URI formatting code and allows it to focus on generating
human-readable URIs (e.g. by not escaping ':' characters within
literal IPv6 addresses).  As a side-effect, this allows relative URIs
containing parameter lists (e.g. "../boot.php##params") to function
as expected.

Add validity check for FTP paths to ensure that only printable
characters are accepted (since FTP is a human-readable line-based
protocol with no support for character escaping).

Construct TFTP next-server+filename URIs directly, rather than parsing
a constructed "tftp://..." string,

Add self-tests for URI functions.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[params] Use reference counters for form parameter lists
Michael Brown [Tue, 25 Feb 2014 14:03:40 +0000 (14:03 +0000)] 
[params] Use reference counters for form parameter lists

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[settings] Remove "uristring" setting type
Michael Brown [Mon, 17 Feb 2014 16:14:25 +0000 (16:14 +0000)] 
[settings] Remove "uristring" setting type

Commit b5f5f73 ("[cmdline] Expand settings within each command-line
token individually") effectively rendered the "uristring" setting type
obsolete, since strings containing whitespace no longer break the
command line parser.  The concept of the "uristring" type is not well
defined, since URI escaping rules depend on which portion of a URI is
being escaped.

Remove the "uristring" type, converting it into an alias for the
"string" setting type so as to avoid breaking existing scripts.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[dhcp] Copy exactly the required length when resizing DHCP options
Michael Brown [Wed, 26 Feb 2014 16:44:05 +0000 (16:44 +0000)] 
[dhcp] Copy exactly the required length when resizing DHCP options

When resizing DHCP options, iPXE currently calculates the length to be
copied by subtracting the destination pointer from the end of buffer
pointer.  This works and guarantees not to write beyond the end of the
buffer, but may end up reading beyond the end of the buffer.

Fix by calculating the required length exactly.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[dns] Update end-of-name pointer after processing CNAME record
Michael Brown [Wed, 26 Feb 2014 15:54:16 +0000 (15:54 +0000)] 
[dns] Update end-of-name pointer after processing CNAME record

Commit d4c0226 ("[dns] Support DNS search lists") introduced a
regression when handling CNAME records resolving to names longer than
the original name.  The "end of name" offset stored in dns->offset was
not updated to reflect the length of the new name, causing
dns_question() to append the (empty) search suffix at an incorrect
offset within the name buffer, resulting in a mangled DNS name.

In the case of a CNAME record resolving to a name shorter than or
equal in length to the original name, then the mangling would occur in
an unused portion of the name buffer.  In the common case of a name
server returning the A (or AAAA) record along with the CNAME record,
this would cause name resolution to succeed despite the mangling.  (If
the name server did not return the A or AAAA record along with the
CNAME record, then the mangling would be revealed by the subsequent
invalid query packet.)

Reported-by: Nicolas Sylvain <nsylvain@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[dns] Support DNS search lists
Michael Brown [Fri, 31 Jan 2014 18:16:42 +0000 (18:16 +0000)] 
[dns] Support DNS search lists

Update the DNS resolver to support DNS search lists (as provided by
DHCP option 119, DHCPv6 option 24, or NDP option 31).

Add validation code to ensure that parsing of DNS packets does not
overrun the input, get stuck in infinite loops, or (worse) write
beyond the end of allocated buffers.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[intel] Add some missing PCI IDs
Michael Brown [Wed, 29 Jan 2014 16:43:39 +0000 (16:43 +0000)] 
[intel] Add some missing PCI IDs

Tested-by: Philipp Hagen <Philipp.Hagen@she.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[cmdline] Always clear screen after reconfiguring console
Michael Brown [Wed, 22 Jan 2014 22:32:40 +0000 (22:32 +0000)] 
[cmdline] Always clear screen after reconfiguring console

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[fbcon] Allow ANSI CUP with missing arguments
Michael Brown [Wed, 22 Jan 2014 22:42:59 +0000 (22:42 +0000)] 
[fbcon] Allow ANSI CUP with missing arguments

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[cmdline] Add margin options to the "console" command
Michael Brown [Wed, 22 Jan 2014 14:08:15 +0000 (14:08 +0000)] 
[cmdline] Add margin options to the "console" command

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[cmdline] Rename "console" command's --bpp option to --depth
Michael Brown [Wed, 22 Jan 2014 13:22:32 +0000 (13:22 +0000)] 
[cmdline] Rename "console" command's --bpp option to --depth

Rename the "--bpp" option to "--depth", to free up the single-letter
option "-b" for "--bottom" in preparation for adding margin support.

This does not break backwards compatibility with documented features,
since the "console" command has not yet been documented.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[vesafb] Allow for an arbitrary margin around the text area
Michael Brown [Wed, 22 Jan 2014 14:04:48 +0000 (14:04 +0000)] 
[vesafb] Allow for an arbitrary margin around the text area

Allow for an arbitrary margin to be specified in the console
configuration.  If the actual screen size does not match the requested
screen size, then update any margins specified so that they remain in
the same place relative to the requested screen size.  If margins are
unspecified (i.e. zero), then leave them as zero.

The underlying assumption here is that any specified margins are
likely to describe an area within a background picture, and so should
remain in the same place relative to that background picture.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[fbcon] Allow for an arbitrary margin around the text area
Michael Brown [Wed, 22 Jan 2014 13:57:07 +0000 (13:57 +0000)] 
[fbcon] Allow for an arbitrary margin around the text area

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[fbcon] Centre background picture on console
Michael Brown [Fri, 17 Jan 2014 17:44:50 +0000 (17:44 +0000)] 
[fbcon] Centre background picture on console

Centre the background picture on the console, to give a more
consistent result when the aspect ratio does not match the requested
width and height.

Once drawn for the first time, nothing should ever overwrite the
margins of the display.  We can therefore eliminate the logic used to
redraw only the margin areas, and use much simpler code to draw the
complete initial background image.

Simplify the redrawing logic further by making the background picture
buffer equal in size to the frame buffer.  In the common case of a
background picture which is designed to fill the screen, this wastes
no extra memory, and the combined code simplifications reduce the size
of fbcon.o by approximately 15%.

Redefine the concept of "margin" to match the intuitive definition
(i.e. the size of the gap, rather than the position of the boundary
line).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[vesafb] Handle failures from fbcon_init()
Michael Brown [Wed, 22 Jan 2014 14:03:57 +0000 (14:03 +0000)] 
[vesafb] Handle failures from fbcon_init()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[png] Add support for PNG images
Michael Brown [Mon, 6 Jan 2014 17:59:21 +0000 (18:59 +0100)] 
[png] Add support for PNG images

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[test] Generalise pnm_ok() to pixbuf_ok()
Michael Brown [Mon, 6 Jan 2014 19:10:18 +0000 (19:10 +0000)] 
[test] Generalise pnm_ok() to pixbuf_ok()

Signed-off-by: Michael Brown <mcb30@ipxe.org>
11 years ago[test] Rewrite pnm_ok() using okx()
Michael Brown [Mon, 6 Jan 2014 17:58:46 +0000 (18:58 +0100)] 
[test] Rewrite pnm_ok() using okx()

Signed-off-by: Michael Brown <mcb30@ipxe.org>