I have a modern 64-bit CPU. Does my BIOS still operate in 16-bit REAL mode?

11

1

Since it is still required to boot, I am wondering, on a x64/AMD64 64-bit system, does the BIOS still use 16-bit instructions? Also does it operate in REAL MODE?

unixman83

Posted 2011-04-27T18:11:38.700

Reputation: 382

Wikipedia: "BIOS limitations (16-bit processor mode, only 1 MiB addressable space, PC AT hardware dependencies, etc.) were seen as clearly unacceptable for the newer computer platforms. Extensible Firmware Interface (EFI) is a specification which replaces the runtime interface of the legacy BIOS." – Daniel Beck – 2011-04-27T18:16:34.550

@Daniel Beck, I thought EFI was for Macs and the Itanium only. – unixman83 – 2011-04-27T18:24:59.553

7@unixman83 - Most new Intel motherboards are running on EFI since Sandy Bridge hit. AMD is likely to follow suit when Bulldozer hits. The real holdout has been that disks formatted with MFT are not bootable if they're bigger than 2TB...a limit that's just started to be commonly reached. You need EFI to boot off a GPT formatted disk (which can be much, much larger) – Shinrai – 2011-04-27T18:55:13.843

@unixman83: I deleted your "answer" because is not an answer, rather just a copy/paste of Shinrai's comment. – studiohack – 2011-04-27T21:22:56.817

There's nothing that stops BIOS from reading and understanding GPT, and bootloaders can also access much more than 2TB using BIOS calls, so the "need for EFI" for large disks is a (sadly widespread) myth. – Patrick Georgi – 2011-05-03T14:20:03.517

Answers

6

x86 processors still start out in real mode. BIOSes are free (and sometimes forced) to switch to protected or long modes while they initialize their hardware, but when they hand over control to the Operating System (or rather its bootloader), they have to revert back to real mode, because that's what these loaders expect the system to be in.

coreboot and UEFI switch to protected mode rather early, while for PCBIOSes (phoenix/award, ami and so on), we can't tell. They're closed source and generally don't tell much about their internals, and their interfaces are all specified as real mode.

For systems that run with ECC RAM, you can be relatively sure that they switch to some mode that's capable of addressing all RAM, so they go at least to protected mode - that's because they need to initialize the memory (write some value to each address) on boot or the system would halt if some later code reads addresses that were never written to (due to error detection that might produce a false positive). But as said, that's internal to the BIOS, and nothing that mere mortals can figure out easily or that they'd need to think about.

tl;dr: BIOS is in real mode at all points where it's externally visible, so for all intents and purposes it might just run in real mode all the time.

Patrick Georgi

Posted 2011-04-27T18:11:38.700

Reputation: 3 436

1Even the original IBM PC AT BIOS switched to protected mode for the memory test. – Yuhong Bao – 2013-02-17T05:26:20.697