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

4646 Commits

Author SHA1 Message Date
Michael Brown 09b057ce84 [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>
2014-02-26 23:34:07 +00:00
Michael Brown ced4f8d1d3 [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>
2014-02-26 16:44:05 +00:00
Michael Brown ff341c1861 [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>
2014-02-26 16:04:34 +00:00
Michael Brown d4c0226a6c [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>
2014-02-05 14:56:49 +00:00
Michael Brown 3fa7a3b136 [intel] Add some missing PCI IDs
Tested-by: Philipp Hagen <Philipp.Hagen@she.net>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-29 16:43:39 +00:00
Michael Brown 290a43efda [cmdline] Always clear screen after reconfiguring console
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-22 22:43:55 +00:00
Michael Brown 3ee2c4ac1c [fbcon] Allow ANSI CUP with missing arguments
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-22 22:43:55 +00:00
Michael Brown 20a90a40c3 [cmdline] Add margin options to the "console" command
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-22 14:28:51 +00:00
Michael Brown 43c8c272ae [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>
2014-01-22 14:28:49 +00:00
Michael Brown 11ad25933f [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>
2014-01-22 14:28:32 +00:00
Michael Brown 608d6cac9e [fbcon] Allow for an arbitrary margin around the text area
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-22 14:26:31 +00:00
Michael Brown 7fc380e950 [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>
2014-01-22 14:16:34 +00:00
Michael Brown b20fe32315 [vesafb] Handle failures from fbcon_init()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-22 14:16:30 +00:00
Michael Brown c6c8078964 [png] Add support for PNG images
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-12 22:53:16 +01:00
Michael Brown f4d2342e5a [test] Generalise pnm_ok() to pixbuf_ok()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-12 22:53:16 +01:00
Michael Brown da7224f9b6 [test] Rewrite pnm_ok() using okx()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-12 22:53:16 +01:00
Michael Brown fffd98bd37 [uaccess] Add memcmp_user()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-12 22:53:16 +01:00
Michael Brown 26f782bb41 [libc] Add abs()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-12 22:53:16 +01:00
Michael Brown 97fd5ccdd8 [deflate] Fix literal data length calculation
Fix incorrect calculation used to determine length of data to be
copied within a literal data block, and add a test case to prevent
this bug from going undetected in future.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-12 22:53:10 +01:00
Michael Brown 9bdfc36bcc [deflate] Add support for DEFLATE decompression
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-06 03:10:41 +01:00
Michael Brown 23f17f7972 [test] Add okx() macro taking an explicit file name and line number
Allow test reports to specify an explicit file name and line number
using the extended okx() macro.  This allows large blocks of test
report code such as tcpip_random_ok() to be implemented as functions
rather than macros.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-06 03:09:37 +01:00
Michael Brown a4e8ef72ab [libc] Add isprint()
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2014-01-06 01:46:20 +01:00
Michael Brown bf15737cf0 [build] Build ROMs used by qemu and VMware as part of "make all"
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-26 23:36:34 +01:00
Michael Brown 2200ca0e8f [ipv6] Fix compilation under FreeBSD
Reported-by: Dewey Hylton <dewey@hyltown.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-21 13:22:53 +00:00
Michael Brown 6ef1f51f10 [build] Remove obsolete check for GNU as version 2.9.1
Reported-by: Dewey Hylton <dewey@hyltown.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-21 13:13:46 +00:00
Michael Brown 8f0173b5c8 [vesafb] Set "magic" colour to transparent when a background picture is used
Use the magic colour facility to cause the user interface background
to become transparent when we have a background picture.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-09 15:34:14 +00:00
Michael Brown f6dce77b15 [console] Add concept of a "magic" colour
The magic basic colour can be remapped at runtime from COLOR_NORMAL_BG
(usually blue) to COLOR_DEFAULT (which will be transparent as a
background colour on the framebuffer console).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-09 15:34:14 +00:00
Michael Brown e8b5b50486 [cmdline] Add the "colour" and "cpair" commands
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-09 15:34:14 +00:00
Michael Brown 259858950a [mucurses] Use centralised concept of colour pairs
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-09 15:34:14 +00:00
Michael Brown 7025f5c648 [console] Add centralised concept of colours and colour pairs
Add a centralised concept of colours and colour pairs (using the
default colour pairs as configured via config/colour.h).  A colour
pair consists of a pair of colour indices.

Add the ability to redefine both a colour pair and an individual
colour index, with minimal overhead if this feature is not required
(e.g. because the relevant shell commands are not present in the
build).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-09 15:34:07 +00:00
Michael Brown 4c51f9602d [fbcon] Always draw cursor using current foreground and background colours
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-09 15:34:07 +00:00
Michael Brown 153748cce9 [lkrnprefix] Include iPXE version string in image header
Originally-implemented-by: Christian Hesse <list@eworm.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-06 20:11:36 +00:00
Michael Brown 4d9f100240 [fbcon] Update the console width and height after changing mode
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-06 17:52:05 +00:00
Michael Brown 03401f9d21 [console] Allow consoles to update the recorded console size
Provide a mechanism for consoles to update the recorded console width
and height, and use this width and height to provide the curses COLS
and LINES variables.

We choose not to use ANSI escape sequences to obtain the width and
height, for two reasons:

- iPXE's model is that all output is sent to all consoles; we could
  therefore end up with multiple consoles reporting conflicting widths
  and heights

- when a serial console is in use, we probably don't want to resize
  the output shown on the BIOS console to match the size of the serial
  console, since it's likely that the serial console is in use only
  for debugging.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-06 17:47:54 +00:00
Christian Hesse 1680d0d14d [build] Fix LABEL name for .liso images
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-06 17:12:57 +00:00
Michael Brown f79592545b [menu] Adapt user interface to fit display size
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-06 17:00:06 +00:00
Michael Brown 0344dc0094 [login] Adapt user interface to fit display size
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-06 16:51:10 +00:00
Michael Brown b6c867713b [settings] Adapt user interface to fit display size
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-06 16:44:35 +00:00
Michael Brown 54c5d08df1 [vesafb] Work around data corruption bug in bochs/qemu VBE implementation
The vgabios used by bochs and qemu (and other virtualisation products)
has a bug in its implementation of INT 10,4f00 which causes the high
16 bits of %ebx and %edx to become corrupted.

The vgabios code uses a "pushaw"/"popaw" pair to preserve the low 16
bits of all non-segment registers.  The vgabios code is compiled using
bcc, which generates 8086-compatible code and so never touches the
high 16 bits of the 32-bit registers.  However, the function
vbe_biosfn_return_controller_information() includes the line:

    size_64k = (Bit16u)((Bit32u)cur_info->info.XResolution *
				cur_info->info.XResolution *
				cur_info->info.BitsPerPixel) >> 19;

which generates an implicit call to the "lmulul" function.  This
function is implemented in vbe.c as:

    ; helper function for memory size calculation
    lmulul:
      and eax, #0x0000FFFF
      shl ebx, #16
      or  eax, ebx
      SEG SS
      mul eax, dword ptr [di]
      mov ebx, eax
      shr ebx, #16
      ret

which modifies %eax, %ebx, and %edx (as a result of the "mul"
instruction, which places its result into %edx:%eax).

Work around this problem by marking %ebx and %edx as being clobbered
by the call to INT 10,4f00.  (%eax is already used as an output
register, so does not need to be on the clobber list.)

Reported-by: Oliver Rath <rath@mglug.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-06 02:54:13 +00:00
Michael Brown 99c679696a [ipv6] Expose NDP-provided settings (including the DNS server)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 16:44:50 +00:00
Michael Brown 4a6c453b5b [dhcpv6] Add DHCPv6 "filename" setting
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 15:12:50 +00:00
Michael Brown f3e5df3162 [settings] Merge SETTING_IPv4 and SETTING_IPv6
Allow for equivalent IPv4 and IPv6 settings (which requires equivalent
settings to be adjacent within the settings list).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 15:11:15 +00:00
Michael Brown eaa8615648 [settings] Allow for multiple definitions of each predefined setting
Allow for multiple setting definitions with the same name but
different scopes and tags.  For example, allow for a "filename"
setting with default scope and tag value 67 (for DHCPv4) and a
corresponding "filename" setting with IPv6 scope and tag value 59 (for
DHCPv6).

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 12:43:28 +00:00
Michael Brown b0942534eb [settings] Force settings into alphabetical order within sections
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 12:43:28 +00:00
Michael Brown 8aab959bed [dhcpv6] Use DUID-UUID form of client DUID
Use the system UUID to generate the client DUID-UUID as per RFC 6355.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 03:18:59 +00:00
Michael Brown 03957bcb47 [linux] Provide access to SMBIOS via /dev/mem
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 03:16:27 +00:00
Michael Brown 2f1c7e386b [ipv6] Add support for resolving IPv6 addresses via the "nslookup" command
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 01:53:25 +00:00
Michael Brown 44a0dc7848 [syslog] Add support for IPv6 syslog server
Note that IANA has not yet assigned a DHCPv6 option code for the
syslog server.  When a code is assigned, the definition of
DHCPV6_LOG_SERVERS should be updated.  Until then, an IPv6 address of
a syslog server can be configured manually using e.g.

  set syslog6 3ffe:302:11:2::8309

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 01:27:33 +00:00
Michael Brown 2649e8ef70 [socket] Ensure socket address structure sizes are fixed
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 01:21:10 +00:00
Michael Brown 6248894f52 [dns] Add support for resolving IPv6 addresses via AAAA records
Our policy is to prefer IPv6 addreses to IPv4 addresses, but to
request IPv6 addresses only if we have an IPv6 address for the name
server itself.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-12-05 00:41:49 +00:00