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

160 Commits

Author SHA1 Message Date
Michael Brown 4740703d9d [console] Ignore unexpected keysyms when generating keyboard maps
I am unable to find any definitive documentation on how Linux keyboard
symbols work.  In the absence of any documentation, I'm going to
assume that unexpected keysyms are harmless and should be ignored.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-03-27 20:59:47 +01:00
Michael Brown c46acda672 [build] Include UNDI PCI driver within all-drivers build
Commit 9b99d2a ("[build] Avoid generating ROMs with "match-any" vendor
or device IDs") introduced a regression which caused the UNDI PCI
driver to be omitted from the list of all drivers, and thus to be
excluded from the all-drivers build.

Fix by ensuring that the per-driver section of the Makefile is
generated even when there are no ROMs to be built.

Reported-by: Sven Dreyer <sven@dreyer-net.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-11-16 00:22:30 +00:00
Michael Brown 8b092f4c50 [util] Add romcheck.pl
Provide a utility to quickly determine the ROM size and .mrom format
support for attached PCI devices.  For example:

    01:00.0 (1186:4300) supports a 128kB .rom or .mrom

Inspired-by: Wes Frazier <wes.frazier@members.fsf.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-09-19 16:43:08 +01:00
Dominic Cleal 3fc139362c [build] Allow APPEND lines in ipxe.iso to function as expected
Signed-off-by: Dominic Cleal <dcleal@redhat.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-05-19 12:03:18 +01:00
Michael Brown 9b99d2af0c [build] Avoid generating ROMs with "match-any" vendor or device IDs
A PCI_ROM() entry containing a vendor or device ID of PCI_ANY_ID
(0xffff) indicates to pci_find_driver() that the entry's vendor or
device ID should be ignored when matching against the device's vendor
or device ID.  It does not represent a PCI ROM that should be built.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-30 16:01:07 +01:00
Michael Brown 0579b8279c [build] Include only one copy of each ROM in "make allroms"
Each PCI ROM currently ends up appearing twice in the $(ROMS) list:
once under its designated name (e.g. "rtl8139.rom"), once under its
PCI IDs (e.g. "bin/10ec8139.rom").

Include only the latter of these in the $(ROMS) list, so that doing
"make allroms" will generate only one copy of each ROM.

Reported-by: Bastian Blank <waldi@debian.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-30 15:49:00 +01:00
Michael Brown d161ebff94 [build] Generate hybrid ISO images if isohybrid is available
Suggested-by: Gene Cumm <gene.cumm@gmail.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-27 22:37:04 +01:00
Michael Brown 48624cf94a [console] Try to avoid problems caused by keycode 86
The "us" keyboard layout contains a mapping for keycode 86 (which
seems not to correspond to any physical key on many US keyboards) to
the ASCII character '<'.  This mapping causes conflicts with the
mapping for keycode 51, which also maps (with shift) to '<'.

Change the keyboard mapping generator to choose the lowest keycode for
each ASCII character as indicating the relevant mapping to use, on the
basis that a lower keycode roughly indicates a "more normal" key.  On
a German keyboard, which has keys for both keycode 51 and keycode 86
present, this causes '<' to be remapped to ';', which is a closer
match to typical user expectations.

Reported-by: Sven Dreyer <sven@dreyer-net.de>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-16 21:43:56 +00:00
Michael Brown 1febd879e3 [console] Add keymap generator
Inspired by LILO's keytab-lilo.pl, genkeymap.pl uses "loadkeys -b" to
obtain a Linux keyboard map, and generates a file keymap_xx.c in
hci/keymap.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2011-03-16 12:02:59 +00:00
Michael Brown ea0fcb9460 [fnrec] Enhance function recording
Enhance the information collected by the function recorder to include
the call site and entry/exit counts.  This allows fnrec.pl to produce
a call tree such as:

    step (from core/getkey.c:46 = 0x17e90) {
      ref_increment (from core/process.c:93 = 0x73ec) { }
      net_step (from core/process.c:96 = 0x73f1) {
        net_poll (from net/netdevice.c:741 = 0xbce6) {
          netdev_poll (from net/netdevice.c:700 = 0xbc58) { }
          netdev_rx_dequeue (from net/netdevice.c:709 = 0xbc65) { }
        }
      }
      ref_decrement (from core/process.c:96 = 0x73f9) { }
    }

Note that inlined functions are reported, confusingly, as extra calls
to the *containing* function.  Minimise this confusion by adding the
attribute "no_instrument_function" to all functions declared as
inline.  (Static functions that have been inlined autonomously by gcc
will still be problematic, but these are far fewer in number.)

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-12-09 13:11:27 +00:00
Michael Brown a7fb7a8c6d [util] Update welcome message in ISO images
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-10-17 23:55:53 +01:00
Geoff Lywood b8dd94686b [efi] Fix the 32-bit version of elf2efi64
Currently, if elf2efi.c is compiled using a 32-bit HOST_CC, then the
resulting elf2efi64 binary will generate 32-bit EFI binaries instead
of 64-bit EFI binaries.

The problem is that elf2efi.c uses the MDE_CPU_* definitions to decide
whether to output a 32-bit or 64-bit PE binary.  However, MDE_CPU_*
gets defined in ProcessorBind.h, depending on the compiler's target
architecture.  Overriding them on the command line doesn't work in the
expected way, and you can end up in cases where both MDE_CPU_IA32 and
MDE_CPU_X64 are defined.

Fix by using a separate definition, EFI_TARGET_IA32/EFI_TARGET_X64,
which is specified only on the command line.

Signed-off-by: Geoff Lywood <glywood@vmware.com>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-07-21 12:41:41 +01:00
Michael Brown 6c0e8c14be [libc] Enable automated extraction of error usage reports
Add preprocessor magic to the error definitions to enable every error
usage to be tracked.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-05-31 03:11:57 +01:00
Geoff Lywood ceba975b15 [efi] Verify object format support in elf2efi.c
Currently, if you attempt to build 64-bit EFI binaries on a 32-bit
system without a suitable cross-compiling version of libbfd, the iPXE
build will die with a segmentation fault in elf2efi64.

Fix by properly handling the return value from bfd_check_format().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-05-27 09:17:37 +01:00
Michael Brown 132c391712 [romprefix] Add .mrom format, allowing loading of large ROMs
Add an infrastructure allowing the prefix to provide an open_payload()
method for obtaining out-of-band access to the whole iPXE image.  Add
a mechanism within this infrastructure that allows raw access to the
expansion ROM BAR by temporarily borrowing an address from a suitable
memory BAR on the same PCI card.

For cards that have a memory BAR that is at least as large as their
expansion ROM BAR, this allows large iPXE ROMs to be supported even on
systems where PMM fails, or where option ROM space pressure makes it
impossible to use PMM shrinking.  The BIOS sees only a stub ROM of
approximately 3kB in size; the remainder (which can be well over 64kB)
is loaded only at the time iPXE is invoked.

As a nice side-effect, an iPXE .mrom image will continue to work even
if its PMM-allocated areas are overwritten between initialisation and
invocation.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-04-25 16:37:06 +01:00
Michael Brown d8c1f2e94f [build] Replace obsolete makerom.pl with quick script using Option::ROM
The only remaining useful function of makerom.pl is to correct the ROM
and PnP checksums; the PCI IDs are set at link time, and padding is
performed using padimg.pl.

Option::ROM already provides a facility for correcting the checksums,
so we may as well just use this instead.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-04-25 02:54:12 +01:00
Michael Brown 9068249e24 [prefix] Add .text16.early section
Add a section .text16.early which is always kept inline with the
prefix.  This will allow for some code sharing between the .prefix and
.text16 sections.

Note that the simple solution of just prepending the .prefix section
to the .text16 section will not work, because a bug in Wyse Streaming
Manager server (WLDRM13.BIN) requires us to place a dummy PXENV+ entry
point at the start of .text16.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-04-20 12:56:28 +01:00
Michael Brown 329686c026 [romprefix] Remove .xrom prefix
The .xrom prefix provides an experimental mechanism for loading ROM
images greater than 64kB in size by mapping the expansion ROM BAR in
at a hopefully-unused address.  This is unreliable, and potentially
dangerous.  In particular, there is no guarantee that any PCI bridges
between the CPU and the device will respond to accesses for the
"unused" memory region that is chosen, and it is possible that the
process of scanning for the "unused" memory region may end up issuing
reads to other PCI devices.  If this ends up trampling on a register
with read side-effects belonging to an unrelated PCI device, this may
cause undefined behaviour.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-04-19 23:43:48 +01:00
Michael Brown 8406115834 [build] Rename gPXE to iPXE
Access to the gpxe.org and etherboot.org domains and associated
resources has been revoked by the registrant of the domain.  Work
around this problem by renaming project from gPXE to iPXE, and
updating URLs to match.

Also update README, LOG and COPYRIGHTS to remove obsolete information.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2010-04-19 23:43:39 +01:00
Piotr Jaroszyński 70537cbe35 [util] Hide an expected error from the 'which' command
Signed-off-by: Piotr Jaroszyński <p.jaroszynski@gmail.com>
Signed-off-by: Marty Connor <mdc@etherboot.org>
2010-04-16 07:55:15 -04:00
Stefan Hajnoczi 6a6f26f74d [fnrec] Add function recorder for debugging
The function recorder is a crash and hang debugging tool.  It logs each
function call into a memory buffer while gPXE runs.  After the machine
is reset, and if the contents of memory have not been overwritten, gPXE
will detect the memory buffer and print out its contents.

This allows developers to see a trace of the last functions called
before a crash or hang.  The util/fnrec.sh script can be used to convert
the function addresses back into symbol names.

To build with fnrec:

    make FNREC=1

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Marty Connor <mdc@etherboot.org>
2010-03-04 11:38:29 -05:00
Stefan Hajnoczi f9f7863c55 [util] Detect genisoimage as mkisofs replacement
Debian based systems may have genisoimage(1) instead of mkisofs(1).
They are command-line compatible so the util/geniso script should be
able to choose either one.

This patch also changes the use of the mkisofs quiet (-q) flag to its
long form (-quiet).  This should be compatible with more versions of
cdrtools and cdrkit.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Marty Connor <mdc@etherboot.org>
2010-02-13 12:46:03 -05:00
Joshua Oreman 06a8398422 [prefix] Add .xrom prefix for a ROM that loads itself by PCI accesses
The standard option ROM format provides a header indicating the size
of the entire ROM, which the BIOS will reserve space for, load, and
call as necessary. However, this space is strictly limited to 128k for
all ROMs. gPXE ameliorates this somewhat by reserving space for itself
in high memory and relocating the majority of its code there, but on
systems prior to PCI3 enough space must still be present to load the
ROM in the first place. Even on PCI3 systems, the BIOS often limits the
size of ROM it will load to a bit over 64kB.

These space problems can be solved by providing an artificially small
size in the ROM header: just enough to let the prefix code (at the
beginning of the ROM image) be loaded by the BIOS. To the BIOS, the
gPXE ROM will appear to be only a few kilobytes; it can then load
the rest of itself by accessing the ROM directly using the PCI
interface reserved for that task.

There are a few problems with this approach. First, gPXE needs to find
an unmapped region in memory to map the ROM so it can read from it;
this is done using the crude but effective approach of scanning high
memory (over 0xF0000000) for a sufficiently large region of all-ones
(0xFF) reads. (In x86 architecture, all-ones is returned for accesses
to memory regions that no mapped device can satisfy.) This is not
provably valid in all situations, but has worked well in practice.
More importantly, this type of ROM access can only work if the PCI ROM
BAR exists at all. NICs on physical add-in PCI cards generally must
have the BAR in order for the BIOS to be able to load their ROM, but
ISA cards and LAN-on-Motherboard cards will both fail to load gPXE
using this scheme.

Due to these uncertainties, it is recommended that .xrom only be used
when a regular .rom image is infeasible due to crowded option ROM
space. However, when it works it could allow loading gPXE images
as large as a flash chip one could find - 128kB or even higher.

Signed-off-by: Marty Connor <mdc@etherboot.org>
2010-01-20 17:46:48 -05:00
Joshua Oreman dacc64724f [util] Add diffsize.pl utility for generating diffs of object sizes
This is useful when comparing size optimizations.

Signed-off-by: Marty Connor <mdc@etherboot.org>
2010-01-14 11:30:30 -05:00
Joshua Oreman 0677a383e0 [zbin] Fix 64-bit compilation warnings for util/zbin.c
Recent gcc versions generate more warnings when compiling util/zbin.c
on a 64-bit system:

util/zbin.c: In function `read_file':
util/zbin.c:85: warning: format `%d' expects type `int', but
                argument 3 has type `size_t'
util/zbin.c:91: warning: format `%d' expects type `int', but
                argument 3 has type `size_t'
util/zbin.c: In function `read_zinfo_file':
util/zbin.c:119: warning: format `%d' expects type `int', but
                 argument 4 has type `size_t'
util/zbin.c: In function `alloc_output_file':
util/zbin.c:134: warning: format `%d' expects type `int', but
                 argument 3 has type `size_t'
util/zbin.c: In function `process_zinfo_add':
util/zbin.c:244: warning: format `%d' expects type `int', but
                 argument 3 has type `size_t'
util/zbin.c:266: warning: format `%d' expects type `int', but
                 argument 7 has type `size_t'
util/zbin.c:286: warning: format `%#x' expects type `unsigned int',
                 but argument 7 has type `size_t'
util/zbin.c: In function `write_output_file':
util/zbin.c:348: warning: format `%d' expects type `int', but
                 argument 3 has type `size_t'

This patch eliminates these warnings.

Signed-off-by: Marty Connor <mdc@etherboot.org>
2009-10-20 16:57:54 -04:00
Marty Connor 15b46c5763 [util] Change gensdsk file permissions to include execute
src/util/gensdsk is a shell script and should have execute permission.

Reported-by: sobtwmxt sobtwmxt@sdf.lonestar.org
2009-10-20 10:07:50 -04:00
Thomas Miletich 78e54426c0 [zbin] Fix compilation warnings for util/zbin.c
Recent gcc versions generate warnings when compiling util/zbin.c
( tested with gcc-4.3.3 ):

util/zbin.c: In function ‘process_zinfo_pack’:
util/zbin.c:200: warning: format ‘%#zx’ expects type ‘size_t’, but argument 6
has type ‘long unsigned int’
util/zbin.c: In function ‘process_zinfo_add’:
util/zbin.c:257: warning: format ‘%#lx’ expects type ‘long unsigned int’, but
argument 4 has type ‘int’
util/zbin.c:266: warning: format ‘%#lx’ expects type ‘long unsigned int’, but
argument 4 has type ‘int’
util/zbin.c:266: warning: format ‘%d’ expects type ‘int’, but argument 8 has
type ‘long unsigned int’
util/zbin.c:286: warning: format ‘%#lx’ expects type ‘long unsigned int’, but
argument 6 has type ‘int’
util/zbin.c:286: warning: format ‘%#lx’ expects type ‘long unsigned int’, but
argument 7 has type ‘size_t’

This patch eliminates these warnings.

Tested with gcc-4.3.3 on Ubuntu 9.04 and gcc-4.1.2 on Debian Etch.

Signed-off-by: Marty Connor <mdc@etherboot.org>
2009-10-17 13:56:03 -04:00
Stefan Hajnoczi 0ea6e5c221 [util] Make mtools check detect new versions
The mtools version check does not handle GNU mtools 4.0.10.  This commit
makes the pattern more general so it matches older mtools as well as the
newer "mtools (GNU mtools) 4.0.10" string.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Marty Connor <mdc@etherboot.org>
2009-10-15 14:54:30 -04:00
Joshua Oreman b0b0b8f65c [modrom] Avoid clobbering near jump with checksum
A jump instruction starts at the third byte of an option ROM image, and
it is required that the bytes in the whole image add up to zero. To
achieve this, a checksum byte is usually placed after the jump. The jump
can be either a short jump (2 bytes, EB xx) or a near jump (3 bytes,
E9 xx xx). gPXE's romprefix.S uses a near jump, but modrom.pl assumed
a short jump, and clobbered the high byte of the offset. This caused
modrom-modified gPXE ROM images to crash the system during POST.

Fix by making modrom.pl place the checksum at byte 6, like makerom.pl does.

Signed-off-by: Marty Connor <mdc@etherboot.org>
2009-10-15 14:47:54 -04:00
Joshua Oreman d5d68b2e31 [zbin] Change fixup semantics to support ROMs over 128k uncompressed
The option ROM header contains a one-byte field indicating the number
of 512-byte sectors in the ROM image.  Currently it is linked to
contain the number of uncompressed sectors, with an instruction to the
compressor to correct it.  This causes link failure when the
uncompressed size of the ROM image is over 128k.

Fix by replacing the SUBx compressor fixup with an ADDx fixup that
adds the total compressed output length, scaled as requested, to an
addend stored in the field where the final length value will be
placed.  This is similar to the behavior of ELF relocations, and
ensures that an overflow error will not be generated unless the
compressed size is still too large for the field.

This also allows us to do away with the _filesz_pgh and _filesz_sect
calculations exported by the linker script.

Output tested bitwise identical to the old SUBx mechanism on hd, dsk,
lkrn, and rom prefixes, on both 32-bit and 64-bit processors.

Modified-by: Michael Brown <mcb30@etherboot.org>
Signed-off-by: Michael Brown <mcb30@etherboot.org>
2009-08-11 12:59:26 +01:00
vibi sreenivasan e6e30618c2 [geniso] Emit proper error message for incorrect location of ISOLINUX_BIN
If isolinux.bin is not installed in the expected location the error
message shown is slightly misleading.

Signed-off-by: Vibi Sreenivasan <vibi_sreenivasan@cms.com>
Signed-off-by: Michael Brown <mcb30@etherboot.org>
2009-08-09 00:05:49 +01:00
H. Peter Anvin 5e1aa70301 [legal] Add the MIT and ISC licenses to licence.pl
The MIT and ISC licenses are legally equivalent to the bsd2 license,
but with slightly different verbiage.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Michael Brown <mcb30@etherboot.org>
2009-08-02 23:30:38 +01:00
Michael Brown f42b2932f8 [build] Allow safe concurrent builds of .iso, .liso and .sdsk targets
The geniso, genliso and gensdsk scripts contain hard-coded temporary
directory names, and so could potentially collide with each other when
run as part of a concurrent build (e.g. "make -j 4").

Fix by using mktemp to generate suitable temporary directory names.
2009-08-02 11:17:02 +01:00
Michael Brown b570c2efd8 [build] Make .liso image generation silent unless errors occur 2009-08-02 11:09:08 +01:00
Marty Connor 96f4f96540 [build] Add syslinux floppy image type .sdsk
We add a syslinux floppy disk type using parts of the genliso script.
This floppy image cat be dd'ed to a physical floppy or used in
instances where a virtual floppy with an mountable DOS filesystem is
useful.

We also modify the genliso script to only generate .liso images
rather than creating images depending on how it is called.

Signed-off-by: Michael Brown <mcb30@etherboot.org>
2009-08-02 11:04:13 +01:00
Michael Brown 41307f2874 [legal] Add licence.pl and %.licence make target
It is now possible to run e.g.

  make bin/rtl8139.dsk.licence

in order to see a licensing assessment for any given gPXE build.  The
assessment will either produce a single overall licence for the build
(based on combining all the licences used within the source files for
that build), or will exit with an error stating why a licence
assessment is not possible (for example, if there are files involved
that do not yet contain an explicit FILE_LICENCE() declaration).
2009-05-18 08:29:24 +01:00
Stefan Hajnoczi 9b964dec36 [build] Fix signed/unsigned division in util/zbin.c
Commit b149a99 ([build] Round up SUBx deltas) introduced a
signed/unsigned issue that affects gPXE images built on 32-bit hosts.
The zbin fixup utility performed an unsigned division, which led to
.usb images with an incorrect number of sectors to load.

The issue snuck by on 64-bit hosts since uint32_t is promoted to long.
On 32-bit hosts it is promoted to unsigned long.

Modified-by: Michael Brown <mcb30@etherboot.org>
Signed-off-by: Michael Brown <mcb30@etherboot.org>
2009-04-26 05:48:15 +01:00
Michael Brown b4a87daeb9 [build] Simplify use of Getopt::Long in padimg.pl
Sometimes it's just so much fun doing things the complicated way that
you forget to check the man page for the existence of a simpler
syntax.
2009-04-16 06:13:09 +01:00
Michael Brown 7aee624881 [build] Reinstate the .pdsk padded-floppy image format
Some utilities that expect a floppy disk image (e.g. iLO?) may test
for a file of the correct size.  Reinstate the .pdsk image format in
order to provide this if needed.
2009-04-16 06:01:07 +01:00
Michael Brown 7741546a40 [build] Pad .rom, .dsk, and .hd images to 512-byte boundaries
QEMU will silently round down a disk or ROM image file to the nearest
512 bytes.  Fix by always padding .rom, .dsk and .hd images to the
nearest 512-byte boundary.

Originally-fixed-by: Stefan Hajnoczi <stefanha@gmail.com>
2009-04-16 03:15:08 +01:00
Stefan Hajnoczi b149a99302 [build] Round up SUBx deltas
The zbin compressor fixup utility rounds down file sizes before
calculating their difference.  This produces incorrect values and may
cause truncated gPXE images to be loaded at boot.

The following example explains the problem:
ilen    = 48 bytes     (uncompressed input file)
olen    = 17 bytes     (compressed output file)
divisor = 16 bytes     (paragraph granularity)
fixmeup = 3 paragraphs (value to fix up)

olen / divisor - ilen / divisor
= 1 - 3
= -2 paragraphs  (old delta calculation)

( align ( olen, divisor ) - align ( ilen, divisor ) ) / divisor
= 2 - 3
= -1 paragraphs  (new delta calculation)

If we perform the SUBx operation with old delta:
fixmeup + -2 = 1 paragraph gets loaded by the prefix

With the new delta:
fixmeup + -1 = 2 paragraphs get loaded by the prefix

The old delta calculation removes the last paragraph; the prefix will
load a truncated copy of gPXE into memory.  We need to load 2
paragraphs since olen is 17 bytes.  Loading only 1 paragraph (16
bytes) would truncate the last byte.

Signed-off-by: Michael Brown <mcb30@etherboot.org>
2009-04-15 16:14:47 +01:00
Michael Brown bbd274a1d6 [efi] Use POSIX version of basename() in elf2efi.c
This is required in order to build on Mac OS X.

Suggested-by: Joshua Oreman <oremanj@rwcr.net>
2009-03-31 07:07:44 +01:00
Thomas Miletich 3da6f1c7bd [pci] Add driver_data field to struct pci_device_id
Modified-by: Michael Brown <mcb30@etherboot.org>
Signed-off-by: Michael Brown <mcb30@etherboot.org>
2009-03-26 10:22:15 +00:00
Michael Brown 1c67623e37 [build] Enable building with the Intel C compiler (icc) 2009-03-26 07:27:19 +00:00
Michael Brown 8fd81349b3 [efi] Ensure EFI ROM checksum is zero
The UEFI specification does not mention ROM checksums, and reassigns
the field typically used as a checksum byte.  The UEFI shell
"loadpcirom" utility does not verify ROM checksums, but it seems that
some UEFI BIOSes do.
2009-01-09 20:52:26 +00:00
Michael Brown 48b2f70ee4 [util] Tidy up output of disrom.pl 2009-01-09 19:38:53 +00:00
Michael Brown fb72336fe6 [efi] Add efirom utility and .efirom image format 2009-01-08 02:19:18 +00:00
Michael Brown 765efac771 [efi] Allow for .efidrv images as well as .efi images
Merge in the changes that allow for building EFI driver images (that
can be loaded using the EFI shell's "load" command) as well as EFI
applications.
2009-01-07 23:43:26 +00:00
Michael Brown 314779eb36 [efi] Use elf2efi utility in place of efilink
elf2efi converts a suitable ELF executable (containing relocation
information, and with appropriate virtual addresses) into an EFI
executable.  It is less tightly coupled with the gPXE build process
and, in particular, does not require the use of a hand-crafted PE
image header in efiprefix.S.

elf2efi correctly handles .bss sections, which significantly reduces
the size of the gPXE EFI executable.
2009-01-07 22:59:05 +00:00
Michael Brown ce0a0ccf5c [x86_64] Add support for compilation as an x86_64 binary
Currently the only supported platform for x86_64 is EFI.

Building an EFI64 gPXE requires a version of gcc that supports
__attribute__((ms_abi)).  This currently means a development build of
gcc; the feature should be present when gcc 4.4 is released.

In the meantime; you can grab a suitable gcc tree from

  git://git.etherboot.org/scm/people/mcb30/gcc/.git
2008-12-05 00:06:27 +00:00
Michael Brown 81d92c6d34 [efi] Add EFI image format and basic runtime environment
We have EFI APIs for CPU I/O, PCI I/O, timers, console I/O, user
access and user memory allocation.

EFI executables are created using the vanilla GNU toolchain, with the
EXE header handcrafted in assembly and relocations generated by a
custom efilink utility.
2008-10-13 10:24:14 +01:00
Michael Brown 3029eb0e84 [makefile] Reduce verbosity of various NON_AUTO_MEDIA rules 2008-10-10 03:57:31 +01:00
Michael Brown cdd619d11f [util] Don't die on undefined symbols in sortobjdump.pl
Undefined symbols shouldn't reach sortobjdump.pl, but if they do then it
is not a helpful place to report the error.
2008-10-10 03:42:22 +01:00
Michael Brown 96ea558e98 [util] Add optional debug messages to zbin.c 2008-10-10 03:42:08 +01:00
Michael Brown e817a347fb [makefile] Split config.h out into config/*.h and kill off mkconfig.pl 2008-10-08 02:17:32 +01:00
Eygene Ryabinkin 6de45ad4ae [util] Avoid calling fclose(NULL) in zbin.c
Must check that argument to a fclose() is not NULL -- we can get to the
'err' label when file was not opened.  fclose(NULL) is known to produce
core dump on some platforms and we don't want zbin to fail so loudly.

Signed-off-by: Eygene Ryabinkin <rea-fbsd@codelabs.ru>
2008-09-04 11:29:37 +01:00
Michael Brown bd5189a96d [util] Fix interpretation of short jumps in Option::ROM
Option::ROM was assuming that ROM images using a short jump
instruction for the init entry point would have a zero byte at offset
5; this is not necessarily true.
2008-08-27 20:36:30 +01:00
Michael Brown 23bca8f9d8 [util] Allow Option::ROM to understand and modify initialisation entry point
Add support for manipulating the jump instruction that forms the
option ROM initialisation entry point, so that mergerom.pl can treat
it just like other entry points.

Add support for merging the initialisation entry point (and IBM BOFM
table) to mergerom.pl; this is another slightly icky but unfortunately
necessary GPL vs. NDA workaround.  When mergerom.pl replaces an entry
point in the original ROM, it now fills in the corresponding entry
point in the merged ROM with the original value; this allows (for
example) a merged initialisation entry point to do some processing and
then jump back to the original entry point.
2008-08-15 04:10:35 +01:00
Michael Brown 12a37ab99e [util] Add mergerom.pl
This utility is required as a workaround for legal restrictions on
including GPL and non-GPL code within the same expansion ROM image.

While this is not encouraged, we are prepared to accept that
concatenation of ROM images and updating of the ROM header data
structures can be classed as "mere aggregation" within the terms of
the GPL.

If in any doubt, assume that you cannot include GPL and non-GPL code
within the same expansion ROM image.  Contact the Etherboot team for
clarification on your specific circumstances.
2008-07-31 06:28:46 +01:00
Michael Brown 6f73bb5e00 [util] Add Option::ROM library and rewrite disrom.pl to use it.
The Option::ROM module provides an easy way to read and edit fields
within option ROM headers.
2008-07-31 05:30:04 +01:00
Stefan Hajnoczi f866b17998 [util] config-local.h to avoid accidental commits
During development it is often handy to change the config.h options from
their defaults, for example to enable debugging features.

To prevent accidental commits of debugging config.h changes, mdc
suggested having a config-local.h that is excluded from source control.
This file acts as a temporary config.h and can override any of the
defaults.

This commit is an attempt to implement the config-local.h feature.

The config.h file now has the following as its last line:
/* @TRYSOURCE config-local.h */

The @TRYSOURCE directive causes config-local.h to be included at that
point in the file.  If config-local.h does not exist, no error will be
printed and parsing will continue as normal.  Therefore, mkconfig.pl is
"trying" to "source" config-local.h.
2008-06-05 00:45:33 +01:00
Michael Brown fad35829eb [Makefile] Use bin/VVVVDDDD.rom instead of bin/pci_VVVV_DDDD.rom
The generate-by-PCI-device-ID rules (bin/pci_VVVV_DDDD.rom) are generally
used for building actual ROM images to be burned, and the burning
utilities generally run under some DOS variant.  Change the filename from
pci_VVVV_DDDD.rom to VVVVDDDD.rom so that it is compatible with the DOS
8.3-character filename limit.
2008-03-06 15:37:34 +00:00
Michael Brown a1e243d504 Add bin/pci_VVVV_DDDD target to allow building ROM images without
needing to know the gPXE internal ROM name.
2007-11-19 20:14:20 +00:00
Michael Brown cb237819ca Produce no output unless -v is specified or an error occurs. 2007-07-17 01:59:48 +01:00
Michael Brown 19904804da Restore the "shared symbol found only in a single object should be
treated as being provided by that object" code.
2007-07-17 01:39:06 +01:00
Michael Brown 62d92348fe Added symbols that the DBG() macros will use. 2007-07-17 01:24:04 +01:00
Michael Brown c3290aae54 Use objdump -t for symcheck; it allows us to take the symbol section
into account (and so remove the false positives due to .tbl.* symbols).
2007-07-17 01:15:39 +01:00
Michael Brown 048bbeeebc Compressed ROM images now work. 2007-07-16 16:58:38 +01:00
Michael Brown a8780a4fe4 Added nrv2b binary to ignore list 2007-07-15 13:31:31 +01:00
Marty Connor 28d8d828b3 Rename .lilo extension to .lkrn and updated dependencies 2007-07-06 08:04:06 -04:00
Michael Brown 0f8d7d705d Rename .cvsignore files to .gitignore 2007-06-09 22:57:00 +01:00
Michael Brown a6d1815bc6 Obsolete for some time now. 2006-12-20 07:05:32 +00:00
Michael Brown 028bc034e4 Always update the PnP checksum, even if the ident string is not being set. 2006-08-24 17:56:46 +00:00
Michael Brown cddf8df8d4 Quick utility to pad floppy disk images for vmware/qemu 2006-08-23 03:07:41 +00:00
Dan Lynch ba2bfd54ed - modified length of password string to match visible field length
- value of n passed to wgetnstr should now be equivalent to output from strlen (i.e. length excluding NUL-terminating character)
2006-06-28 11:52:30 +00:00
Dan Lynch 2b15084388 - first check-in for mucurses_test.c
- added mucurses_test.c build targets
2006-06-27 17:31:01 +00:00
Michael Brown 8d0c5f3302 Use byte 6 for the checksum, rather than byte 5. (Byte 5 may be part of
the jmp instruction).
2006-06-06 15:29:14 +00:00
Michael Brown 1a60444fe4 Added netmask and gateway global options.
Added iSCSI testing.
2006-04-05 11:46:18 +00:00
Michael Brown 9ea782d339 Make pcap_inject non-static, so that its prototype doesn't conflict with
the real pcap_inject in the case where we do have it.
2006-04-05 11:44:05 +00:00
Michael Brown 90892d5ec7 Allow specifying the local IP address via --from. 2006-03-24 17:28:40 +00:00
Michael Brown 1c607470e3 Put in a substitute pcap_inject() function, since earlier versions of
libpcap are lacking the function.  For now, we always use the
substitute version, since there's no easy way to determine whether or
not we need it.
2006-03-24 16:43:12 +00:00
Michael Brown 7e61f38799 Moved "hello world" protocol implementation out of prototester.c and into
the first standalong uIP-based protocol module.
2006-03-23 22:37:05 +00:00
Michael Brown 99032becce Pick up the gPXE include files when building prototester. 2006-03-23 21:35:20 +00:00
Michael Brown a4a0244aa3 Moved uIP wrapper out of prototester.c and into proto/tcp.c. 2006-03-23 21:32:03 +00:00
Michael Brown eaf40883ff Add Makefile for hijack and prototester utilities. 2006-03-23 13:11:41 +00:00
Michael Brown 218c26ff2b Can now also print data sent by the remote side. 2006-03-23 13:06:08 +00:00
Michael Brown 0d506a5c6a Now capable of sending "Hello world!" via TCP. 2006-03-23 12:25:28 +00:00
Michael Brown 911486fe41 Added basic http-specific option parsing 2006-03-22 22:35:32 +00:00
Michael Brown 5263a5abf4 Started adding structure to allow for separate protocol tests, with
individual options.

Created the embryonic beginnings of a cleanly separated driver and
protocol stack API.
2006-03-22 21:25:35 +00:00
Michael Brown c32e83ad8d Skeleton version: contains device driver (connecting to network via
hijack daemon) and a functional but very ugly and very primitive
wrapper around uIP.

This passes proof-of-concept testing; it successfully initiates a TCP
connection and responds to pings.
2006-03-22 02:23:20 +00:00
Michael Brown c5a9c38606 Terminate cleanly on SIGINT or SIGHUP 2006-03-21 17:48:33 +00:00
Michael Brown e072baeb8c Use libpcap API to send/receive packets.
Include automatic filtering (based on source MAC address of first
transmitted packet).

Proven to successfully elicit a ping response from a remote host.
2006-03-21 16:50:25 +00:00
Michael Brown 4485df516c Basic structure in place: can daemonise, listen on a Unix domain
socket, accept new connections, open a network interface using libpcap
and forward (all) traffic.
2006-03-21 02:25:30 +00:00
Michael Brown 4e87543c74 Synced across updates from Etherboot 5.4 tree 2005-05-19 16:47:19 +00:00
Michael Brown cc73bba7ba Allow read-only symbols to be large 2005-05-03 12:34:52 +00:00
Michael Brown 7df2857248 Reduce large symbol warning threshold, now that most of the really
large symbols have been fixed.
2005-05-03 12:24:52 +00:00
Michael Brown 35ab3bf808 Report on misuses of shared symbols, and excessively large static symbols. 2005-05-02 15:21:12 +00:00
Michael Brown 88baf7a383 Tweaked to read more information (including symbol size) from blib.a 2005-05-02 13:49:54 +00:00
Michael Brown c8fc121890 Special handling for symbols of the form "xxx_end", to make table end
markers appear before the symbols that immediately follow the table.
2005-04-27 12:08:13 +00:00
Michael Brown 69f09ebdd8 Linker no longer provides start and end symbols for each table; these
markers are now static labels within the objects that refer to them.
2005-04-27 11:27:38 +00:00