Your OS as BIOS replacement

This forums is for OS project announcements including project openings, new releases, update notices, test requests, and job openings (both paying and volunteer).
Post Reply
XVilka
Posts: 3
Joined: Thu May 05, 2011 10:05 am

Your OS as BIOS replacement

Post by XVilka »

Good day!
I'm one of the coreboot users/developers. This is FOSS alternative to legacy BIOS/EFI. It let boot any elf image, or SeaBIOS (which provide legacy bios services).
And it's pretty small. So, as usually modern BIOS flash chips are big, you can place your tiny own OS in ROM.
As example, i'm working on booting KolibriOS from coreboot. Now it booting oveer SeaBIOS, but i'm hope exclude SeaBIOS stage from booting.

First of all - please, read our wiki http://www.coreboot.org/
Found supported hardware http://www.coreboot.org/Supported_Motherboards
and decide which you have to try coreboot, or you can use QEMU.

1. Download&configure&build:

Code: Select all

svn co svn://coreboot.org/coreboot/trunk coreboot
cd coreboot
make menuconfig
You need to choose targets->QEMU for producing image for qemu. Then run

Code: Select all

make
2. Output will be in coreboot.rom inside build directory.
3. Download vgabios image for qemu from http://www.coreboot.org/images/0/0d/Vgabios-cirrus.zip
4. You need latest qemu (0.14 or from git)
3. Copy coreboot.rom in working directory, rename it into bios.bin
Copy vgabios-cirrus.bin here also.
4. Run qemu with

Code: Select all

qemu -L . -cdrom kolibri.iso -serial stdio
where kolibri.iso is kolibrios image, but can be your own OS image. "-L ." option point qemu to directory where bios.bin and vgabios-cirrus.bin files.

here is my example image:

Code: Select all

coreboot.rom: 4096 kB, bootblocksize 1504, romsize 4194304, offset 0x0
Alignment: 64 bytes

Name                           Offset     Type         Size
cmos_layout.bin                0x0        unknown      1159
fallback/romstage              0x4c0      stage        12720
fallback/coreboot_ram          0x36c0     stage        27797
fallback/payload               0xa3c0     payload      40596
(empty)                        0x142c0    null         4110104
Also you can pack OS image in rom:
I'm using kolibri.img (floppy image):

Code: Select all

lzma -zc kolibri.img > kolibri.img.lzma
./build/cbfstool coreboot.rom add kolibri.img.lzma floppyimg/Kolibri.lzma raw
where cbfstool in build directory of coreboot tree.
you can check now result with:

Code: Select all

./build/cbfstool coreboot.rom print
Now you can also rename coreboot.rom into bios.bin for your working directory and try boot with qemu.

Also, coreboot let you boot: For additional info, please read first:
http://www.coreboot.org/FAQ For flashing your image you can use flashrom utility (http://www.flashrom.org) - please always use latest (from svn) version!!!

For debugging this on real hardware you can use SerialICE http://www.serialice.com/

I'm attaching ready image and some files from libpayload to show how-to work with coreboot specifics
Here is configs + images http://rghost.net/5482306
Attachments
coreboot.tar.gz
(53.16 KiB) Downloaded 167 times
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: Your OS as BIOS replacement

Post by Owen »

CoreBoot is an ELF based project. You wouldn't expect to be able to compile it with a Mach-O toolchain. However, I can't help but think this should have been better documented :)
XVilka
Posts: 3
Joined: Thu May 05, 2011 10:05 am

Re: Your OS as BIOS replacement

Post by XVilka »

berkus wrote:Unfortunately, the fun ended on the "make menuconfig" stage:
coreboot is trying to use gcc in xcode, this will not work
rm .xcompile ( cd util/crossgcc && ./buildgcc)
then try again "make menuconfig"
vovan
Posts: 1
Joined: Wed Jun 22, 2011 3:35 am

Re: Your OS as BIOS replacement

Post by vovan »

Actually I'm trying to get coreboot working with qemu, but unsuccessfully. All I can get is:

Code: Select all

coreboot-4.0-r6616 Wed Jun 22 11:08:00 CEST 2011 starting...
Loading image.
Check CBFS header at fffffc9e
magic is 
I've tried different option/payloads with the same result. I'd appreciate if somebody could point me to any useful info.

Regards,
Vlad.
fakiha
Posts: 1
Joined: Wed Oct 19, 2011 3:31 am

Re: Your OS as BIOS replacement

Post by fakiha »

You did a great job here. I really like it!!! It works perfectly and helped me a lot!!! levitra
Last edited by fakiha on Tue Dec 27, 2011 12:05 am, edited 1 time in total.
AndrewBuckley
Member
Member
Posts: 95
Joined: Thu Jan 29, 2009 9:13 am

Re: Your OS as BIOS replacement

Post by AndrewBuckley »

This does not really make your OS a replacement for the bios, more a boot option for coreboot. That said I really want a board with coreboot already installed for a signed bootloader feature.
Post Reply