Linux Kernel Debug - 2023.2 English

Versal Adaptive SoC System Integration and Validation Methodology Guide (UG1388)

Document ID
Release Date
2023.2 English

The kernel software is a mix of assembly code and C code and is loaded from the U-Boot. The U-Boot hands off to the entry point head.S , which checks the architecture, processor, and machine type. head.S also configures the memory management unit (MMU), creates page tables, and sets up virtual memory and then calls start_kernel. The start_kernel function is made up of approximately 86 subsystems.

One key boot milestone is setup_arch. In setup_arch, all the architecture-dependent initialization occurs, like setup cpu and setup machine, which are extracted from device-tree. Next, setup_arch initializes the early console and multiple subsystems, such as the kernel services like memory allocation, scheduling, and file cache, until it reaches the rest_init. kernel_init runs do_basic_setup and tries to call the init in the file system, which changes the current kernel thread into an init process. If issues occur at this point, the file system likely cannot be found or cannot be mounted. If the Linux project was created in PetaLinux, you can check the file system in the PetaLinux configuration.

If the issue occurs in the kernel initialization, you can track each of these subsystems in their boot log to debug the boot issue in the kernel. For more information, see the PetaLinux Image Debug Series: Debugging the Linux Kernel in Vitis Article.