Today I am going to demonstrate how to flash your BIOS Chip with a Raspberry Pi and a program called flashrom
I was trying to edit my BIOS that day on my laptop so that I can get the Franxx boot logo in Darling in the Franxx, seen here
After flashing the modded BIOS, which was probably uncorrectly modded, my laptop won’t post anymore, it doesn’t even boot to the Fn+B recovery page, so I panicked a bit and contacted Metabox Support, the only thing that they can do is probably replace the BIOS chip for me which will occur a charge because I have soldered a 3G module connector on to the motherboard so that I can get 3G.
So I searched around my home to find any possible flashing tool, the only thing I can find was my Arduino and my Raspberry Pi.
Here we go!
Please carefully wire your BIOS Chip to your Raspberry Pi according to the diagram below, errors in wiring might fry your Pi or your BIOS Chip.
Installation / Compilation
There are 2 ways to install flashrom, either by compiling or from repository. I personally prefer compiling since you’ll always get the latest version.
If you want to go with the easy way, please install flashrom with
sudo apt update && sudo apt install flashrom -y
To compile flashrom, firstly you have to install its dependencies.
sudo apt install git libpci-dev libusb-1.0 libusb-dev -y
Afterwards you will need to clone the flashrom Repository
git clone https://github.com/flashrom/flashrom -b 1.0.x
Then compile flashrom with
Install the compiled binary with
sudo make install
Flashing the chip
Firstly confirm that your Raspberry Pi had successfully detected your chip with
flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=2048
It should return with your chip’s name, however, if your chip is not support, it likely will return as a generic SPI Flash chip, you can still flash it.
However, if it returned as no chip found, check your wiring
Backup the content of your chip
flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=2048 -r backup.bin
Your original firmware will be backed up to a file named backup.bin, flash the file back in an emergency.
Flash the new ROM
flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=2048 -w BIOS_mod.bin
Disconnect the Pi and test whether the new BIOS works or not.
Please do NOT power on your PC or peripherals when your Pi is still connected, it will probably fry the Pi.