summaryrefslogtreecommitdiffstats
path: root/src/util
Commit message (Collapse)AuthorAgeFilesLines
* [zbin] Change fixup semantics to support ROMs over 128k uncompressedJoshua Oreman2009-08-111-50/+76
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* [geniso] Emit proper error message for incorrect location of ISOLINUX_BINvibi sreenivasan2009-08-091-1/+1
| | | | | | | | 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>
* [legal] Add the MIT and ISC licenses to licence.plH. Peter Anvin2009-08-031-0/+25
| | | | | | | | 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>
* [build] Allow safe concurrent builds of .iso, .liso and .sdsk targetsMichael Brown2009-08-023-8/+5Star
| | | | | | | | 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.
* [build] Make .liso image generation silent unless errors occurMichael Brown2009-08-021-1/+1
|
* [build] Add syslinux floppy image type .sdskMarty Connor2009-08-022-27/+83
| | | | | | | | | | | | 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>
* [legal] Add licence.pl and %.licence make targetMichael Brown2009-05-181-0/+124
| | | | | | | | | | | | | 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).
* [build] Fix signed/unsigned division in util/zbin.cStefan Hajnoczi2009-04-261-4/+5
| | | | | | | | | | | | | 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>
* [build] Simplify use of Getopt::Long in padimg.plMichael Brown2009-04-161-4/+3Star
| | | | | | 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.
* [build] Reinstate the .pdsk padded-floppy image formatMichael Brown2009-04-161-3/+4
| | | | | | 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.
* [build] Pad .rom, .dsk, and .hd images to 512-byte boundariesMichael Brown2009-04-162-12/+44
| | | | | | | | 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>
* [build] Round up SUBx deltasStefan Hajnoczi2009-04-151-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* [efi] Use POSIX version of basename() in elf2efi.cMichael Brown2009-03-311-1/+6
| | | | | | This is required in order to build on Mac OS X. Suggested-by: Joshua Oreman <oremanj@rwcr.net>
* [pci] Add driver_data field to struct pci_device_idThomas Miletich2009-03-261-1/+2
| | | | | Modified-by: Michael Brown <mcb30@etherboot.org> Signed-off-by: Michael Brown <mcb30@etherboot.org>
* [build] Enable building with the Intel C compiler (icc)Michael Brown2009-03-262-0/+157
|
* [efi] Ensure EFI ROM checksum is zeroMichael Brown2009-01-091-101/+60Star
| | | | | | | 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.
* [util] Tidy up output of disrom.plMichael Brown2009-01-091-21/+26
|
* [efi] Add efirom utility and .efirom image formatMichael Brown2009-01-083-42/+324
|
* [efi] Allow for .efidrv images as well as .efi imagesMichael Brown2009-01-081-14/+93
| | | | | | 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.
* [efi] Use elf2efi utility in place of efilinkMichael Brown2009-01-073-516/+766
| | | | | | | | | | | 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.
* [x86_64] Add support for compilation as an x86_64 binaryMichael Brown2008-12-051-2/+10
| | | | | | | | | | | | 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
* [efi] Add EFI image format and basic runtime environmentMichael Brown2008-10-132-0/+508
| | | | | | | | | 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.
* [makefile] Reduce verbosity of various NON_AUTO_MEDIA rulesMichael Brown2008-10-101-1/+1
|
* [util] Don't die on undefined symbols in sortobjdump.plMichael Brown2008-10-101-1/+1
| | | | | Undefined symbols shouldn't reach sortobjdump.pl, but if they do then it is not a helpful place to report the error.
* [util] Add optional debug messages to zbin.cMichael Brown2008-10-101-0/+27
|
* [makefile] Split config.h out into config/*.h and kill off mkconfig.plMichael Brown2008-10-081-205/+0Star
|
* [util] Avoid calling fclose(NULL) in zbin.cEygene Ryabinkin2008-09-041-1/+2
| | | | | | | | 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>
* [util] Fix interpretation of short jumps in Option::ROMMichael Brown2008-08-271-1/+3
| | | | | | 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.
* [util] Allow Option::ROM to understand and modify initialisation entry pointMichael Brown2008-08-153-7/+66
| | | | | | | | | | | | | | 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.
* [util] Add mergerom.plMichael Brown2008-07-311-0/+80
| | | | | | | | | | | | | | 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.
* [util] Add Option::ROM library and rewrite disrom.pl to use it.Michael Brown2008-07-312-100/+520
| | | | | The Option::ROM module provides an easy way to read and edit fields within option ROM headers.
* [util] config-local.h to avoid accidental commitsStefan Hajnoczi2008-06-051-10/+27
| | | | | | | | | | | | | | | | | | | | 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.
* [Makefile] Use bin/VVVVDDDD.rom instead of bin/pci_VVVV_DDDD.romMichael Brown2008-03-061-1/+1
| | | | | | | | 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.
* Add bin/pci_VVVV_DDDD target to allow building ROM images withoutMichael Brown2007-11-191-4/+5
| | | | needing to know the gPXE internal ROM name.
* Produce no output unless -v is specified or an error occurs.Michael Brown2007-07-171-2/+2
|
* Restore the "shared symbol found only in a single object should beMichael Brown2007-07-171-2/+9
| | | | treated as being provided by that object" code.
* Added symbols that the DBG() macros will use.Michael Brown2007-07-171-0/+12
|
* Use objdump -t for symcheck; it allows us to take the symbol sectionMichael Brown2007-07-171-36/+60
| | | | into account (and so remove the false positives due to .tbl.* symbols).
* Compressed ROM images now work.Michael Brown2007-07-162-0/+326
|
* Added nrv2b binary to ignore listMichael Brown2007-07-151-0/+1
|
* Rename .lilo extension to .lkrn and updated dependenciesMarty Connor2007-07-063-51/+11Star
|
* Rename .cvsignore files to .gitignoreMichael Brown2007-06-091-0/+0
|
* Obsolete for some time now.Michael Brown2006-12-201-751/+0Star
|
* Always update the PnP checksum, even if the ident string is not being set.Michael Brown2006-08-241-4/+6
|
* Quick utility to pad floppy disk images for vmware/qemuMichael Brown2006-08-231-0/+12
|
* - modified length of password string to match visible field lengthDan Lynch2006-06-281-3/+3
| | | | - value of n passed to wgetnstr should now be equivalent to output from strlen (i.e. length excluding NUL-terminating character)
* - first check-in for mucurses_test.cDan Lynch2006-06-272-2/+71
| | | | - added mucurses_test.c build targets
* Use byte 6 for the checksum, rather than byte 5. (Byte 5 may be part ofMichael Brown2006-06-061-10/+6Star
| | | | the jmp instruction).
* Added netmask and gateway global options.Michael Brown2006-04-051-8/+218
| | | | Added iSCSI testing.
* Make pcap_inject non-static, so that its prototype doesn't conflict withMichael Brown2006-04-051-1/+1
| | | | the real pcap_inject in the case where we do have it.