Home>Article>Operation and Maintenance> what is linux kernel porting

what is linux kernel porting

WBOY
WBOY Original
2022-03-24 10:29:06 2868browse

In Linux, kernel transplantation refers to transferring program code from one hardware platform to another hardware platform to run on; Linux kernel transplantation includes three levels, namely architecture-level transplantation. , SOC level transplantation and motherboard level transplantation.

what is linux kernel porting

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

What is Linux kernel transplantation

The so-called transplantation is to transfer the program code from one operating environment to another operating environment. For kernel transplantation, it mainly involves moving from one hardware platform to running on another hardware platform.

The transplantation of Linux kernel on a target board includes three levels, namely architecture-level transplantation, SoC-level transplantation and motherboard-level transplantation.

  • Architecture-level transplantation refers to the transplantation of the Linux kernel on different architecture platforms. For example, on different architectures such as ARM, MIPS, and PPC, each system must be ported separately. Structure for specific porting work. The emergence of a new architecture requires migration at this level.

  • SoC level transplantation refers to the transplantation of the Linux kernel on a specific SoC processor platform. For example, the two processors of the ARM920T IP core, S3C2410 and AT91RM9200, must be carried out separately. SoC specific porting efforts.

  • Motherboard-level transplantation refers to the transplantation of the Linux kernel on a specific target motherboard. For example, on the FS2410 target board, motherboard-specific transplantation work is required.

Discuss motherboard level transplantation here, mainly adding code for development board initialization and driver. Most of this code is related to the architecture and is managed according to different architectures in the arch directory.

Linux 2.6 kernel already supports a variety of hardware boards for the S3C2410 processor, such as SMDK2410, Simtec-BAST, IPAQ-H1940, Thorcom-VR1000, etc. We can refer to the SMDK2410 reference board to transplant the core of the development board.

S3C2410 is a system-on-chip. The processor chip has controllers for serial ports, LCD and other peripheral interfaces. In this way, most of the device drivers on the reference board can be used directly. But not all external devices are the same. Different development boards can use different SDRAM, Flash, Ethernet interface chips, etc. This requires modifying or developing drivers based on the hardware.

For example, the serial port driver is one of the typical device drivers, and this driver requires almost no changes. However, if you use the 2.4 kernel configuration method, you cannot get the serial console information. In the 2.6 kernel, the corresponding device nodes of the serial device in the /dev directory are /dev/ttySAC0, /dev/ttySAC1, etc. Therefore, if you use the past serial port device ttyS0, you will not get console printing information. This problem can now be easily solved by changing the console setting of the kernel command line parameters to console = ttySAC0,115200.

After the kernel already supports the S3C2410 processor, there is basically no need to change the code to make the kernel run. However, in some cases, we must perform driver-level transplantation for different devices, at least the hardware address and interrupt number may be different. For example, sometimes it is necessary to transplant drivers for peripherals such as network chips and Nand Flash chips.

Related recommendations: "Linux Video Tutorial"

The above is the detailed content of what is linux kernel porting. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn