barebox can be run as a simulator on your host to check and debug new non hardware related features.
4.28.1. Building barebox for simulation¶
The barebox sandbox can be built with the host compiler:
ARCH=sandbox make sandbox_defconfig ARCH=sandbox make
4.28.2. Running the sandbox¶
Once you compile barebox for the sandbox, you can run it with:
$ barebox [<OPTIONS>]
Available sandbox invocation options include:
Start sandbox with a specified malloc-space <size> in bytes.
Map a <file> to barebox. This option can be given multiple times. The <file>s will show up as
/dev/fdXin the barebox simulator.
How the file is mapped in barebox can be controlled by a number of flags:
,ro: The host file is mapped read-only
,blkdev: The host file is to be mapped as block device. This is the default when passing block devices from the host. The file’s size must be a multiple of the barebox sector size of 512 bytes.
,cdev: The host file is mapped as character device. This is the default, unless the the host file is a block device.
Multiple options can be appended if they don’t clash. Literal commas within the file path can be escaped with a backslash. Example:
Map <file> to barebox. With this option <file>s are mapped as
/dev/envXand thus are used as default environment. A clean file generated with
ddwill do to get started with an empty environment.
Register <file> as a console capable of doing stdout. <file> can be a regular file or a FIFO.
Register <file> as a console capable of doing stdin. <file> can be a regular file or a FIFO.
Specify SDL width.
Specify SDL height.
To terminate barebox and return to the calling shell, the poweroff command is suitable.