👢 Detect UEFI or BIOS
Tuesday 28 February 2023 5 versions

Here is how you can detect if you’ve booted your computer using a UEFI BIOS or a Legacy BIOS. First, install the dmidecode utility from your operating system repository. On Debian, you can:

1apt-get install dmidecode

dmidecode reports information related to the BIOS under a type 0 entry. A quick way to detect the BIOS mode is:

1sudo dmidecode -t 0 | grep UEFI > /dev/null && echo UEFI || echo BIOS

On a (Legacy) BIOS system you would see:

 1$ sudo dmidecode -t 0
 2# dmidecode 3.4
 3Getting SMBIOS data from sysfs.
 4SMBIOS 3.0.0 present.
 5
 6Handle 0x0000, DMI type 0, 26 bytes
 7BIOS Information
 8        Vendor: 3mdeb
 9        Version: Dasharo (coreboot+SeaBIOS) 
10        Release Date: 08/23/2022
11        ROM Size: 12 MB
12        Characteristics:
13                PCI is supported
14                PC Card (PCMCIA) is supported
15                BIOS is upgradeable
16                Selectable boot is supported
17                ACPI is supported
18                Targeted content distribution is supported
19        BIOS Revision: 0.0
20        Firmware Revision: 0.0

On a UEFI system you would see:

 1$ sudo dmidecode -t 0
 2# dmidecode 3.4
 3Getting SMBIOS data from sysfs.
 4SMBIOS 3.1.1 present.
 5
 6Handle 0x0000, DMI type 0, 26 bytes
 7BIOS Information
 8        Vendor: American Megatrends Inc.
 9        Version: 2202
10        Release Date: 07/14/2020
11        Address: 0xF0000
12        Runtime Size: 64 kB
13        ROM Size: 16 MB
14        Characteristics:
15                PCI is supported
16                APM is supported
17                BIOS is upgradeable
18                BIOS shadowing is allowed
19                Boot from CD is supported
20                Selectable boot is supported
21                BIOS ROM is socketed
22                EDD is supported
23                Print screen service is supported (int 5h)
24                8042 keyboard services are supported (int 9h)
25                Serial services are supported (int 14h)
26                Printer services are supported (int 17h)
27                ACPI is supported
28                USB legacy is supported
29                BIOS boot specification is supported
30                Targeted content distribution is supported
31                UEFI is supported
32        BIOS Revision: 5.13

#uefi #seabios #coreboot #bios 👢

See Also