Leandro Dorileo

Dorileo`s web place

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`ve listened this song a log the last weeks…

My motherboard has arrived about two weeks ago, and the purchase of few other hadwares like processor, memory, cooler has been delayed some weeks.

I run out of credits, haven’t received my monthly payment and google hasn`t submitted the first payments, so, I don`t have enough money to buy the other hardwares, I`ll have to wait until May 21st when I receive my monthly payment.

More news coming soon….

I`ve just rearranged our git repositories, I named my preliminary and test option ROM - previously named usbrom.git - to usbrom-dlx.git.

Jason is about to set up an definitive code base option ROM and named it usbrom.git. So, don`t get confused, usbrom.git is intended to be the final usb option ROM to coreboot.

More soon…

Hoje nós do kernelnewbies-br fizemos mais uma entrevista com outro kernel hacker brasileiro, agora foi o Luiz Fernando N. Capitulino…. já está publicado no site. Prestigiem a comunidade e visitem o site.

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.

Writing down a note on WP-Syntax usage. For more detailed informations visit the plugin`s directory.

For PHP source code

<pre lang="php">
<div id="foo">
<?php
  function foo() {
    echo "Hello World!\\n";
  }
?>
</div>

Java, with line numbering

1
2
3
4
5
6
<pre lang="java" line="1">
public class Hello {
  public static void main(String[] args) {
    System.out.println("Hello World!");
  }
}

Some details

To show line numbers you have just to inform the “line” parameter and value “1″. Many languages are currently supported, just notice the differences between java5 and java, oracle8 and oracle11, php-brief and php(I need to discover, in a later time, the differences between those php highlights, I just want to note its existence).