xref: /freebsd/contrib/file/magic/Magdir/intel (revision 349cc55c9796c4596a5b9904cd3281af295f878f)
1
2#------------------------------------------------------------------------------
3# $File: intel,v 1.20 2021/04/26 15:56:00 christos Exp $
4# intel:  file(1) magic for x86 Unix
5#
6# Various flavors of x86 UNIX executable/object (other than Xenix, which
7# is in "microsoft").  DOS is in "msdos"; the ambitious soul can do
8# Windows as well.
9#
10# Windows NT belongs elsewhere, as you need x86 and MIPS and Alpha and
11# whatever comes next (HP-PA Hummingbird?).  OS/2 may also go elsewhere
12# as well, if, as, and when IBM makes it portable.
13#
14# The `versions' should be un-commented if they work for you.
15# (Was the problem just one of endianness?)
16#
170	leshort		0502		basic-16 executable
18>12	lelong		>0		not stripped
19#>22	leshort		>0		- version %d
200	leshort		0503		basic-16 executable (TV)
21>12	lelong		>0		not stripped
22#>22	leshort		>0		- version %d
230	leshort		0510		x86 executable
24>12	lelong		>0		not stripped
250	leshort		0511		x86 executable (TV)
26>12	lelong		>0		not stripped
270	leshort		=0512		iAPX 286 executable small model (COFF)
28>12	lelong		>0		not stripped
29#>22	leshort		>0		- version %d
300	leshort		=0522		iAPX 286 executable large model (COFF)
31>12	lelong		>0		not stripped
32#>22	leshort		>0		- version %d
33# updated by Joerg Jenderek at Oct 2015
34# https://de.wikipedia.org/wiki/Common_Object_File_Format
35# http://www.delorie.com/djgpp/doc/coff/filhdr.html
36# ./msdos (version 5.25) labeled the next entry as "MS Windows COFF Intel 80386 object file"
37# ./intel (version 5.25) label labeled the next entry as "80386 COFF executable"
38# SGI labeled the next entry as "iAPX 386 executable" --Dan Quinlan
390	leshort		=0514
40# use subroutine to display name+flags+variables for common object formatted files
41>0	use				display-coff
42#>12	lelong		>0		not stripped
43# no hint found, that at offset 22 is version
44#>22	leshort		>0		- version %d
450	leshort		0x0200
46>0	use				display-coff
470	leshort		0x8664
48>0	use				display-coff
49
50# rom: file(1) magic for BIOS ROM Extensions found in intel machines
51#      mapped into memory between 0xC0000 and 0xFFFFF
52# From: Alex Myczko <alex@aiei.ch>
53# updated by Joerg Jenderek
54# https://en.wikipedia.org/wiki/Option_ROM
550        beshort         0x55AA       BIOS (ia32) ROM Ext.
56!:mime	application/octet-stream
57!:ext	rom/bin
58>5       string          USB          USB
59>7       string          LDR          UNDI image
60>30      string          IBM          IBM comp. Video
61>26      string          Adaptec      Adaptec
62>28      string          Adaptec      Adaptec
63>42      string          PROMISE      Promise
64>2       byte            x            (%d*512)
65
66# Flash descriptors for Intel SPI flash roms.
67# From Dr. Jesus <j@hug.gs>
680	lelong		0x0ff0a55a	Intel serial flash for ICH/PCH ROM <= 5 or 3400 series A-step
6916	lelong		0x0ff0a55a	Intel serial flash for PCH ROM
70
71# From: 	Joerg Jenderek
72# URL:		https://en.wikipedia.org/wiki/Advanced_Configuration_and_Power_Interface
73# Reference:	https://uefi.org/sites/default/files/resources/ACPI_6_3_final_Jan30.pdf
74# Note:		generated for example by `cat /sys/firmware/acpi/tables/DSDT MyDSDT.aml`
750	string		DSDT
76>0	use		acpi-table
77# not tested or other file format
780	string		APIC
79>0	use		acpi-table
80#0	string		ASF!
81#>0	use		acpi-table
820	string		FACP
83>0	use		acpi-table
84#0	string		FACS
85#>0	use		acpi-table
860	string		MCFG
87>0	use		acpi-table
880	string		SLIC
89>0	use		acpi-table
900	string		SSDT
91>0	use		acpi-table
920	name		acpi-table
93# skip ASCII text starting with DSDT by looking for valid "low" revision
94>8	ubyte		<17	ACPI Machine Language file
95# assume that ACPI tables size are lower than 16 MiB
96#>4	ulelong		<0x01000000
97# DSDT for Differentiated System Description Table
98>>0	string		x	'%.4s'
99#!:mime	application/octet-stream
100!:mime	application/x-intel-aml
101!:ext	aml
102# the manufacture model ID like: VBOXBIOS BXDSDT
103>>16	string		>\0	%.8s
104# OEM revision of DSDT for supplied OEM Table ID like: 0 1 2 20090511
105>>>24	ulelong		x	%x
106# OEM ID like: INTEL VBOX (VirtualBox) BXDSDT (qemu) MEDION or \030\001\0\0 for s3pt.aml
107>>10	ubyte		>040	by %c
108>>>11		ubyte	>040	\b%c
109>>>>12		ubyte	>040	\b%c
110>>>>>13		ubyte	>040	\b%c
111>>>>>>14	ubyte	>040	\b%c
112>>>>>>>15	ubyte	>040	\b%c
113# This field also sets the global integer width for the AML interpreter.
114# Values less than two will cause the interpreter to use 32-bit.
115# Values of two and greater will cause the interpreter to use full 64-bit.
116# 16 for asf!.aml, 67 fo rsdp.aml
117>>8	ubyte		x	\b, revision %u
118# length, in bytes, of the entire DSDT (including the header)
119>>4	ulelong		x	\b, %u bytes
120# entire table must sum to zero
121#>>9	ubyte		x	\b, checksum %#x
122# vendor ID for the ASL Compiler like: INTL MSFT ...
123>>28	string		>\0	\b, created by %.4s
124# revision number of the ASL Compiler like: 20051117 20140724 20190703 20200110 ...
125>>>32	ulelong		x	%x
126
127