Android Deep Exploration with Hal Drive Development (Vol. 1)--tenth chapter essay

Source: Internet
Author: User

The 10th chapter debugging technology of Embedded Linux

Data interaction through a virtual file system (/PROC)

There are a few things you should know when writing code:

1. The Creat_proc_read_entry function is internally implemented by calling the Creat_proc_entry function. The so-called read-only is through the Creat_proc_read_entry function can specify the function of processing the file read action, and through the mode parameter set the file's read-only property (0944). If you want to change a read-only file to a read-write file, you only need to set the function that handles the file write action, and change the file property to 0666.

2. The read and write of Linux files is determined by attributes. In the program can be expressed in octal, for example, 0666 means octal 666, that is, binary 110110110. If you view the file properties, you will see that the file starts with-rw-rw-rw-. When you set the file property to 0444, the file property is –r-r-r-r--, which indicates read-only.

3. Before deleting a virtual directory, delete the virtual files in the virtual directory.

Issues to be aware of when using Gdb_debug:

Because Gdb_server is an ARM processor-based program debugger (ARM_NONE_LINUX_GNUEABI_GDB), and it is best to use which version of the compiled program, the corresponding version of the debugger is used. Although Gdb_debug is running on the Android emulator, executing the debugger on the Linux terminal is still required to specify Gdb_debug.

Linux kernel debugging has been considered by many people to be very difficult, most people prefer to use the PRINTK function directly output debugging information, but also do not want to use a variety of commands (GDB, gdbserver, KGDB, etc.) for debugging. Because doing so does not necessarily make for more benefits.

Android Deep Exploration with Hal Drive Development (Vol. 1)--tenth chapter essay

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.