build and install

  • Run make
  • Copy the final kernel image to the target storage
    • can be zImage, vmlinux, bzImage in arch//boot
    • copying the Device Tree Blob might be necessary as well, they are available in arch//boot/dts
  • make install is rarely used in embedded development, as the kernel image is a single file, easy to handle
    • It is however possible to customize the make install behaviour in arch//boot/
  • make modules_install is used even in embedded development, as it installs many modules and description files
    • make INSTALL_MOD_PATH=/ modules_install
    • The INSTALL_MOD_PATH variable is needed to install the modules in the target root filesystem instead of your host root filesystem.

Booting with U-Boot

  • Recent versions of U-Boot can boot the zImage binary.

  • Older versions require a special kernel image format: uImage

  • uImage is generated from zImage using the mkimage tool. It is done automatically by the kernel make uImage target.

  • On some ARM platforms, make uImage requires passing a LOADADDR environment variable, which indicates at which physical memory address the kernel will be executed.

  • In addition to the kernel image, U-Boot can also pass a Device Tree Blob to the kernel.

  • The typical boot process is therefore:

      1. Load zImage or uImage at address X in memory
      1. Load .dtb at address Y in memory
      1. Start the kernel with bootz X - Y (zImage case), or bootm X - Y (uImage case) The - in the middle indicates no initramfs

Kernel command line

  • In addition to the compile time configuration, the kernel behaviour can be adjusted with no recompilation using the kernel command line

  • The kernel command line is a string that defines various arguments to the kernel

  • It is very important for system configuration
  • root= for the root filesystem (covered later)
  • console= for the destination of kernel messages
  • Many more exist. The most important ones are documented in Documentation/kernel-parameters.txt in kernel sources.

  • This kernel command line is either

    • Passed by the bootloader. In U-Boot, the contents of the bootargs environment variable is automatically passed to the kernel
    • Built into the kernel, using the CONFIG_CMDLINE option.

results matching ""

    No results matching ""