官术网_书友最值得收藏!

Moving from bootloader to kernel

When the bootloader passes control to the kernel it has to pass some basic information to the kernel, which may include some of the following:

  • On PowerPC and ARM architectures: a number unique to the type of the SoC
  • Basic details of the hardware detected so far, including at least the size and location of the physical RAM, and the CPU clock speed
  • The kernel command line
  • Optionally, the location and size of a device tree binary
  • Optionally, the location and size of an initial RAM disk

The kernel command line is a plain ASCII string which controls the behavior of Linux, setting, for example, the device that contains the root filesystem. I will look at the details of this in the next chapter. It is common to provide the root filesystem as a RAM disk, in which case it is the responsibility of the bootloader to load the RAM disk image into memory. I will cover the way you create initial RAM disks in Chapter 5, Building a Root Filesystem.

The way this information is passed is dependent on the architecture and has changed in recent years. For instance, with PowerPC, the bootloader simply used to pass a pointer to a board information structure, whereas, with ARM, it passed a pointer to a list of "A tags". There is a good description of the format of the kernel source in Documentation/arm/Booting.

In both cases, the amount of information passed was very limited, leaving the bulk of it to be discovered at runtime or hard-coded into the kernel as "platform data". The widespread use of platform data meant that each device had to have a kernel configured and modified for that platform. A better way was needed, and that way is the device tree. In the ARM world, the move away from A tags began in earnest in February 2013 with the release of Linux 3.8 but there are still quite a lot of devices in the field, and even in development, still using A tags.

主站蜘蛛池模板: 广南县| 南投县| 达州市| 东海县| 河南省| 友谊县| 集贤县| 民勤县| 南城县| 陆丰市| 英德市| 客服| 西乌| 合山市| 龙江县| 罗甸县| 潮安县| 金溪县| 哈尔滨市| 津南区| 塔城市| 凤冈县| 曲阳县| 西乡县| 绥化市| 正镶白旗| 桂林市| 高邑县| 当阳市| 淳化县| 高安市| 东乡县| 天台县| 东至县| 荣成市| 肥城市| 枞阳县| 万源市| 龙胜| 陈巴尔虎旗| 南丹县|