Andriod Deep Exploration (Vol. 1) HAL and Driver Development Tenth chapter reading experience

Source: Internet
Author: User

For complex Linux drivers and libraries such as HAL, you need to debug them in a variety of ways. For example, setting breakpoints, stepping through code, outputting debugging information, and so on.

PrintkThe use of functions andPrintffunction is similar, exceptPrintkfunction runs in kernel space,PrintfThe function runs in user space. In other words, likeLinuxDrive such aThe Linux kernel program can only output debug information using the PRINTK function. The PRINTK function is implemented in the printk.c file.

While usingPrintkThe function can easily write messages to the log file or to the console. But a lot of usePrintkThe function frequently operates log files or console device files (/dev/console) can seriously affectLinuxDrive performance (so the write disk is much faster than reading and writing memory), so this requireslinuxprintklinuxprintk

InLinuxFile System,/procIt is often used as a tool for data interaction between kernel space and user space./procThe file system behaves in the same way as the device file system (/devSimilar/procis a virtual file system, which means that/procis not a real file system, but a memory map. All read and write/procOperations are both read and write to memory. So read and write The/proc file system is far faster than reading/writing/ dev file systems. As a result, the/proc file system can also serve as a tool for Linux to interact with user-space programs.

my Blog Park address is: http://www.cnblogs.com/zzp036/p/5449784.html

Andriod Deep Exploration (Vol. 1) HAL and Driver Development Tenth chapter reading experience

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.