Szwg Spec Typicalboot

From eLinux.org
Jump to: navigation, search

Introduction

  • Embedded Linux boot procedure is very different from enterprise/pc linux. First of all, in most cases, there is no mass storage devices. Typically, Linux kernel is stored in ROM/Flash on the target system. In order to save the area where Linux kernel is stored, the kernel is compressed as zImage.
  • The following is the procedure.
      1. Boot loader copies zImage kernel from ROM/Flash to the specified RAM area and let zImage kernel execute.
      2. zImage kernel (precisely speaking, the routine attached to zImage kernel) decompress the zImage Kernel and load the image on the specified RAM address.
      3. Boot loader let the newly loaded kernel start.
  • Depending on the conditions, several different file systems are used. We picked ext2 as typical file system and as normalizer.

Rational

  • This method saves ROM size (a little bit) because the kernel is stored compressed.

Specifications

 < Recommended implementation for boot loader >
      • Boot loader SHALL initialize accessible RAM
        • Boot loader SHALL initialize CPU - cache,MMU,interrupt
        • Boot loader SHALL initialize memory controller,if necessary
        • Boot loader MAY initialize serial controller to get debug message
      • Boot loader MAY check Linux kernel stored in ROM/Flash whether it is XIP executable image or zImage
      • Boot loader SHALL copy zImage kernel from ROM/Flash to the specified RAM area
      • Boot loader SHALL let zImage kernel (in RAM) start.
 < Specification for the Kernel >
      • zImage Linux kernel SHALL copy the executable Linux image to the specified address.
      • zImage Linux kernel SHALL let the executable Linux image start.

Notes(informational and non-normative)

Pros and Cons:

  • This method saves Kernel ROM size because the kernel is stored compressed, but require RAM space for Kernel image to run.
  • It takes time to make kernel copy(from ROM to RAM) and decompress (RAM to RAM) before kernel boot.
  • Kernel execution speed shall be fast as the kernel code is located on RAM. note memory access speed to/from RAM is faster than ROM/Flash.
  • In this configuration, File System is located in ROM/Flash as ext2 file system and it shall be used as Read Only, unless the driver has special implementation.
Actual data is shown in Appendix  ( [wiki:Appendix A_R2])

References

    • This feature is implemented in CELF 1.0 as well as master Linux (2.4 kernel at least)

Remaining Issues

    • Some data on the platform are still missing.
#noprint
   * TimRiker asks: why ext2? It's much larger and slower than romfs or cramfs
   * TimRiker comments: the inclusion of this specification in the CELF spec seems to forbid XIP. which is '''required''' elsewhere in the spec. This conflict should be resolved.
#noprint