Android Deep explore HAL and Driver Development-—— 10th Chapter

Source: Internet
Author: User

This chapter focuses on Linux debugging techniques. Print Kernel debug information: The PRINTK,PRINTK function runs in kernel space, and the Linux kernel program can only use the PRINTK function to output debugging information. The PRINTK file consists of a 4-digit text file. 6: Output The message to the level of the console. 4: The default message log level. 1: The minimum value that can be set for the console log level. 7: Default value for console log level.

When you do not want to use the Prink output message, you also need to know about the variable parameter macros and do while. Data interaction through a virtual file system: The/proc is used in the Linux file system as a tool for data interaction between kernel space and user space. The/proc file system, like the/dev file system, needs to be set to access the file's action handler function. The/proc file system uses Proc_dir_entry.read_proc and Proc_dir_entry.read_write function pointers to set up read-write processing functions.
Debugging Tools: GDB, Gdbserver, and debug kernel space program kgdb. GDB can track programs that debug user space. Quit is used to exit the GDB debugging interface; list is used to list the code in the program. Remote debugging of the user space program with Gdbserver is a service-side program that can run on an arm architecture. First enter the Android emulator terminal and then enter the Data/local directory. The Android emulator can only use the Gdbserver debugger through port mapping.
Using KGDB to debug kernel programs remotely, KGDB provides a log output function similar to Prink functions, and allows developers to link target devices on a PC. The KGDB consists of two parts: the KGDB core and a set of link interfaces, which support serial TTY device connections and Ethernet connections. Before debugging the Linux kernel with KGDB, you need to configure the Linux kernel and set kernel parameters, using the Make Menuconfig command into the Linux kernel configuration menu.

Android Deep explore HAL and Driver Development-—— 10th Chapter

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.