1327e51cbSPeter Avalos 2327e51cbSPeter Avalos#------------------------------------------------------------------------------ 3*3b9cdfa3SAntonio Huete Jimenez# $File: intel,v 1.22 2022/04/02 14:47:42 christos Exp $ 4327e51cbSPeter Avalos# intel: file(1) magic for x86 Unix 5327e51cbSPeter Avalos# 6327e51cbSPeter Avalos# Various flavors of x86 UNIX executable/object (other than Xenix, which 7327e51cbSPeter Avalos# is in "microsoft"). DOS is in "msdos"; the ambitious soul can do 8327e51cbSPeter Avalos# Windows as well. 9327e51cbSPeter Avalos# 10327e51cbSPeter Avalos# Windows NT belongs elsewhere, as you need x86 and MIPS and Alpha and 11327e51cbSPeter Avalos# whatever comes next (HP-PA Hummingbird?). OS/2 may also go elsewhere 12327e51cbSPeter Avalos# as well, if, as, and when IBM makes it portable. 13327e51cbSPeter Avalos# 14327e51cbSPeter Avalos# The `versions' should be un-commented if they work for you. 15327e51cbSPeter Avalos# (Was the problem just one of endianness?) 16327e51cbSPeter Avalos# 17327e51cbSPeter Avalos0 leshort 0502 basic-16 executable 18327e51cbSPeter Avalos>12 lelong >0 not stripped 1982c5fa3eSPeter Avalos#>22 leshort >0 - version %d 20327e51cbSPeter Avalos0 leshort 0503 basic-16 executable (TV) 21327e51cbSPeter Avalos>12 lelong >0 not stripped 2282c5fa3eSPeter Avalos#>22 leshort >0 - version %d 23327e51cbSPeter Avalos0 leshort 0510 x86 executable 24327e51cbSPeter Avalos>12 lelong >0 not stripped 25327e51cbSPeter Avalos0 leshort 0511 x86 executable (TV) 26327e51cbSPeter Avalos>12 lelong >0 not stripped 27327e51cbSPeter Avalos0 leshort =0512 iAPX 286 executable small model (COFF) 28327e51cbSPeter Avalos>12 lelong >0 not stripped 2982c5fa3eSPeter Avalos#>22 leshort >0 - version %d 30327e51cbSPeter Avalos0 leshort =0522 iAPX 286 executable large model (COFF) 31327e51cbSPeter Avalos>12 lelong >0 not stripped 3282c5fa3eSPeter Avalos#>22 leshort >0 - version %d 33c30bd091SSascha Wildner# updated by Joerg Jenderek at Oct 2015 34c30bd091SSascha Wildner# https://de.wikipedia.org/wiki/Common_Object_File_Format 35c30bd091SSascha Wildner# http://www.delorie.com/djgpp/doc/coff/filhdr.html 36c30bd091SSascha Wildner# ./msdos (version 5.25) labeled the next entry as "MS Windows COFF Intel 80386 object file" 37c30bd091SSascha Wildner# ./intel (version 5.25) label labeled the next entry as "80386 COFF executable" 38327e51cbSPeter Avalos# SGI labeled the next entry as "iAPX 386 executable" --Dan Quinlan 39c30bd091SSascha Wildner0 leshort =0514 40970935fdSSascha Wildner# use subroutine to display name+flags+variables for common object formatted files 41c30bd091SSascha Wildner>0 use display-coff 42c30bd091SSascha Wildner#>12 lelong >0 not stripped 43c30bd091SSascha Wildner# no hint found, that at offset 22 is version 44c30bd091SSascha Wildner#>22 leshort >0 - version %d 456fca56fbSSascha Wildner0 leshort 0x0200 46*3b9cdfa3SAntonio Huete Jimenez# no F_EXEC flag bit implies Intel ia64 COFF object file without optional header 47*3b9cdfa3SAntonio Huete Jimenez>18 leshort ^0x0002 48*3b9cdfa3SAntonio Huete Jimenez# skip some DEGAS high-res uncompressed bitmap *.pi3 handled by ./images like 49*3b9cdfa3SAntonio Huete Jimenez# GEMINI03.PI3 MODEM2.PI3 POWERFIX.PI3 sigirl1.pi3 vanna5.pi3 50*3b9cdfa3SAntonio Huete Jimenez# by test for valid starting character (often point 0x2E) of 1st section name 51*3b9cdfa3SAntonio Huete Jimenez>>20 ubyte >0x1F 52*3b9cdfa3SAntonio Huete Jimenez>>>0 use display-coff 53*3b9cdfa3SAntonio Huete Jimenez# F_EXEC flag bit implies Intel ia64 COFF executable 54*3b9cdfa3SAntonio Huete Jimenez>18 leshort &0x0002 55*3b9cdfa3SAntonio Huete Jimenez>>0 use display-coff 566fca56fbSSascha Wildner0 leshort 0x8664 576fca56fbSSascha Wildner>0 use display-coff 58327e51cbSPeter Avalos 59327e51cbSPeter Avalos# rom: file(1) magic for BIOS ROM Extensions found in intel machines 60327e51cbSPeter Avalos# mapped into memory between 0xC0000 and 0xFFFFF 616fca56fbSSascha Wildner# From: Alex Myczko <alex@aiei.ch> 62c30bd091SSascha Wildner# updated by Joerg Jenderek 63c30bd091SSascha Wildner# https://en.wikipedia.org/wiki/Option_ROM 64*3b9cdfa3SAntonio Huete Jimenez# URL: http://fileformats.archiveteam.org/wiki/BIOS 65*3b9cdfa3SAntonio Huete Jimenez# Reference: http://www.lejabeach.com/sisubb/BIOS_Disassembly_Ninjutsu_Uncovered.pdf 66*3b9cdfa3SAntonio Huete Jimenez0 beshort 0x55AA 67*3b9cdfa3SAntonio Huete Jimenez# skip misidentified raspberry pi pieeprom-*.bin by check for 68*3b9cdfa3SAntonio Huete Jimenez# unlikely high ROM size (0xF0*512=240*512) and not observed start instruction 0x0F 69*3b9cdfa3SAntonio Huete Jimenez>2 ubeshort !0xF00F 70*3b9cdfa3SAntonio Huete Jimenez# skip 2 byte sized eof.bin with start magic 71*3b9cdfa3SAntonio Huete Jimenez>>0 use rom-x86 72*3b9cdfa3SAntonio Huete Jimenez0 name rom-x86 73*3b9cdfa3SAntonio Huete Jimenez>0 beshort x BIOS (ia32) ROM Ext. 74*3b9cdfa3SAntonio Huete Jimenez#!:mime application/octet-stream 75*3b9cdfa3SAntonio Huete Jimenez!:mime application/x-ibm-rom 76c30bd091SSascha Wildner!:ext rom/bin 77*3b9cdfa3SAntonio Huete Jimenez################################################################################ 78*3b9cdfa3SAntonio Huete Jimenez# not Plug aNd Play ($PnP) like 00000000 (ide_xtp.bin kvmvapic.bin V7VGA.ROM) 000000fc (MCT-VGA.bin) 79*3b9cdfa3SAntonio Huete Jimenez# 55aaf00f (pieeprom-*.bin) 55aa40e9 (Trm3x5.bin) 24506f4f (sgabios-bin.rom) 80*3b9cdfa3SAntonio Huete Jimenez# 55aa4be9 (vgabios-stdvga.rom vgabios-cirrus-bin.rom vgabios-vmware-bin.rom) 81*3b9cdfa3SAntonio Huete Jimenez>(26.s) ubelong !0x24506e50 82*3b9cdfa3SAntonio Huete Jimenez#>(26.s) ubelong !0x24506e50 NOT PNP=%8.8x 83*3b9cdfa3SAntonio Huete Jimenez# also not PCI (PCIR) implies "old" ISA cards or foo like: 8a168404 (MCT-VGA.bin) 84*3b9cdfa3SAntonio Huete Jimenez# 55aaf00f (pieeprom*.bin) 85*3b9cdfa3SAntonio Huete Jimenez>>(24.s) ubelong !0x50434952 86*3b9cdfa3SAntonio Huete Jimenez#>>(24.s) ubelong !0x50434952 ISA CARD=%8.8x 87*3b9cdfa3SAntonio Huete Jimenez# "old" identification strings used in file version 5.41 and earlier 88*3b9cdfa3SAntonio Huete Jimenez# probably an USB controller 89*3b9cdfa3SAntonio Huete Jimenez>>>5 string USB USB 90*3b9cdfa3SAntonio Huete Jimenez# probably https://en.wikipedia.org/wiki/Preboot_Execution_Environment 91*3b9cdfa3SAntonio Huete Jimenez>>>7 string LDR UNDI image 92*3b9cdfa3SAntonio Huete Jimenez# probably another Adaptec SCSI controller 93*3b9cdfa3SAntonio Huete Jimenez>>>26 string Adaptec Adaptec 94*3b9cdfa3SAntonio Huete Jimenez# http://minuszerodegrees.net/rom/bin/adaptec_aha1542cp_bios_908501-00.bin 95*3b9cdfa3SAntonio Huete Jimenez# already done by PNP variant 96*3b9cdfa3SAntonio Huete Jimenez#>>>28 string Adaptec Adaptec 97*3b9cdfa3SAntonio Huete Jimenez# probably Promise SCSI controller 98*3b9cdfa3SAntonio Huete Jimenez>>>42 string PROMISE Promise 99*3b9cdfa3SAntonio Huete Jimenez# old test for IBM compatible Video cards; INTERNAL FACTS WHY IS THIS WORKING? 100327e51cbSPeter Avalos>30 string IBM IBM comp. Video 101*3b9cdfa3SAntonio Huete Jimenez# display exact text for IBM compatible Video cards with longer text 102*3b9cdfa3SAntonio Huete Jimenez>>33 ubyte !0 103*3b9cdfa3SAntonio Huete Jimenez>>>30 string x "%s" 104*3b9cdfa3SAntonio Huete Jimenez# http://minuszerodegrees.net/rom/bin/unknown/MCT-VGA-16%20-%20TDVGA%203588%20BIOS%20Version%20V1.04A.zip 105*3b9cdfa3SAntonio Huete Jimenez# "IBM COMPATIBLETDVGA 3588 BIOS Version V1.04A2+" "MCT-VGA-16 - TDVGA 3588 BIOS Version V1.04A.bin" 106*3b9cdfa3SAntonio Huete Jimenez# "IBM VGA Compatible\001" NVidia44.bin 107*3b9cdfa3SAntonio Huete Jimenez# "IBM EGA ROM Video Seven BIOS Code, Version 1.04" V7VGA.ROM 108*3b9cdfa3SAntonio Huete Jimenez# "IBM" vgabios-stdvga.rom 109*3b9cdfa3SAntonio Huete Jimenez# "IBM" vgabios-vmware-bin.rom: 110*3b9cdfa3SAntonio Huete Jimenez# "IBM" vgabios-cirrus-bin.rom 111*3b9cdfa3SAntonio Huete Jimenez# "IBM" vgabios-virtio-bin.rom 112*3b9cdfa3SAntonio Huete Jimenez################################################################################ 113*3b9cdfa3SAntonio Huete Jimenez# ROM size in 512B blocks must be interpreted as unsigned for ROM of network cards 114*3b9cdfa3SAntonio Huete Jimenez# like: efi-eepro100.rom efi-rtl8139.rom pxe-e1000.rom 115*3b9cdfa3SAntonio Huete Jimenez>2 ubyte x (%u*512) 116*3b9cdfa3SAntonio Huete Jimenez# file name file size calculated size remark 117*3b9cdfa3SAntonio Huete Jimenez# eof.bin 2 - with start magic nothing is shown here 118*3b9cdfa3SAntonio Huete Jimenez# orchid.bin 188 0 =0*512 on window 95 CD in Drivers\audio\orchid3d 119*3b9cdfa3SAntonio Huete Jimenez# multiboot.bin 1024 1024 =2*512 QEMU emulator 120*3b9cdfa3SAntonio Huete Jimenez# loader1.bin 512 2048 =4*512 121*3b9cdfa3SAntonio Huete Jimenez# ide_xtp.bin 8192 8192 =16*512 122*3b9cdfa3SAntonio Huete Jimenez# kvmvapic.bin 9216 9216 =18*512 123*3b9cdfa3SAntonio Huete Jimenez# V7VGA.ROM 18832 16384 =32*512 124*3b9cdfa3SAntonio Huete Jimenez# adaptec1542.bin 32768 16384 =32*512 125*3b9cdfa3SAntonio Huete Jimenez# MCT-VGA.bin 32768 24576 =48*512 126*3b9cdfa3SAntonio Huete Jimenez# 2975BIOS.BIN 32768 32256 =63*512 127*3b9cdfa3SAntonio Huete Jimenez# efi-e1000.rom 196608 64000 =125*512 128*3b9cdfa3SAntonio Huete Jimenez# efi-rtl8139.rom 176640 66048 =129*512 129*3b9cdfa3SAntonio Huete Jimenez# pieeprom*.bin 524288 122880 =240*512 130*3b9cdfa3SAntonio Huete Jimenez################################################################################ 131*3b9cdfa3SAntonio Huete Jimenez# initialization vector with executable code; often near JuMP instruction E9 yy zz 132*3b9cdfa3SAntonio Huete Jimenez>3 ubyte =0xE9 jmp 133*3b9cdfa3SAntonio Huete Jimenez# jmp offset like: 008fh 0093h 009fh 00afh 0143h 3ad7h 5417h 54ech 594dh 895fh 134*3b9cdfa3SAntonio Huete Jimenez>>4 uleshort x %#4.4x 135*3b9cdfa3SAntonio Huete Jimenez# for initialization vector samples without 3 byte jump instruction 136*3b9cdfa3SAntonio Huete Jimenez>3 ubyte !0xE9 instruction 137*3b9cdfa3SAntonio Huete Jimenez# eb4b3734h NVidia44.bin 138*3b9cdfa3SAntonio Huete Jimenez# 00003234h V7VGA.ROM 139*3b9cdfa3SAntonio Huete Jimenez# 060e0731h kvmvapic.bin 140*3b9cdfa3SAntonio Huete Jimenez# cb000000h linuxboot-bin.rom 141*3b9cdfa3SAntonio Huete Jimenez# e80d0fcbh PXE-Intel.rom 142*3b9cdfa3SAntonio Huete Jimenez# b8004875h orchid.bin 143*3b9cdfa3SAntonio Huete Jimenez>>3 ubelong x %#8.8x 144*3b9cdfa3SAntonio Huete Jimenez# For misidetified raspberry pi pieeprom-*.bin like: 0xf00f 145*3b9cdfa3SAntonio Huete Jimenez#>2 ubeshort x \b, AT 2 %#4.4x 146*3b9cdfa3SAntonio Huete Jimenez################################################################################ 147*3b9cdfa3SAntonio Huete Jimenez# new sections for BIOS (ia32) ROM Extension 148*3b9cdfa3SAntonio Huete Jimenez# 4 bytes ASCII Signature "$PnP" for Plug aNd Play expansion header 149*3b9cdfa3SAntonio Huete Jimenez>(26.s) string =$PnP \b; 150*3b9cdfa3SAntonio Huete Jimenez#>(26.s) string =$PnP FOUND $PnP 151*3b9cdfa3SAntonio Huete Jimenez# at 1Ah possible offset to expansion header structure; new for Plug aNd Play 152*3b9cdfa3SAntonio Huete Jimenez>>26 uleshort x at %#x PNP 153*3b9cdfa3SAntonio Huete Jimenez# Plug and Play vendor+device ID like: 0 0x000f1000 (2975BIOS.BIN) 0x31121095 (4243.bin) 0x04904215 (adaptec1542.bin) 154*3b9cdfa3SAntonio Huete Jimenez#>>(26.s+0x0A) ulelong !0 NOT-nullID=%8.8x 155*3b9cdfa3SAntonio Huete Jimenez>>(26.s+0x0A) uleshort !0 156*3b9cdfa3SAntonio Huete Jimenez# show PnP Vendor identification in human readable text form instead of numeric 157*3b9cdfa3SAntonio Huete Jimenez# For adaptec_ava1515_bios_585201-00.bin reverted endian! BUT IS THIS ALWAYS TRUE? 158*3b9cdfa3SAntonio Huete Jimenez>>>(26.s+0x0C) use \^PCI-vendor 159*3b9cdfa3SAntonio Huete Jimenez>>>(26.s+0x0A) ubeshort x device=%#4.4x 160*3b9cdfa3SAntonio Huete Jimenez# 3 byte Device type code; probably the same meaning as in PCI section? 161*3b9cdfa3SAntonio Huete Jimenez# OK for storage controller SCSI (2975BIOS.BIN adaptec1542.bin) 162*3b9cdfa3SAntonio Huete Jimenez# and network controller ethernet (efi-e1000.rom efi-rtl8139.rom) 163*3b9cdfa3SAntonio Huete Jimenez>>(26.s+0x12) use PCI-class 164*3b9cdfa3SAntonio Huete Jimenez# structure revision like: 01h 165*3b9cdfa3SAntonio Huete Jimenez>>(26.s+4) ubyte !1 \b, revision %u 166*3b9cdfa3SAntonio Huete Jimenez# PnP Header structure length in multiple of 16 bytes like: 2 167*3b9cdfa3SAntonio Huete Jimenez>>(26.s+5) uleshort !2 \b, length %u*16 168*3b9cdfa3SAntonio Huete Jimenez# offset to next header; 0 if none 169*3b9cdfa3SAntonio Huete Jimenez>>(26.s+7) uleshort !0 \b, at %#x next header 170*3b9cdfa3SAntonio Huete Jimenez# reserved byte; seems to be zero 171*3b9cdfa3SAntonio Huete Jimenez>>(26.s+8) ubyte !0 \b, reserved %#x 172*3b9cdfa3SAntonio Huete Jimenez# 8-bit checksum for this header; calculated and patched by patch2pnprom 173*3b9cdfa3SAntonio Huete Jimenez>>(26.s+9) ubyte !0 \b, CRC %#x 174*3b9cdfa3SAntonio Huete Jimenez# pointer to optional manufacturer string; like: 0 (4243.bin) 59h 5ch 60h c7h 14eh 27ch 296h 324h 3662h 175*3b9cdfa3SAntonio Huete Jimenez>>(26.s+0x0E) uleshort >0 \b, at %#x 176*3b9cdfa3SAntonio Huete Jimenez>>>(26.s+0x0C) uleshort x 177*3b9cdfa3SAntonio Huete Jimenez# manufacturer ASCII-Z string like "http://ipxe.org" "Plop - Elmar Hanlhofer www.plop.at" "QEMU" 178*3b9cdfa3SAntonio Huete Jimenez>>>>(&0.s) string x "%s" 179*3b9cdfa3SAntonio Huete Jimenez# pointer to optional product string; like: 0 (2975BIOS.BIN) 6ch 70h 7ch d9h 160h 281h 29bh 329h 180*3b9cdfa3SAntonio Huete Jimenez>>(26.s+0x10) uleshort >0 \b, at %#x 181*3b9cdfa3SAntonio Huete Jimenez>>>(26.s+0x0E) uleshort x 182*3b9cdfa3SAntonio Huete Jimenez# often human readable product ASCII-Z string like "iPXE" "Plop Boot Manager" 183*3b9cdfa3SAntonio Huete Jimenez# "multiboot loader" "Intel UNDI, PXE-2.0 (build 082)" 184*3b9cdfa3SAntonio Huete Jimenez>>>>(&0.s) string x "%s" 185*3b9cdfa3SAntonio Huete Jimenez# PnP Device indicators; contains bits that identify the device as being capable of bootable 186*3b9cdfa3SAntonio Huete Jimenez#>>(26.s+0x15) ubyte x \b, INDICATORS %#x 187*3b9cdfa3SAntonio Huete Jimenez# device is a display device 188*3b9cdfa3SAntonio Huete Jimenez>>(26.s+0x15) ubyte &0x01 \b, display 189*3b9cdfa3SAntonio Huete Jimenez# device is an input device 190*3b9cdfa3SAntonio Huete Jimenez>>(26.s+0x15) ubyte &0x02 \b, input 191*3b9cdfa3SAntonio Huete Jimenez# device is an IPL device 192*3b9cdfa3SAntonio Huete Jimenez>>(26.s+0x15) ubyte &0x04 \b, IPL 193*3b9cdfa3SAntonio Huete Jimenez#>>(26.s+0x15) ubyte &0x08 reserved 194*3b9cdfa3SAntonio Huete Jimenez# ROM is only required if this device is selected as a boot device 195*3b9cdfa3SAntonio Huete Jimenez>>(26.s+0x15) ubyte &0x10 \b, bootable 196*3b9cdfa3SAntonio Huete Jimenez# indicates ROM is read cacheable 197*3b9cdfa3SAntonio Huete Jimenez>>(26.s+0x15) ubyte &0x20 \b, cacheable 198*3b9cdfa3SAntonio Huete Jimenez# ROM may be shadowed in RAM 199*3b9cdfa3SAntonio Huete Jimenez>>(26.s+0x15) ubyte &0x40 \b, shadowable 200*3b9cdfa3SAntonio Huete Jimenez# ROM supports the device driver initialization model 201*3b9cdfa3SAntonio Huete Jimenez>>(26.s+0x15) ubyte &0x80 \b, InitialModel 202*3b9cdfa3SAntonio Huete Jimenez# boot connection vector; an offset to a routine that hook into INT 9h, INT 10h, or INT 13h 203*3b9cdfa3SAntonio Huete Jimenez# 0 means disabled 0x0429 (4650_sr5.bin) 0x0072 (adaptec1542.bin) 204*3b9cdfa3SAntonio Huete Jimenez>>(26.s+0x16) uleshort !0 \b, boot vector offset %#x 205*3b9cdfa3SAntonio Huete Jimenez# disconnect vector; offset to routine that do cleanup from an unsuccessful boot attempt 206*3b9cdfa3SAntonio Huete Jimenez>>(26.s+0x18) uleshort !0 \b, disconnect offset %#x 207*3b9cdfa3SAntonio Huete Jimenez# bootstrap entry point/vector (BEV); offset to a routine (like RPL) that hook into INT 19h 208*3b9cdfa3SAntonio Huete Jimenez# 0 means disabled 0x3c (multiboot.bin) 0x358 (efi-rtl8139.rom) 0xae7 (PXE-Intel.rom) 209*3b9cdfa3SAntonio Huete Jimenez>>(26.s+0x1A) uleshort !0 \b, bootstrap offset %#x 210*3b9cdfa3SAntonio Huete Jimenez# 2nd reserved area; seems to be zero 211*3b9cdfa3SAntonio Huete Jimenez>>(26.s+0x1C) uleshort !0 \b, 2nd reserved %#x 212*3b9cdfa3SAntonio Huete Jimenez# static resource information vector; 0 means disabled 213*3b9cdfa3SAntonio Huete Jimenez>>(26.s+0x1E) uleshort !0 \b, static offset %#4.4x 214*3b9cdfa3SAntonio Huete Jimenez################################################################################ 215*3b9cdfa3SAntonio Huete Jimenez# 4 bytes ASCII Signature "PCIR" for PCI Data Structure 216*3b9cdfa3SAntonio Huete Jimenez#>(24.s) string =PCIR FOUND PCIR 217*3b9cdfa3SAntonio Huete Jimenez>(24.s) string =PCIR \b; 218*3b9cdfa3SAntonio Huete Jimenez# pointer to PCI data structure like: 1Ch 38h 104h 8E44h 219*3b9cdfa3SAntonio Huete Jimenez>>24 uleshort x at %#x PCI 220*3b9cdfa3SAntonio Huete Jimenez# Vendor identification (ID) https://pci-ids.ucw.cz/v2.2/pci.ids 221*3b9cdfa3SAntonio Huete Jimenez#>>(24.s+4) uleshort x ID=%4.4x 222*3b9cdfa3SAntonio Huete Jimenez# show Vendor identification in human readable text form instead of numeric 223*3b9cdfa3SAntonio Huete Jimenez>>(24.s+4) use PCI-vendor 224*3b9cdfa3SAntonio Huete Jimenez# device identification (ID) 225*3b9cdfa3SAntonio Huete Jimenez>>(24.s+6) uleshort x device=%#4.4x 226*3b9cdfa3SAntonio Huete Jimenez# Base+sub class code https://wiki.osdev.org/PCI 227*3b9cdfa3SAntonio Huete Jimenez>>(24.s+0x0D) use PCI-class 228*3b9cdfa3SAntonio Huete Jimenez# pointer to vital product data (VPD); 0 indicates no VPD; WHAT EXACTLY iS VPD? 229*3b9cdfa3SAntonio Huete Jimenez>>(24.s+8) uleshort !0 \b, at %#x VPD 230*3b9cdfa3SAntonio Huete Jimenez# PCI data structure length like: 24h 28h 231*3b9cdfa3SAntonio Huete Jimenez>>(24.s+0xA) uleshort >0x28 \b, length %u 232*3b9cdfa3SAntonio Huete Jimenez# PCI data structure revision like: 0 3 233*3b9cdfa3SAntonio Huete Jimenez>>(24.s+0xC) ubyte >0 \b, revison %u 234*3b9cdfa3SAntonio Huete Jimenez# image length (hexadecimal) in multiple of 512 bytes like: 54 56 68 6a 76 78 7c 7d 7e 7f 80 81 83 235*3b9cdfa3SAntonio Huete Jimenez# Apparently this gives the same information as given by byte at offset 2 but as 16-bit 236*3b9cdfa3SAntonio Huete Jimenez#>>(24.s+0x10) uleshort x \b, length %u*512 237*3b9cdfa3SAntonio Huete Jimenez# revision level of code/data like: 0 1 201h 502h 238*3b9cdfa3SAntonio Huete Jimenez>>(24.s+0xC) ubyte >1 \b, code revison %#x 239*3b9cdfa3SAntonio Huete Jimenez# code type: 0~Intel x86/PC-AT compatible 1~Open firmware standard for PCI42 FF~Reserved 240*3b9cdfa3SAntonio Huete Jimenez>>(24.s+0x14) ubyte >0 \b, code type %#x 241*3b9cdfa3SAntonio Huete Jimenez# last image indicator; bit 7 indicates "last image"; bits 0-6 are reserved 242*3b9cdfa3SAntonio Huete Jimenez>>(24.s+0x15) ubyte >0 243*3b9cdfa3SAntonio Huete Jimenez>>>(24.s+0x15) ubyte =0x80 \b, last ROM 244*3b9cdfa3SAntonio Huete Jimenez# THIS SHOULD NOT HAPPEN! 245*3b9cdfa3SAntonio Huete Jimenez>>>(24.s+0x15) ubyte !0x80 \b, indicator %x 246*3b9cdfa3SAntonio Huete Jimenez# 3rd reserved area; seems to be zero in most cases but not for 247*3b9cdfa3SAntonio Huete Jimenez# efi-e1000.rom efi-rtl8139.rom 248*3b9cdfa3SAntonio Huete Jimenez>>(24.s+0x16) ubeshort !0 \b, 3rd reserved %#x 249ff91a668SPeter Avalos 250ff91a668SPeter Avalos# Flash descriptors for Intel SPI flash roms. 251ff91a668SPeter Avalos# From Dr. Jesus <j@hug.gs> 252ff91a668SPeter Avalos0 lelong 0x0ff0a55a Intel serial flash for ICH/PCH ROM <= 5 or 3400 series A-step 253ff91a668SPeter Avalos16 lelong 0x0ff0a55a Intel serial flash for PCH ROM 254c990e5baSDaniel Fojt 255c990e5baSDaniel Fojt# From: Joerg Jenderek 256c990e5baSDaniel Fojt# URL: https://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface 257c990e5baSDaniel Fojt# Reference: https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf 258c990e5baSDaniel Fojt# Note: generated for example by `cat /sys/firmware/acpi/tables/DSDT MyDSDT.aml` 259c990e5baSDaniel Fojt0 string DSDT 260c990e5baSDaniel Fojt>0 use acpi-table 261c990e5baSDaniel Fojt# not tested or other file format 262c990e5baSDaniel Fojt0 string APIC 263c990e5baSDaniel Fojt>0 use acpi-table 264c990e5baSDaniel Fojt#0 string ASF! 265c990e5baSDaniel Fojt#>0 use acpi-table 266c990e5baSDaniel Fojt0 string FACP 267c990e5baSDaniel Fojt>0 use acpi-table 268c990e5baSDaniel Fojt#0 string FACS 269c990e5baSDaniel Fojt#>0 use acpi-table 270c990e5baSDaniel Fojt0 string MCFG 271c990e5baSDaniel Fojt>0 use acpi-table 272c990e5baSDaniel Fojt0 string SLIC 273c990e5baSDaniel Fojt>0 use acpi-table 274c990e5baSDaniel Fojt0 string SSDT 275c990e5baSDaniel Fojt>0 use acpi-table 276c990e5baSDaniel Fojt0 name acpi-table 277c990e5baSDaniel Fojt# skip ASCII text starting with DSDT by looking for valid "low" revision 278c990e5baSDaniel Fojt>8 ubyte <17 ACPI Machine Language file 279c990e5baSDaniel Fojt# assume that ACPI tables size are lower than 16 MiB 280c990e5baSDaniel Fojt#>4 ulelong <0x01000000 281c990e5baSDaniel Fojt# DSDT for Differentiated System Description Table 282c990e5baSDaniel Fojt>>0 string x '%.4s' 283c990e5baSDaniel Fojt#!:mime application/octet-stream 284c990e5baSDaniel Fojt!:mime application/x-intel-aml 285c990e5baSDaniel Fojt!:ext aml 286c990e5baSDaniel Fojt# the manufacture model ID like: VBOXBIOS BXDSDT 287c990e5baSDaniel Fojt>>16 string >\0 %.8s 288c990e5baSDaniel Fojt# OEM revision of DSDT for supplied OEM Table ID like: 0 1 2 20090511 289c990e5baSDaniel Fojt>>>24 ulelong x %x 290c990e5baSDaniel Fojt# OEM ID like: INTEL VBOX (VirtualBox) BXDSDT (qemu) MEDION or \030\001\0\0 for s3pt.aml 291c990e5baSDaniel Fojt>>10 ubyte >040 by %c 292c990e5baSDaniel Fojt>>>11 ubyte >040 \b%c 293c990e5baSDaniel Fojt>>>>12 ubyte >040 \b%c 294c990e5baSDaniel Fojt>>>>>13 ubyte >040 \b%c 295c990e5baSDaniel Fojt>>>>>>14 ubyte >040 \b%c 296c990e5baSDaniel Fojt>>>>>>>15 ubyte >040 \b%c 297c990e5baSDaniel Fojt# This field also sets the global integer width for the AML interpreter. 298c990e5baSDaniel Fojt# Values less than two will cause the interpreter to use 32-bit. 299c990e5baSDaniel Fojt# Values of two and greater will cause the interpreter to use full 64-bit. 300c990e5baSDaniel Fojt# 16 for asf!.aml, 67 fo rsdp.aml 301c990e5baSDaniel Fojt>>8 ubyte x \b, revision %u 302c990e5baSDaniel Fojt# length, in bytes, of the entire DSDT (including the header) 303c990e5baSDaniel Fojt>>4 ulelong x \b, %u bytes 304c990e5baSDaniel Fojt# entire table must sum to zero 305614728caSSascha Wildner#>>9 ubyte x \b, checksum %#x 306c990e5baSDaniel Fojt# vendor ID for the ASL Compiler like: INTL MSFT ... 307c990e5baSDaniel Fojt>>28 string >\0 \b, created by %.4s 308c990e5baSDaniel Fojt# revision number of the ASL Compiler like: 20051117 20140724 20190703 20200110 ... 309c990e5baSDaniel Fojt>>>32 ulelong x %x 310c990e5baSDaniel Fojt 311