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.