Leandro Dorileo

Dorileo`s web place

I found these photos on flickr, people hacking coreboot. Coreboot Summit - Denver, 2008.

My table arrangement was inspired by some photos from this set. A cut basket with motherboard over it and the power supplier under. Of course my setup is a bit more organized than the the people`s in Denver(well it was a Summit).

ps: this is also a “note to myself” since I may want to show these photos to someone else;

If you want to change your remote repository to point to some arbitrary commit you cold do the following:

1
git push -f origin sha1:branchname

But be careful, you may break someone else`s repository in the case it has being fetched or cloned by someone.

Many people has bloged and written about launchpad release, I would like to be part of the crowd.

Canonical released launchpad source code.

now back to work :D

Another monday and I need to write a gsoc-update. It`s two weeks after my last update, I coulnd`t write an update last week since I hadn`t a good progress.

I suppose every body could notice the problems based on the emails I sent to the project`s mentors. I faced problems to run coreboot on my real hardware.

One week later - now - I run coreboot successfully on a real hardware. To express the happenings a bit better I need to tell a kind of story.

  • Flashed coreboot but didn`t get any vga output(did everything correctly but no vga output - now I understand I was doing all right, but wasn`t sure that time);
  • Couldn`t understand why no vga output, went to IRC and asked some questions, some one told me I needed a video rom prepended to my coreboot final image;
  • Asked Jason if he used to prepend a video rom and he confirmed, in that time I thought I should do the same;
  • Reading the coreboot wiki I learnt how to extract a video rom, not hard, but started to try to prepend it to coreboot;
  • I couldn`t understand the semantics behind ROM_SIZE, ROM_IMAGE_SIZE and few other configurations, started to test many combinations. needed to learn and understand how the many ways to build a coreboot image work;
  • Went to source code of buildrom to understand what and how it does, learned it just merges coreboot and the payload;
  • Learnt there`s no reason to have a coreboot image without a payload, so don`t even try to have a coreboot image without a payload, it doesn`t make any sense;
  • Learnt I can use cbfs to build the coreboot image, but not every targets uses it, discovered a bug on cbfstool but didn`t get the chance and time to dig on it;
  • After many tries I understood I couldn`t make any progress without a serial cable and a serial console set up, went to buy a cable and after some time I could see coreboot was being loaded but no vga output;
  • Noticed whatever payload I used it wasn`t being loaded
  • Felt weird the output on my serial console and asked Carl-Daniel to take a look, after some time trying to discover the problem Uwe Hermann appeared on IRC, he asked me if I installed my single memory module on DIMM_B1 slot;
  • I felt it so obvious, and didn`t think this could be my problem once the Award Bios was running properly;
  • Moved the memory module from DIMM_B2 to DIMM_B1 and immediately the payload was loaded and I could see vga output;
  • Uwe Hermann told me I didn`t need to prepend a vga rom to coreboot since my motherboard doesn`t have an onboard vga(in that time I wasn`t even prepending the vga rom I extracted any more, I was watching the serial outputs);
  • With Uwe Hermann help I understood I really didn`t need a vga rom
  • My real problem was a memory module installed in the wrong slot;

I need to be sure of things, so I kept asking people if I was doing the correct thing, if the way I was building coreboot was right, now I can be sure, I was even doing the right thing.

It`s not good to spend so much time on it but I learnt a lot in the process. Thank you everybody who helped me, I appreciate so much your help.

Introduction

The GSoC 2009 has officially started on May 23rd and I haven`t made any update since May 18th when I stated my hardware lacking. I finally got a functional development environment by around June 2nd(last week) when my backup LPC chip arrived to Cuiabá(my living town).

It`s a little difficult to buy some hardwares(specially some old age ones) here in my city. The only hardware I could purchase here was the processor and DDR400 memory. I had to wait about 7-10 days for the other hardwares. I also had funds problems(I didn`t have the whole money to buy everything at once). Now the PCI USB expansion card is the only lacking hardware, but I don`t think it`s blocking the project but I can buy it in the coming days.

Tasks and Code

Few things to point:

  • Option Rom Assembly Link Code:
    I`m using the source code from Darmawan, Jason has also used that. Stefan has mentioned some licensing issues, he said he would ask Darmawan to register his source code to some coreboot compatible license since we may want vendors to include the option ROM in their motherboards. Stefan also said about using his option ROM source code instead. With that I started to work with Stefan`s source code to make it work(I couldn`t run it). Jason may take it over since he`s responsible to the option ROM initialization code and assembly bits.
  • libpayload linking:
    The makefile I`ve copied/modified from FILO source base is theoretically linking the option ROM to libpayload but I couln`t call any function from libpayload yet. I`ve not spent too much time on it, I can fix it in the next days. Jason has faced this problem as well. I used FILO to complete the tests I wanted to do with libpayload API since it`s been successfully linked to libpayload.
  • bootable USB preparation:
    I worked few ours last week to prepare a bootable USB stick.

Comunication and Repos

I`ll keep posting the updates on my blog, I have a dedicated category to that, you can follow that for updates, I`ll not stop mailing all the mentors but a simple mail stating an update will be sent every week.

I would like to remember you that we(Jason and I) have used repositories on my server for hosting the source code we produce.

Update: Jason has just told me he`s rewriting the ldscript we`ve got from Darmawan. So we`ll not need to care about the licensing issues any more.

I needed to prepare a usb flash memory stick to boot, I need it to test the implementation I`m working on for my GSoC project. I recalled the things I learned when I used to be a gentoo user in 2003/2004. That time we needed to install and prepare all the system from scratch by hand, but this is one another history.

Note-1: I assume you know how to use [c]fdisk, debootstrap, chroot, and understand what a partition table means. ;-)

Note-2: These are just few notes I did while preparing my environment, it wasn`t based on some other tutorial or how-to, so you may find better tips and techniques for taking the same results;

Here we go:

1- Plug the stick and delete/create the partitions, for example;

su
cfdisk /dev/sdb2

Log in as root and create the partitions as you want.

I always use to have at least two partitions an 100Mb ext2 partition for /boot dir and the remaining space to root file system - of course it depends on your system usage.

2 - make the file systems;

mkfs.ext2 /dev/sdb1
mkfs.ext3 /dev/sdb2

I created two partitions, sdb1 the boot partition and sdb2 for root file system.

3 - mount your partitions somewhere;

mkdir /media/f-stick
mount /dev/sdb2 /media/f-stick
mkdir /media/f-stick/boot
mount /dev/sdb1 /media/f-stick/boot 
mount proc /media/f-stick/proc -t proc
mount sys /media/f-stick/sys -t sysfs

Mounted the boot and root filesystem, the proc and sysfs as well.

4 - now we have all the needed partitions mounted. Time to prepare the basic system;

apt-get install debootstrap
debootstrap sid /media/f-stick http://ftp.us.debian.org/debian/

Install debootstrap if you don`t have it already and use it to create the basic system. Please read the debootstrap`s manpage for detailed informations on its usage.

5 - chroot your brand new system and maintain it:

cp /etc/hosts /media/f-stick/etc/hosts
chroot /media/f-stick /bin/bash
apt-get install less grub linux-image-2.6-686
exit

Install some basic softwares, debootstrap will not install a linux kernel for you neither a boot loader.

6 - install grub stage1 to your stick`s mbr:

grub-install --root-directory=/media/f-stick /dev/sdb

7 - edit the device.map and leave only hd0 sdb;

vim /media/f-stick/boot/grub/device.map

8 - chroot again and set things up, like root password, add a new user, set its password and so on;

update-grub couldn`t probe the devices and define the sdb device, so it didn`t generate the menu.lst on my system, but I copied it from my main box and edited it to fit my needs.

Lucas Rocha wrote today about promoting the “Friends of Gnome”, so now I`m part of the crew, I updated the dorilex.net theme and placed a badge on top of main page - as you may have already noticed.

If you have your own blog and would like to support gnome promoting the program visit the program`s web site and learn how.

I changed my usbrom test code to print some hello world. I wasn`t patching the checksums of the PCI PnP Expansion ROM binary, that`s the why you couldn`t see the option - or it wasn`t loaded by your bios. The source code can - as usually - be browsed or cloned from here.

The option ROM I`m working on - to test the libpayload USB stack - has been updated, now it builds properly and can be used for any test purpose.

I used some source code I took from FILO to the basic infra structure, it uses kbuild and has a copy of libpayload inside the source dir. I know the focus is not an test option ROM development, but I have few things I want to change, so we can reuse the ideas for the final usb option ROM. Here follows a small TODO:

  • Remove util/kbuild and place it in a separated repository;
  • Remove libpayload;
  • Write a small shell script to checkout kbuild and libpayload before building the option ROM;

While waiting my motherboard I decided to write an option rom to test the libpayload`s usb stack implementation. I don`t know how Patrick has tested it until now but I`ve though about testing it with an option rom. It`s not working yet but you can clone it from here. It`s basically an join of sources from FILO and other things I`ve touched last weeks.

Other repositories

Now that I`ve set up an - final - environment for my personal git hosting I took some time to push some source code I`ve here in my computer. You can browse the repositories using the gitweb I`ve installed, or directly clone the invadersrom git repository - for example - by:

$ git clone http://vps.dorilex.net/pub/scm/invadersrom.git