CN-122019344-A - LINUX operating system kernel migration early process debugging method
Abstract
The disclosure relates to a method and a device for debugging a LINUX operating system kernel migration early process, electronic equipment and a storage medium. The method comprises the steps of designing a kernel running process analysis method based on printk () function printing positions and printing logic, designing a kernel running error checking method based on printk () function printing contents, and realizing debugging in a Linux operating system kernel migration early process applied to an embedded development board based on the kernel running process analysis method and the kernel running error checking method. The method and the device uniformly abstract analysis of hardware information input, software and hardware interaction and internal mechanisms of the kernel into analysis of data flow conditions and processing modes, effectively extract a main line of kernel debugging analysis, reduce software and hardware knowledge required in the initial stage of kernel debugging, provide a simple and feasible starting analysis method, effectively reduce starting difficulty of kernel transplantation and reduce dependence of kernel transplantation on abundant software and hardware experiences.
Inventors
- YANG XINYUE
- LIU LIANG
- Tu Chunhu
- WANG WENXIN
- ZHANG DONG
- XIE NAN
- LIU DONG
- ZHANG JINHONG
Assignees
- 北京机械设备研究所
Dates
- Publication Date
- 20260512
- Application Date
- 20251205
Claims (8)
- 1. An early process debugging method for kernel migration of a LinuX operating system, which is characterized by comprising the following steps: designing a kernel running process analysis method based on printk () function printing positions and printing logic; designing a kernel operation error checking method based on printk () function printing content; Based on the kernel running process analysis method and the kernel running error checking method, the debugging in the early stage process of kernel migration of the Linux operating system applied to the embedded development board is realized.
- 2. The method of claim 1, wherein the method of kernel run process analysis based on printk () function print location, print logic further comprises: print position and print logic scheme design for printk () function; and performing software and hardware deployment on the printk () function printing position and the printing logic scheme.
- 3. The method of claim 2, wherein printing a location, printing a logic scheme design for a printk () function in the method further comprises: printing the running flow of the printk () function program, and segmenting the kernel function and the log information; Entering a key function of the printk () function into mark printing; Logic branches in key functions of the printk () function enter mark printing; printing key data corresponding to a logic branch in a key function of the printk () function; And printing the calling condition and parameter transfer condition of the sub-functions in the key functions of the printk () function.
- 4. The method of claim 1, wherein the kernel run error checking method based on printk () function print content in the method further comprises: Printing a content scheme design for the printk () function; software and hardware deployment is carried out on the printk () function printing content scheme.
- 5. The method of claim 4, wherein printing the content scheme design for the printk () function in the method further comprises: Designing a printk () function printing error checking scheme based on the running condition of the program; a printk () function print error checking scheme based on the data flow condition is designed.
- 6. An early process debugging device for kernel migration of a Linux operating system, which is characterized by comprising: The operation analysis module is used for designing a kernel operation process analysis method based on the printk () function printing position and the printing logic; The operation debugging module is used for designing a kernel operation error checking method based on printk () function printing content; the transplanting debugging module is used for realizing debugging in the early stage process of kernel transplanting of the Linux operating system applied to the embedded development board based on the kernel running process analysis method and the kernel running error checking method.
- 7. An electronic device, comprising Processor, and A memory having stored thereon computer readable instructions which, when executed by the processor, implement the method according to any of claims 1 to 5.
- 8. A computer-readable storage medium, characterized in that a computer program is stored thereon, which computer program, when being executed by a processor, implements the method according to any of claims 1 to 5.
Description
LINUX operating system kernel migration early process debugging method Technical Field The present disclosure relates to the field of embedded domain operating system migration, and in particular, to a method, an apparatus, an electronic device, and a computer readable storage medium for early process debugging in LINUX operating system kernel migration. Background The Linux operating system is a set of freely used and freely spread Unix-like operating systems, is a multi-user, multi-task, multi-thread and multi-CPU supporting operating system which follows POSIX, and is widely applied in the embedded field due to the advantages of open source, stability, high running efficiency and the like. The Linux operating system adopts a single-kernel system architecture, the kernel is a key part of the Linux operating system, and can realize the functions of process management, memory management, file management, equipment management, network management and the like, and the kernel provides a unified virtual machine interface upwards and realizes the abstraction and management of hardware resources downwards. The migration of the Linux operating system on the embedded plate can be divided into three steps, namely the migration of a boot program, the migration of a kernel and the migration of a root file system. Wherein the migration of the kernel is a critical step. In the kernel transplanting process, the development of the contents such as hardware architecture system codes, driving codes and the like is involved, and a large amount of code analysis and debugging work is involved in the process, so that the design of a debugging method becomes a key content. Current Linux operating system kernel debugging techniques include hardware-based on-line emulator (ICE) techniques, on-chip debugging techniques (OCD), etc., as well as software-based source program emulator (Simulator), debugging agent techniques (Debugging Agent), etc. However, in early stage of kernel migration of Linux operating system, kernel configuration and control codes of the kernel to hardware are not perfect, a minimum system cannot be started, a program is blocked in a kernel space, and debugging by using the technology has certain difficulty and problem. In addition, linux kernel complexity is higher, mutual dependency exists among mechanisms, debugging of the kernel depends more on deep understanding and rich development experience of a developer on the kernel in early kernel migration and on the condition that available resources and information are less, so that the kernel migration needs more knowledge storage and operation experience, and under the condition that various errors in early kernel adaptation are mixed, beginners are difficult to find reasonable starting points in the face of kernel mechanism and software and hardware interaction codes with strong dependency, so that the difficulty of starting kernel migration is overlarge, and the current debugging method is low in executable performance. Therefore, a Linux operating system kernel transplanting early debugging method which is clear in step, easy to start, simple, convenient and easy to operate needs to be researched. It should be noted that the information disclosed in the above background section is only for enhancing understanding of the background of the present disclosure and thus may include information that does not constitute prior art known to those of ordinary skill in the art. Disclosure of Invention It is an object of the present disclosure to provide a method, apparatus, electronic device, and computer-readable storage medium for early process debugging in LINUX operating system kernel migration, which overcome, at least in part, one or more of the problems due to the limitations and disadvantages of the related art. According to one aspect of the present disclosure, there is provided a method for early process debugging in LINUX operating system kernel migration, including: designing a kernel running process analysis method based on printk () function printing positions and printing logic; designing a kernel operation error checking method based on printk () function printing content; Based on the kernel running process analysis method and the kernel running error checking method, the debugging in the early stage process of kernel migration of the Linux operating system applied to the embedded development board is realized. In an exemplary embodiment of the present disclosure, the kernel run process analysis method based on the printk () function print location and the print logic in the method further includes: print position and print logic scheme design for printk () function; and performing software and hardware deployment on the printk () function printing position and the printing logic scheme. In one exemplary embodiment of the present disclosure, the method for printing the printk () function comprises the following steps: printing the running flow of the p