flyonok

统计

留言簿(7)

ACE

book

boost

bsd

c study

c++

code download

codeblock

computer clound

Eclipse

embed system

erlang

ET++

gtk

ic card

java

KDE

libevent

linux

linux--MM

mysql

network education

one card

oracle

pcap relation

php

powerbuilder

python

QT

software config

software test

SQL server

UML

wireless

wxwidgets

陈宾

阅读排行榜

评论排行榜

Booting Bare Hardware

Barebox Logo

Booting a computer is always more complex than one wants to think. On the PC side, it looks as if BIOS finally is retired and replaced by EFI (I wonder which was the last OS to use BIOS for anything that just loading a secondary bootloader). On Mac, EFI has been around for a while. On embedded Linux systems, however, u-boot has been a big player for a long time.

U-boot, or das U-boot, from DENX provides many useful features: networking, basic scripting, FLASH handling and more—all the tools that your average embedded systems engineer relies on to boot, to update and to troubleshoot.

As with all software, it reaches a point where the support for existing platforms grows so large that it motivates a fresh start. Enter Barebox.

Barebox, formerly known as u-boot-v2, is a bootloader with the same goals and ambitions as u-boot, but with a new, more Linuxish, approach. This means having files, a basic shell, file system support and a driver model borrowed from Linux.

Other improvements are that the bootloader can be built as a userspace application for Linux - making it easier to develop and debug. Overall, Barebox moves u-boot away from legacy holding it back, and towards Linux to enable sharing of code and knowledge.

So, how does a Barebox session look? To an end-user, hopefully, it does not show at all. To a developer, the serial port reveals the truth.

Hit any key to stop autoboot:  2

Hitting that key, gives you a prompt:

uboot:/

And an environment:

uboot:/ ls
.       ..      dev     env

As in Linux, the dev directory contains the devices of the system. For instance, the mem device represents the memory of the computer.

Back in u-boot, there was a specific md command to show the contents of the memory. It basically looked in the memory and displayed the information. In Barebox, the same utility is implemented using a more POSIX like approach. The /dev/mem device is opened, the address is passed to lseek and the information is read. This not only improves code structure, it means that the same md command can be applied to other devices, for instance flash memories.

If you want to test this boot loader there are a few ways to go about it. First, you can download and build it for the sandbox platform. This creates a Linux userspace application that you can use for testing.

For the braver readers, it is possible to boot Barebox on a number of boards. For my part, I will try it on a BeagleBoard and an old PC.

______________________

 

Johan Thelin is a consultant working with Qt, embedded and free
software. On-line, he is known as e8johan.

posted on 2011-04-20 16:41 flyonok 阅读(403) 评论(0)  编辑 收藏 引用 所属分类: linux


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理