Kernel of Source Insight construction project

Source: Internet
Author: User

Whether you work in the Linux kernel or out of interest, the Linux kernel source code is a great Learning resource. It means that you have to have a lot of dealings with the kernel source code, so software tools are indispensable. There is really a lot of good software on the Windows system, and that's for sure. The Source Insight tool is ideal and useful for a complex, large source tree like the kernel. So how to manage the Linux kernel source tree? It is obvious that Linux operating systems support different architectures of CPUs, in the/arch/directory there are Alpha, i386, Parisc, SPARC, ARM, MIPS and other specific architectures of the CPU-related directory. So when building a learning kernel source tree project, of course we just add the CPU directory and some common directories and files that we care about. I. Create a project folder

It's a good idea to build your own management source insight for all project folders (for example, create folder D:\SourInProject in D:\), and then create separate project folders separately. Here we built the Linux-2.6.22.6 project, then set up a folder named: Linux-2.6.22.6pro, placed in the linux-2.6.22.6 source package, and a ready to place the source Insight creates the linux-2.6.22.6 project package Sourinpro. This is clear, the source code and the project package is placed in a separate named Linux-2.6.22.6pro, that is, different projects have a source package and a created project package.

This article is from the Linux commune website (www.linuxidc.com) Source Link: http://www.linuxidc.com/Linux/2011-09/42678.htm

Second, how to create the project

(1), first open the Source Insight software, configure the software to understand the file suffix, click on the menu bar options->document options, in the Document type drop-down list, select C Source file, Then add some important file suffixes in the Files Filter: text box on the right. S;*.lds; kconfig;*defconfig;*.in; Makefile etc (otherwise click Add tree when adding a directory tree, some important files are not added to the project, you need to join manually). Then click Project->new Project on the menu bar, in the New Project dialog window that pops up, new project name: (project name) in this fill linux-2.6.22.6,where do you want to Store the project data files? (where you want to store your project files), in which we fill in the D:\SourInProject\Linux-2.6.22.6Pro\SourInPro created in the previous step. Then all the way OK, there is a named: Add and Remove Project Files dialog box, the following we are for this dialog window operation;

(2), in the Add and remove Project Files dialog box, we click on the left directory we pre-placed linux-2.6.22.6 source package, at this time on the right file name will display all the source directory files. So how do we choose which files are more closely related to our future view of the source code?

(3) The first step, we can put all the files into the project, after all, most of the catalog files are still generic, and then we remove some of the directories and files we do not care about. Click the top-level directory in the File Name box on the right ... (An upward arrow identifies), where show only known document types (known file type) is removed, otherwise many important files such as Makefile, Kbuild and other files are not added. Then click Add All in the dialog box add to Project hook on recursively add lower sub-directories (meaning recursively add subdirectory file);

(4), obviously in the/arch/directory has alpha, i386, Parisc, SPARC, ARM, MIPS and other specific CPU-related directory. First we remove the entire directory from the tree, and then add the directory we care about. Here we go into the arch of the arm directory we care about, first see some separate files (such as Kconfig, Kconfig.debug, etc., the general top of the individual files are common), we click Add All in the popup add to The Include top level sub-directories is removed from the Project dialog box. Then see like boot, Common, configs, Kernel, lib directories, these are common directories in the ARM architecture, we select them in turn, click on Add Tree, and then some mach-xxx directory, then we are which Mach, Looking back there is a mach-s3c2410 directory, which is our Mach directory, click Add Tree to join the project. Then the following directory looks generic, but found that there are several directories are plat-xxx, obviously we belong to plat-s3c24xx, so from the MM directory to start, until the last directory (but the middle plat-xxx directory, we only select plat-s3c24xx), We clicked Add Tree. So that the entire arch directory we have done.

(5), back to the top-level directory We look down, we find an include directory, there will be many different architectural directories. Into the Include directory, found that there are many asm-xxx directory, from the name know, Asm-arm is arm related header file, asm-i386 is x86 related header file. Obviously we don't need so many unrelated directories, we go back to the top level directory, check the Include directory, click Remove Tree to remove the entire directory, and then go to the directories and files that add our relationship. The same ARM architecture also has a different architecture, into the/include/asm-arm directory, there will be some separate files, we click Add All in the pop-up Add to Project dialog box to remove the Include top level Sub-Directories, we'll deal with these subdirectories later. Enter the/include/asm-arm directory, the same as many of the individual files in the first join, the same as the same operation. Then here we find arch-s3c2410 is what we care about, go into the/include/asm-arm/arch-s3c2410 directory, click Add all to join so file. Back to the/include/asm-arm directory, the hardware, Mach, plat-s3c24xx directories are all generic, and we select them and click Add Tree to add to the project. At this time,/include/asm-xxx directory we have done asm-arm. Then go back to the/include directory, find a asm-generic directory, from the name to know is a generic directory, we select it, add tree to join the project. So far,/include/asm-xxx other catalogs we don't have to think about. Then starting from the crypto directory to the last directory video directory, are some common directories and files, starting from the crypto directory, press SHIFT, select to the last directory, click Add Tree to add the remaining directory. At this time/include catalogue We all take care of;

(6), finally back to the linux-2.6.22.6 top-level directory, the rest of the directory is not analyzed are some common directory, in the first step we have all joined at this time we do not bother. Close the Add and Remove Project Files dialog window;

(7) Finally, we click Project->synchronize files under the Source Insight menu bar to generate the index synchronously. At this point, a more satisfactory project was established.

This article is from the Linux commune website (www.linuxidc.com) Source Link: http://www.linuxidc.com/Linux/2011-09/42678.htm

Kernel of Source Insight construction project

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.