OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Apr 23, 2024 7:21 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Your OS as BIOS replacement
PostPosted: Thu May 05, 2011 10:10 am 
Offline

Joined: Thu May 05, 2011 10:05 am
Posts: 3
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:
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:
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:
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:
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:
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:
./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
  • http://www.coreboot.org/Developer_Manual
  • http://www.coreboot.org/Payloads
  • http://www.coreboot.org/SeaBIOS
  • http://www.coreboot.org/FILO
  • http://www.coreboot.org/Libpayload
  • http://www.coreboot.org/Payload_API
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 160 times
Top
 Profile  
 
 Post subject: Re: Your OS as BIOS replacement
PostPosted: Thu May 05, 2011 1:37 pm 
Offline
Member
Member
User avatar

Joined: Fri Jun 13, 2008 3:21 pm
Posts: 1700
Location: Cambridge, United Kingdom
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 :)


Top
 Profile  
 
 Post subject: Re: Your OS as BIOS replacement
PostPosted: Thu May 05, 2011 5:21 pm 
Offline

Joined: Thu May 05, 2011 10:05 am
Posts: 3
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"


Top
 Profile  
 
 Post subject: Re: Your OS as BIOS replacement
PostPosted: Wed Jun 22, 2011 3:41 am 
Offline

Joined: Wed Jun 22, 2011 3:35 am
Posts: 1
Actually I'm trying to get coreboot working with qemu, but unsuccessfully. All I can get is:
Code:
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.


Top
 Profile  
 
 Post subject: Re: Your OS as BIOS replacement
PostPosted: Wed Oct 19, 2011 3:36 am 
Offline

Joined: Wed Oct 19, 2011 3:31 am
Posts: 1
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.

Top
 Profile  
 
 Post subject: Re: Your OS as BIOS replacement
PostPosted: Wed Oct 19, 2011 9:40 am 
Offline
Member
Member

Joined: Thu Jan 29, 2009 9:13 am
Posts: 95
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 47 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group