You are here: Home / OSADL / News / 
2024-12-27 - 05:53

Dates and Events:

OSADL Articles:

2024-10-02 12:00

Linux is now an RTOS!

PREEMPT_RT is mainline - What's next?


2023-11-12 12:00

Open Source License Obligations Checklists even better now

Import the checklists to other tools, create context diffs and merged lists


2023-03-01 12:00

Embedded Linux distributions

Results of the online "wish list"


2022-01-13 12:00

Phase #3 of OSADL project on OPC UA PubSub over TSN successfully completed

Another important milestone on the way to interoperable Open Source real-time Ethernet has been reached


2021-02-09 12:00

Open Source OPC UA PubSub over TSN project phase #3 launched

Letter of Intent with call for participation is now available



2014-06-15 12:00 Age: 11 Years

Help, my bootloader has no device tree support.

By: Carsten Emde

How can I boot a recent kernel?

Yes, some vendors still ship bootloaders without device tree support, since their vendor kernel does not know what a device tree is and, thus, the bootloader neither does. But, fortunately, kernel developers are aware of it and implemented the

CONFIG_ARM_APPENDED_DTB

feature. What is this?

Append the device tree to the kernel

Since the bootloader loads the kernel into memory without asking any questions, we can fool the bootloader by making the kernel a little larger and append the device tree at its end. During the first steps of kernel initialization, the device tree is searched for at the end of the regular kernel code and used as if it had been loaded separately.

How do I prepare the kernel for this procedure?

In any case, CONFIG_ARM_APPENDED_DTB=y must be configured. If zImage is used to boot, simply execute

cd /usr/src/kernels/your-linux-tree
cd arch/your-arch/boot
cat zImage dts/your-device-tree.dtb >zImage-with-dtb

after having compiled the kernel as usual. If the uImage format is needed, you still have to execute the above commands. In addition, create a uImage file based on the combined zImage kernel as follows

cp zImage zImage-without-dtb
cp zImage-with-dtb zImage
cd -
make LOADADDR=$YOUR_LOADADDR ARCH=your-arch uImage
cd -
cp zImage-without-dtb zImage

and let the bootloader load the uImage file that now contains both the kernel and device tree.

Check for the correct model string

If everything worked correctly, you should see a line

Machine: Your generic board (Flattened Device Tree), model: your model string

that corresponds to the related setting in your device tree. This line is one of the first output lines after the kernel started execution.