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