In this section, we study the debugging technology of Embedded Linux, and we need to use various methods to debug the complex Linux drivers and HAL libraries. Just started talking about the print kernel debug information: PRINTK, this function is used similar to the printf function, except that the PRINTK function runs in kernel space and the printf function runs in user space. After executing the relevant commands, you will be asked to choose whether to run on Ubuntu Linux or on an Android device. The next step is to prevent the PRINTK function from reducing the Linux drive performance, as long as it is implemented to control the output of the PRINTK function. Using virtual file systems for data interaction,/PROC is often used as a tool for data interaction between kernel space and user space in Linux file systems. It involves four functions, namely the Proc_mkdir function, the Create_proc_entry function, the Creat_proc_read_entry function, and the Remove_proc_entry function. Where the Creat_proc_read_entry function function is internally implemented by calling the Create_proc_entry function. Debug the user-space program with GDB, which can track the program for debugging user space. List is used to list the code in the program. The Android emulator can only use the Gdbserver debugger through port mapping. The remote debugging kernel program with KGDB, in addition to providing a journaling output function like the PRINTK function, also allows developers to link target devices directly on the PC via GDB. After setting the startup parameters of the Linux kernel, the native can use the GDB command to debug the Linux kernel like a normal embedded application and debug the Linux kernel with various. GDB commands. This chapter introduces the traditional PRINTK functions and some other debugging techniques.
Debugging technology of Embedded Linux