(Added kernel testing information)
(Fixed sentence structure)
Line 6: Line 6:
 
=== TFTP Server ===
 
=== TFTP Server ===
  
Rather than flashing your newly created kernel to find out it doesn't work or it is not quite configured correctly, a better way to load the kernel into RAM and boot it from there. u-boot allows kernel images to be loaded via TFTP.
+
Rather than flashing your newly created kernel to find out it doesn't work or it is not quite configured correctly, a better way is to load the kernel into RAM and boot it from there. u-boot allows kernel images to be loaded via TFTP.
  
 
To speed up development, I create an 'export' directory. A TFTP server is then configured to use this directory as the TFTP root.
 
To speed up development, I create an 'export' directory. A TFTP server is then configured to use this directory as the TFTP root.

Revision as of 11:55, 18 May 2013

Compiling the BeagleBone Black Kernel

Testing

TFTP Server

Rather than flashing your newly created kernel to find out it doesn't work or it is not quite configured correctly, a better way is to load the kernel into RAM and boot it from there. u-boot allows kernel images to be loaded via TFTP.

To speed up development, I create an 'export' directory. A TFTP server is then configured to use this directory as the TFTP root.

From the export directory, add symbolic links to the kernel images. This way, you can recompile the kernel and the new image is instantly available without having to move it.

ln -s /path to linux/arch/arm/boot/uImage-dtb.am335x-boneblack uImage-BBB-3.8.12

u-boot tftpboot

To test your kernel, bring up a serial console to the GuruPlug. First we will need to configure the IP addresses. The ipaddr variable contains the IP address for the GuruPlug, while the serverip variable is the address of the TFTP server containing the kernel image.

setenv ipaddr 192.168.0.250
setenv serverip 192.168.0.251

These variables can be saved to non-volatile memory to speed up development.

Next load the image into memory at 0x80200000:

tftpboot 0x80200000 uImage-BBB-3.8.12

Let's use the existing root filesystem, and send kernel messages to ttyO0:

setenv bootargs console=ttyO0,115200n8 quiet root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait

And boot from the memory location:

bootm 0x80200000

The example shown is to use the filesystem already in place (i.e. ext4 on mmcblk0p2). The preferred option is to export a root NFS filesystem. This has the added advantage as you can compile userland binaries on your development box, install them to the NFS export and have instant access to them on your target system.