barebox is a bootloader that initializes hardware and boots Linux and perhaps other operating systems or bare metal code on a variety of processors. It was initially derived from U-Boot and preserves many of its features, so users familiar with U-Boot should become productive with barebox relatively quickly.
However, as the barebox developers are highly addicted to the Linux kernel, its coding style and code quality, we try to stick as closely as possible to the methodologies and techniques developed in Linux. In addition, we have a strong background in POSIX, so you'll find several good old Unix traditions implemented in barebox as well.
Most embedded Linux developers are familiar with busybox, the Swiss army knife of embedded Linux. barebox aims to be the same Swiss army knife for bare metal; hence, we call it 'barebox'.
barebox uses the the well known open/close/read/write/lseek access functions, together with a model of representing devices by files. This makes the APIs familiar to everyone who has experience with Unix systems.
We have the standard shell commands like ls/cd/mkdir/echo/cat,…
In contrast to U-Boot, barebox doesn't misuse the environment for scripting. If you start the bootloader, it gives you a shell and something that looks like a filesystem. In fact, it isn't: it is a very simple ar archive being extracted from flash into a ramdisk with 'loadenv' and stored back with 'saveenv'.
When starting up, the environment is mounted to /, followed by a device filesytem being mounted to /dev in order to make it possible to access devices. Other filesystems can be mounted on demand.
barebox follows the Linux driver model: devices can be specified in a hardware specific file, and drivers feel responsible for these devices if they have the same name.
We use the clocksource API known from Linux.
This gives us parallel builds and removes the need for lots of ifdefs.
If you develop features for barebox, you can use the 'sandbox' target which compiles barebox as a POSIX application in the Linux userspace: it can be started like a normal command and even has network access (tun/tap). Files from the local filesystem can be used to simulate devices.
There is a parameter model in barebox: each device can specify its own parameters, which do exist for every instance. Parameters can be changed on the command line with \<devid\>.\<param\>=”…”. For example, if you want to access the IPv4 address for eth0, this is done with 'eth0.ip=192.168.0.7' and 'echo $eth0.ip'.
barebox has a lightweight getopt() implementation. This makes it unnecessary to use positional parameters, which can be hard to read.
Scripts can be edited with a small integrated fullscreen editor. This editor has no features except the ones really needed: moving the cursor around, typing characters, exiting and saving.
The proper spelling of barebox is simply “barebox”; that is, not capitalized, even at the beginning of a sentence. This means that if you're writing barebox documentation, you might have to convince your spell-checker to stop capitalizing it.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA