Firefox OS/Performance/Modifying boot.img: Difference between revisions

m
Line 19: Line 19:
The boot partition contains 2-3 distinct entities: The kernel, the ramdisk, and (optionally, based on how the kernel was configured) the device tree binary. The instructions outlined [https://developer.mozilla.org/en-US/Firefox_OS/Porting#Extracting_and_modifying_an_existing_boot_image here] for splitting a boot.img are only mostly sufficient on a flame since the tool specified only detects the kernel and ramdisk. For more information on the structure of this partition see: https://github.com/xiaolu/mkbootimg_tools/blob/master/dtbtool.txt .
The boot partition contains 2-3 distinct entities: The kernel, the ramdisk, and (optionally, based on how the kernel was configured) the device tree binary. The instructions outlined [https://developer.mozilla.org/en-US/Firefox_OS/Porting#Extracting_and_modifying_an_existing_boot_image here] for splitting a boot.img are only mostly sufficient on a flame since the tool specified only detects the kernel and ramdisk. For more information on the structure of this partition see: https://github.com/xiaolu/mkbootimg_tools/blob/master/dtbtool.txt .


The device tree binary is the last section (after which is zero padding if the image was pulled from the device). A device tree is basically a way to describe the hardware of the device for the kernel and It is generally compiled into a binary more suitable for the machine to read than humans. It signals its beginning in the boot partition with the 4 byte magic <code>|QCDT|</code>. To extract this blob I simply used dd on the partition image skipping to whatever offset the magic was found at, and then trimming the trailing zeros similarly. A command such as this can be used to find the offset:  
The device tree binary is the last section (after which is zero padding if the image was pulled from the device). A device tree is basically a data structure for describing the hardware of the device to the kernel, and It is generally compiled to a binary format more suitable machines to read than humans. It signals its beginning in the boot partition with the 4 byte magic <code>|QCDT|</code>. To extract this blob I simply used dd on the partition image skipping to whatever offset the magic was found at, and then trimming the trailing zeros similarly. A command such as this can be used to find the offset:  
<pre>
<pre>
strings -o boot.img | grep QCDT | awk '{print $1}'
strings -o boot.img | grep QCDT | awk '{print $1}'
Confirmed users
125

edits