1. COMPANY
  2. PRODUCTS
  3. SERVICES
  4. NEWS
  5. CONTACT
  6. SHOP

Debugging coreboot in qemu environment - part 1

First of all I use testing version of Debian - wheezy. Clone coreboot repository:

1
2
git clone http://review.coreboot.org/p/coreboot
cd coreboot; make menuconfig

Configure FILO as apayload and use its latest version:

1
Payload -> Add a payload -> FILO Payload -> FILO version -> HEAD

Add verbose debugging messages:

1
2
3
Debugging -> Check PIRQ table consistency Debugging -> Output verbose malloc debug messages
Debugging -> Output verbose ACPI debug messages Debugging -> Enable debug messages for option ROM execution
Debugging -> Built-in low-level shell Debugging -> Trace function calls

Try to build:

1
make

If everything builds correctly you can process. Sometimes there is need to use cross compiler. To build one:

1
2
cd util/crossgcc
./buildgcc

To explore coreboot code effectively I suggest to create tags and cscope database for coreboot. In my personal workspace I’ve got process that I go through before I start work (if you use my workspace configuration which is available @github you can follow below steps directly, if not adjust to your environment):

  1. run vim ;)
  2. :cd /path/to/code
  3. s<Tab> (fuzzyfinder -> bookmark dir)
  4. si (fuzzyfinder -> change dir)
  5. sr (run ctags to generate tags and cscope to build symbol database - ctags -R;cscope -R -q -b -v)

After steps above we can start work with code. Run vim in coreboot directory. Type: :e src/cpu/x86/16bit/reset16.inc Put cursor over protected_start and press Ctrl-]. If everything goes ok you should jump to build/mainboard/emulation/qemu-x86/bootblock.s line 537. In second article we dive into first phase of coreboot execution in emulated environment.


Piotr Król
Founder and Embedded Systems Consultant at 3mdeb as well as CTO of vitroTV. Passionate about building firmware that enables advanced hardware features in modern products. Dedicated to customers that treat embedded software security and upgradability as forethought. In favor of fixed price projects with the clear definition of success. Available as freelance CTO for startups and small business.




Archives

2019 (20)
2018 (16)
2017 (12)
2016 (10)
2015 (8)
2014 (6)
2013 (14)
2012 (24)