Why does BIOS enable protected mode?

I was doing mit6.828 labs, and I'm quite curious about why BIOS would enable protected mode and then disable it (as bootloader should start in real mode)?


Many BIOS chips are even as big as 8-16MB before the UEFI era

The size of the BIOS, and the capacity of the ROM, EEPROM, or other media it may be stored on, has increased over time as new features have been added to the code; BIOS versions now exist with sizes up to 32 megabytes.

https://en.wikipedia.org/wiki/BIOS#Hardware

That's because nowadays BIOSes are very huge with lots of complex features like USB support, network boot, CD and DVD boot, automatic restore after BIOS failures (for dual-BIOS systems)... Some high-end BIOSes for overclockers have another way to restore BIOS even when both BIOS chips fail which probably requires another chip and FAT file system support

In the 90s I saw many BIOS setup routines (probably American Megatrends) support multiple languages including Japanese and Chinese so they also have to store the font table somewhere. That takes a lot of address space. Some modern BIOSes even contain quite extensive graphics (although not as impressive as UEFI's) and it's not possible to run those in real mode with just a few hundred KBs of RAM

Therefore most of the later BIOSes need to switch to protected mode in order to have more address space. See How can the BIOS larger than 64KB today?

You can also check out some open source boot firmware like SeaBIOS or Libreboot to see