summaryrefslogtreecommitdiffstats
path: root/src/util/Option
Commit message (Collapse)AuthorAgeFilesLines
* [util] Add support for EFI ROM imagesPetr Borsodi2019-01-211-1/+65
| | | | | | | The Option::ROM module recognizes and checks EFI header of image. The disrom.pl utility dumps this header if is present. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [util] Improve processing of ROM images in Option::ROMPetr Borsodi2019-01-211-34/+103
| | | | | | | | | | The Option::ROM module now compares the Code Type in the PCIR header to 0x00 (PC-AT) in order to check the presence of other header types (PnP, UNDI, iPXE, etc). The validity of these headers are checked not only by offset, but by range and signature checks also. The image checksum and initial size also depends on Code Type. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [pci] Correct invalid base-class/sub-class/prog-if order in PCIRPetr Borsodi2019-01-151-2/+2
| | | | | | | | | PCI Configuration Space contains fields prog-if at the offset 0x09, sub-class at the offset 0x0a and base-class at the offset 0x0b (it respects little endian). PCIR structure uses these fields in the same order. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [util] Add ability to dump PCI device ID listMichael Brown2015-04-131-0/+20
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [util] Use PCI length field to obtain length of individual imagesMichael Brown2014-08-261-3/+2Star
| | | | | | | | | | | | | | Option::ROM currently uses the initialisation length field (single byte at offset 0x02) to determine the length of a ROM image within a multi-image ROM file. For PCI ROM images with a code type other than 0, the initialisation length field may not be present. Fix by using the PCI header's image length field instead. Note that this does not prevent us from correctly handling ISA ROMs, since ISA ROMs do not support multiple images within a single ROM BAR anyway. Inspired-by: Swift Geek <swiftgeek@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [util] Display UNDI ROM header in disrom.plMichael Brown2012-08-151-0/+80
| | | | | Requested-by: Daniel Wyatt <daniel.wyatt@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [util] Allow for CALL NEAR in the option ROM initialisation entry pointDaniel Wyatt2012-08-151-0/+4
| | | | | | | | Option::ROM currently understands only JMP NEAR and JMP SHORT instructions in the initialisation entry point. At least one Broadcom option ROM has been observed to use a CALL NEAR instruction. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Report a pessimistic runtime size estimateMichael Brown2012-07-231-1/+76
| | | | | | | | | | | | | | | | PCI3.0 allows us to report a "runtime size" which can be smaller than the actual ROM size. On systems that support PMM our runtime size will be small (~2.5kB), which helps to conserve the limited option ROM space. However, there is no guarantee that the PMM allocation will succeed, and so we need to report the worst-case runtime size in the PCI header. Move the "shrunk ROM size" field from the PCI header to a new "iPXE ROM header", allowing it to be accessed by ROM-manipulation utilities such as disrom.pl. Reported-by: Anton D. Kachalov <mouse@yandex-team.ru> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Update FSF mailing address in GPL licence textsMichael Brown2012-07-201-1/+2
| | | | | Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [util] Allow Option::ROM to access multiple ROM imagesMichael Brown2012-06-121-4/+70
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [romprefix] Add .mrom format, allowing loading of large ROMsMichael Brown2010-04-251-1/+2
| | | | | | | | | | | | | | | | | | | | | 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>
* [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-151-2/+42
| | | | | | | | | | | | | | 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 Option::ROM library and rewrite disrom.pl to use it.Michael Brown2008-07-311-0/+459
The Option::ROM module provides an easy way to read and edit fields within option ROM headers.