flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Projects and Ideas > Your tiny OS as BIOS replacement

Author
Thread Post new topic Reply to topic
XVilka



Joined: 04 May 2011
Posts: 42
Location: Russia
Your tiny OS as BIOS replacement
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:

Code:

Mainboard -> Mainboard Vendor -> Emulation 
Mainboard -> Mainboard Model -> QEMU x86



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.rom4096 kBbootblocksize 1504romsize 4194304offset 0x0
Alignment64 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


Description:
Download
Filename: coreboot.tar.gz
Filesize: 53.16 KB
Downloaded: 160 Time(s)

Description:
Download
Filename: kolibri-coreboot.tar.gz
Filesize: 102.47 KB
Downloaded: 158 Time(s)



Last edited by XVilka on 08 Aug 2011, 23:59; edited 2 times in total
Post 04 May 2011, 02:10
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1598
Location: web
Nice project XVilka, i will try and get DexOS to boot from coreboot.
Post 04 May 2011, 21:04
View user's profile Send private message Reply with quote
TmX



Joined: 02 Mar 2006
Posts: 676
Location: Jakarta, Indonesia
How to choose targets->QEMU?

Image

I'm on revision 6637.
Post 25 Jun 2011, 17:36
View user's profile Send private message Reply with quote
XVilka



Joined: 04 May 2011
Posts: 42
Location: Russia
Mainboard -> Mainboard Vendor -> Emulation
Mainboard -> Mainboard Model -> QEMU x86
Post 05 Jul 2011, 20:16
View user's profile Send private message Visit poster's website Reply with quote
Flat12



Joined: 25 Jan 2013
Posts: 5
ROM OS Protected Mode
Floppy image OS support only SeaBIOS. The OS can be also run using the ISA or PCI option rom. In article is PCI Option ROM but this way require use PCI NIC or SCSI card. I made a patch in loader1.asm to possible boot over ISA Option ROM (PnP). Tested on real hardware with AWARD BIOS and coreboot+SeaBIOS, Qemu+SeaBIOS, MS VPC 2007. Code is for NASM not FASM assembler.
P.S. On AWARD 6.00PG bios to run this ISA option rom we need disable all boot devices in CMOS Setup. This works like old IBM PC with IBM-BASIC ROM - if no more boot devices found run BASIC-ROM. On AWARD - if no more boot devices found run ISA PnP Option ROM.
Link -> ISA Option ROM on AWARD bios


Description:
Filesize: 14.32 KB
Viewed: 867 Time(s)

qemu.gif


Description:
Download
Filename: isa_exp_rom_os.tar.gz
Filesize: 25.99 KB
Downloaded: 47 Time(s)

Post 03 Jan 2014, 22:48
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
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 vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2013, Tomasz Grysztar.