0
votes

Is it possible to flash/write to a BIOS from kernel mode in Linux?

I've been doing some research on this and can't find a definitive answer to this. I'm not so great with kernel level stuff and hardware.

From what I've been able to find, I know certain kernel facilities can interrogate the BIOS (see dmidecode) given the BIOS supports certain interfaces.

I know the difference between real and protected mode. But switching to real mode from Linux seems impossible to do (?). I also know x86 has emulation for 8088 programs but unsure whether the emulation would allow flashing the BIOS.

Wouldn't it be possible to just write to certain addresses in kernel mode to "flash" the BIOS?


Update Working from the answer and comments below it seems the answer is yes depending on the hardware platform. The only, and necessary requirement is that the BIOS flash chip is addressable in the IO address space. You also need software support fir flashing chips, whether kernel or user space. For example I found the user space utility flashrom that can do it on what seems to be a narrow set of hardware platforms.

1
instead of writing a para, you can mention in distinct lines - Vikrant
Sorry what are you saying? - user3279360
Which BIOS, what platform ? - stdcall
@stdcall; Any BIOS, x86 In general. If it is platform dependent, what platforms support it, which don't and how and why? - user3279360
The BIOS is not x86 generic, it's specific to mother board manufactor there are several, AMIBIOS, SeaBIOS, etc. - stdcall

1 Answers

2
votes

Yes, you can do that if BIOS flash chip is connected to the IO address bus and you have all necessary drivers.