Reducing OS Boot Times for In-Car Computer Applications, Part III
Power down. With a Sharpie marker, mark your good BIOS with a G and the experimental BIOS chip with an X so you can tell them apart. Grab the chip tweezers tool. If there is enough clearance, put the hooks through the slots provided at the corners of the socket, press the tool against the socket and squeeze. If there isn't enough clearance to get both hooks in, unfold the tool, place one hook under one corner, press the tool against the socket and squeeze gently until the chip starts to come up. Then, move on to the other corner, then back to the first and so on. You want the chip to come out straight or it bends up the contacts.
Press the good BIOS in--make sure it is oriented correctly. It is possible to stick it in upside-down, which fries the chip. You don't have to push the chip all the way into the bottom of the socket.
Boot. You want to make sure your distro or Flash or what-not boots before you flash the BIOS.
As soon as it starts booting, you can pull the good BIOS, as it's been copied into shadow RAM. Pull it out as described above, being careful not to short out the board or break anything.
Push in the experimental BIOS.
Grab your fixed BIOS, however you choose to do that, and burn it with flash_rom from the FreeBIOS flash_and_burn directory. I found I often had to burn twice or, at least, had to wake the chip up by running flash_rom with no arguments to make it do the chip-ID stuff; I don't know why.
Reboot and see if it works.
The steps go in this order: power-up loads FreeBIOS, FreeBIOS loads a bootloader (FILO), the bootloader loads the kernel and so on. First, then, you have to build the bootloader. The FreeBIOS people like to use Etherboot, but Etherboot currently is broken as far as booting from disk goes. So, FILO is the thing to use. FILO is like GRUB, but it has no need for the BIOS.
Unpack FILO, switch to the FILO directory and run make. This creates a default config file. Edit config, then run make again to create filo.elf, which is what we use for the LinuxBIOS payload. Here's my FILO config.
Next, we need to add a video BIOS. Actually, the video BIOS on the Epia-M is pretty useless (more on this later), but it serves to let X know that we have built-in video, so in it goes.
Because the video BIOS is copyrighted by VIA and cannot be distributed independently, you have to grab it from your original BIOS. Do so in one of two ways. Either boot Linux and enter:
dd if=/dev/mem of=vgabios.bin skip=1536 count=128
or extract it from the BIOS distribution image, if you can find the offset. Cat the two together, like so:
cat vgabios.bin filo.elf > vfilo.elf
Therefore, vfilo.elf is our payload--a bootloader plus a video BIOS.
The traditional LinuxBIOS now is called FreeBIOS, as it can load things other than Linux. A new rewrite, called FreeBIOS2, doesn't appear to be ready yet. I therefore used FreeBIOS, which is available only from CVS. To get it, type:
cvs -d:pserver:email@example.com:/cvsroot/freebios login cvs -z3 -d:pserver:firstname.lastname@example.org:/cvsroot/freebios co freebios
FreeBIOS builds and configures in a separate directory, so doing a CVS update doesn't hose your existing config files. So, in the same directory as where you have /linuxbios, make a build directory by issuing mkdir build. Then, create an epia-config file; here's our epia-config file.
Notice all the full paths in that file? LinuxBIOS likes full paths. To build the BIOS, do this:
python /home/jamesh/linuxbios/freebios/util/config/NLBConfig.py epia-config/home/jamesh/linuxbios/freebios/
where /home/jamesh/linuxbios/freebios is where I put FreeBIOS. Then run make, which should produce a file called romimage. This is what you burn to your BIOS chip.
You also are going to need some utilities from the FreeBIOS folks. cd into freebios/util/mkelfImage and issue
./configure && make && make install
to get mkelfImage, which should end up in /usr/local/sbin. Then, cd into ../flash_and_burn and do make to get flash_rom. This is what you will flash your ROM with.
On a side note, some other tools are available to produce ELF kernels--don't use them. Most of them are broken, including the one from the Etherboot project that is mentioned in the HOWTOs.
Fast/Flexible Linux OS Recovery
On Demand Now
In this live one-hour webinar, learn how to enhance your existing backup strategies for complete disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible full-system recovery solution for UNIX and Linux systems.
Join Linux Journal's Shawn Powers and David Huffman, President/CEO, Storix, Inc.
Free to Linux Journal readers.Register Now!
- Petros Koutoupis' RapidDisk
- Download "Linux Management with Red Hat Satellite: Measuring Business Impact and ROI"
- The Italian Army Switches to LibreOffice
- Linux Mint 18
- Oracle vs. Google: Round 2
- The FBI and the Mozilla Foundation Lock Horns over Known Security Hole
- Varnish Software's Varnish Massive Storage Engine
- Privacy and the New Math
- Firefox 46.0 Released
Until recently, IBM’s Power Platform was looked upon as being the system that hosted IBM’s flavor of UNIX and proprietary operating system called IBM i. These servers often are found in medium-size businesses running ERP, CRM and financials for on-premise customers. By enabling the Power platform to run the Linux OS, IBM now has positioned Power to be the platform of choice for those already running Linux that are facing scalability issues, especially customers looking at analytics, big data or cloud computing.
￼Running Linux on IBM’s Power hardware offers some obvious benefits, including improved processing speed and memory bandwidth, inherent security, and simpler deployment and management. But if you look beyond the impressive architecture, you’ll also find an open ecosystem that has given rise to a strong, innovative community, as well as an inventory of system and network management applications that really help leverage the benefits offered by running Linux on Power.Get the Guide