- Mastering Embedded Linux Programming
- Chris Simmonds
- 500字
- 2021-07-30 09:45:02
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 <barebox@lists.infradead.org>
.
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 inarch/[architecture]/mach-[SoC]
. Support for individual boards is inarch/[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 inDocumentation/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.
- 數(shù)據(jù)庫系統(tǒng)原理及MySQL應(yīng)用教程(第2版)
- FuelPHP Application Development Blueprints
- Pandas Cookbook
- Python 深度學(xué)習(xí)
- OpenCV 3和Qt5計(jì)算機(jī)視覺應(yīng)用開發(fā)
- MySQL數(shù)據(jù)庫管理與開發(fā)(慕課版)
- 微信小程序開發(fā)解析
- 從0到1:Python數(shù)據(jù)分析
- Procedural Content Generation for C++ Game Development
- 響應(yīng)式架構(gòu):消息模式Actor實(shí)現(xiàn)與Scala、Akka應(yīng)用集成
- 細(xì)說Python編程:從入門到科學(xué)計(jì)算
- 區(qū)塊鏈項(xiàng)目開發(fā)指南
- Modernizing Legacy Applications in PHP
- 創(chuàng)新工場講AI課:從知識(shí)到實(shí)踐
- HTML5+CSS3+jQuery Mobile+Bootstrap開發(fā)APP從入門到精通(視頻教學(xué)版)