mirror of
https://github.com/86Box/bios-tools.git
synced 2026-02-21 17:15:33 -07:00
0a4747bdfb645a009023cd4cc9fbe9a02bbe85cd
86Box BIOS Tools
A toolkit for extracting and analyzing x86 BIOS ROM images (mostly) within the context of the 86Box project.
Test drive
86Bot on the 86Box Discord has a BIOS analysis feature which uses BIOS Tools behind the scenes. Go to the #bot-spam channel and use the !bios command with an attached file or an URL. Other commands which work the same way and also leverage these tools are !acpi for extracting and decompiling ACPI tables, and !epa for extracting logo images.
System requirements
- Linux. Unfortunately, we rely on tools which contain non-portable code and generate filenames that are invalid for Windows, as well as GNU-specific extensions to shell commands. For Windows users, WSL potentially works.
- Python 3.5 or newer.
- Standard gcc toolchain for building the essential
bios_extracttool. - 7-Zip command line utility installed as
7z.
Installation
- Clone this repository.
- Build the
bios_extracttool:
cd bios_extract
make
cd ..
- Download the
UEFIExtracttool from its GitHub repository and place its executable on the repository's root directory. Prebuilt versions are only available forx86_64, but this tool is optional, and only required for UEFI extraction. - Optionally install a dependency required for BIOS logo extraction:
pip install -r requirements.txt
Usage
- Create a destination directory, which will be called
romshere. - Create a
1directory withinroms. - Place BIOS ROM images, archives, disk images, flasher executables and what have you in the
1directory. Subdirectories will also be checked. These files will be deleted during the extraction process. - Run the extractor, pointing it to the directory created in step 1:
python3 -m biostools -x roms
- The extracted file structure will be located in
roms/0. Individual files are extracted to directories named after the original file's name followed by:. - Run the analyzer, pointing it to the
0directory and redirecting its output to abioslist.csvfile:
python3 -m biostools -a roms/0 | tee bioslist.csv
- Import the resulting
bioslist.csvfile to Excel, or do whatever else you want to do with it. Other output formats can be selected through arguments to-a; runpython3 -m biostoolsto see a full list of supported arguments.
Extraction notes
- Many common file types known not to be useful, such as images, PDFs, Office documents and hardware information tool reports, are automatically discarded.
- Interleaved ROMs are merged through a heuristic filename and string detection, which may lead to incorrect merging if the chunks to different interleaved ROMs are present in the same directory.
- The FAT filesystem extractor relies on assumptions which may not hold true for all disk images.
- EPA (Award) and PCX (AMI) images are automatically converted to PNG if the aforementioned optional dependency is installed.
- Some Intel motherboard BIOSes (particularly from the AMIBIOS 6 era) will not be extracted properly due to a different address line inversion mechanism. This is a known issue with the Intel update format concatenator which may eventually be solved.
- Extraction of the following BIOS distribution formats is not implemented due to the use of unknown compression methods:
- Evergreen ETI (an ugly hack exists)
- IBM Sydex floppy self-extractor (it looks like CopyQM RLE but isn't)
Analysis notes
AMI
- Pre-Color (1990 and older) BIOSes have a dynamically-generated string that is not easily extractable; the analyzer will attempt to reconstruct it around the limited data contained in the ROM in a best-effort basis.
- The string on UEFI is a hidden string located within the AMIBIOS 8-based Compatibility Support Module (CSM). A missing string may indicate a lack of CSM.
Award
- The core version can be followed by
(Phoenix)on BIOSes which identify as Phoenix AwardBIOS, or(Workstation)on ones which identify as Award WorkstationBIOS. - OEM modifications which interfere with detection: Sukjung (string)
IBM
- The FRU codes contained in PC or PS/2 ROMs are interpreted as the string.
Phoenix
- Identification is not perfect, as the location of identification data varies from version to version, and a lot of OEMs mess with it.
- Phoenix has no concept of a string. Any date or time found in the BIOS is interpreted as the string.
Add-on reference
Depending on the contents of each BIOS, the following tags may be displayed on the analyzer output's "Add-ons" column:
- ACPI: Appears to contain an ACPI table. Does not necessarily indicate ACPI actually works.
- Adaptec: Adaptec ISA or PCI SCSI option ROM.
- NCR3/4: NCR PCI SCSI option ROM with SDMS version 3 or 4 (respectively).
- PXE: PXE-compliant network boot ROM, usually associated with on-board Ethernet.
- RPL: Novell NetWare RPL-compliant network boot ROM, usually associated with on-board Ethernet.
- SLI: NVIDIA SLI license for non-nForce motherboards.
- UEFI: The BIOS core is UEFI-compliant. Does not necessarily indicate UEFI support is available.
- VGA: Video BIOS, usually associated with on-board video.
BIOS-specific add-ons
- AMIBIOS (Color through 7) setup types: Color, EasySetup, HiFlex, NewSetup, SimpleSetup, WinBIOS.
- Award: PhoenixNet indicates the presence of PhoenixNet features, even if those were disabled by the OEM. UEFI indicates Gigabyte Hybrid EFI.
Languages
Python
68.3%
C
29.7%
Shell
1.1%
Makefile
0.4%
Dockerfile
0.3%
Other
0.2%