官术网_书友最值得收藏!

Barebox

I will complete this chapter with a look at another bootloader that has the same roots as U-Boot but takes a new approach to bootloaders. It is derived from U-Boot and was actually called U-Boot v2 in the early days. The Barebox developers aimed to combine the best parts of U-Boot and Linux, including a POSIX-like API and mountable filesystems.

The Barebox project website is mailing list is .

Getting Barebox

To get Barebox, clone the git repository and check out the version you want to use:

$ git clone git://git.pengutronix.de/git/barebox.git
$ cd barebox
$ git checkout v2014.12.0

The layout of the code is similar to U-Boot:

  • arch: Contains code specific to each supported architecture, which includes all the major embedded architectures. SoC support is in arch/[architecture]/mach-[SoC]. Support for individual boards is in arch/[architecture]/boards.
  • common: Contains core functions, including the shell.
  • commands: Contains the commands that can be called from the shell.
  • Documentation: Contains the templates for documentation files. To build it, type "make docs". The results are put in Documentation/html.
  • drivers: Contains the code for the device drivers.
  • include: Contains header files.

Building Barebox

Barebox has used kconfig/kbuild for a long time. There are default configuration files in arch/[architecture]/configs. As an example, assume that you want to build Barebox for the BeagleBoard C4. You need two configurations, one for the SPL, and one for the main binary. Firstly, build MLO:

$ make ARCH=arm CROSS_COMPILE=arm-cortex_a8-linux-gnueabi- omap3530_beagle_xload_defconfig
$ make ARCH=arm CROSS_COMPILE=arm-cortex_a8-linux-gnueabi-

The result is the secondary program loader, MLO.

Next, build Barebox:

$ make ARCH=arm CROSS_COMPILE=arm-cortex_a8-linux-gnueabi- omap3530_beagle_defconfig
$ make ARCH=arm CROSS_COMPILE=arm-cortex_a8-linux-gnueabi-

Copy both to an SD card:

$ cp MLO /media/boot/
$ cp barebox-flash-image /media/boot/barebox.bin

Then, boot up the board and you should see messages like these on the console:

barebox 2014.12.0 #1 Wed Dec 31 11:04:39 GMT 2014

Board: Texas Instruments beagle
nand: Trying ONFI probe in 16 bits mode, aborting !
nand: NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba (Micron ), 256MiB, page
size: 2048, OOB size: 64
omap-hsmmc omap3-hsmmc0: registered as omap3-hsmmc0
mci0: detected SD card version 2.0
mci0: registered disk0
malloc space: 0x87bff400 -> 0x87fff3ff (size 4 MiB)
booting from MMC

barebox 2014.12.0 #2 Wed Dec 31 11:08:59 GMT 2014

Board: Texas Instruments beagle
netconsole: registered as netconsole-1
i2c-omap i2c-omap30: bus 0 rev3.3 at 100 kHz
ehci ehci0: USB EHCI 1.00
nand: Trying ONFI probe in 16 bits mode, aborting !
nand: NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba (Micron NAND 256MiB 1,8V
16-bit), 256MiB, page size: 2048, OOB size: 64
omap-hsmmc omap3-hsmmc0: registered as omap3-hsmmc0
mci0: detected SD card version 2.0
mci0: registered disk0
malloc space: 0x85e00000 -> 0x87dfffff (size 32 MiB)
environment load /boot/barebox.env: No such file or directory
Maybe you have to create the partition.
no valid environment found on /boot/barebox.env. Using default environment
running /env/bin/init...

Hit any key to stop autoboot: 0

Barebox is continuing to evolve. At the time of writing, it lacks the breadth of hardware support that U-Boot has, but it is worth considering for new projects.

主站蜘蛛池模板: 芮城县| 宣威市| 体育| 图片| 开封县| 陵川县| 托里县| 中山市| 政和县| 高雄县| 永川市| 黑水县| 富锦市| 那曲县| 驻马店市| 奉化市| 六盘水市| 阿拉善右旗| 乳源| 休宁县| 曲松县| 固安县| 神农架林区| 天全县| 隆子县| 兴义市| 十堰市| 绥芬河市| 汉沽区| 乌拉特中旗| 新安县| 弋阳县| 九江市| 贵州省| 苍梧县| 花垣县| 铜陵市| 敦煌市| 安阳市| 北京市| 罗田县|