Source insight build project Kernel

Source: Internet
Author: User

Whether you are engaged in Linux kernel work or out of hobbies, the Linux kernel source code is a good learning resource. This means that it is necessary to deal with the kernel source code frequently, so software tools are indispensable. There are indeed a lot of useful software on Windows systems, which can be affirmed. For a complex and huge source code tree like the kernel, the source insight tool is very suitable and useful. So how to manage the Linux kernel source code tree? Obviously, Linux supports CPUs of different architectures, the/ARCH/directory contains CPU-related directories for Alpha, i386, parisc, iSCSI, arm, MIPS, and other specific architectures. So when creating a learning kernel source code tree project, we only need to add the CPU directory and some common directories and files that we care about.

1. Create a project folder

It is best to create a folder for managing all projects of source insight (for example, create a folder in D: \D: \ sourinproject), And then create separate project folders. Here we are building a Linux-2.6.22.6 project, then create a folder named:Linux-2.6.22.6Pro, Put in itLinux-2.6.22.6Source package, and a linux-2.6.22.6 engineering package that is ready to be placed on the source insightSourinpro. This makes it clear that the source code and project package are put separately namedLinux-2.6.22.6ProUnder, that is, different projects carry a source code package and a created project package.

Ii. How to Create a project

(1) first open the source Insight software, configure the file suffix recognized by the software, click Options-> document options on the menu bar, and select C source file from the document type drop-down list, then add some important file suffixes to the file filter: text box on the right.; *. S; *. LDS; kconfig; * defconfig; *. In; makefile(Otherwise, click Add.
When a tree is added to a directory tree, you must manually add some important files to the project. However, the easiest thing to do is write one.;*.*). Click project> new project on the menu bar.New projectDialog window, New project name(Project name) Enter l hereInux-2.6.22.6, Where
Do you want to store the project data files? (Where do you want to store your project files ?)D: \ sourinproject \Linux-2.6.22.6Pro\ Sourinpro. Then, all the way to OK, there is a name:Add and remove project filesDialog Box. Next we will operate on this dialog box;

(2) In the add and remove project files dialog box, clickDirectoryWe pre-placed linux-2.6.22.6 source package, at this time on the right sideFile NameAll source code directory files are displayed. So how do we select which files are more closely related to the source code?

(3) In the first step, we can add all the files to the project. After all, most of the Directory files are still generic. Then we can remove some directories and files that we don't care about. Click on the rightFile Name(An up arrow ),Show only known document types(Well-known file types). Otherwise, many important files, such as makefile and kbuild, are not added. Click Add all.
Add to project hook recursively add lower sub-directories in the dialog box (recursively Add sub-directory files );

(4) Obviously, the/ARCH/directory contains CPU-related directories of alpha, i386, parisc, iSCSI, arm, MIPS, and other specific architectures. First, remove the entire directory tree, and then add the directory that we care about. Here we enterArchWe are concerned about the arm directory. First, we can see some separate files (such as kconfig and kconfig. Debug). Generally, the single files on the top layer are common.Add all
InAdd to projectRemove from the dialog boxInclude top level sub-directories.Then you can see the imageBoot, common, configs, kernel, libDirectory. These are common directories in the ARM architecture. We select them one by one and click Add tree.Mach-xxxDirectory, which of the following is our mach?Mach-s3c2410Directory, which is our Mach directory. Click Add
Tree is added to the project. Then the following directory looks generic, but several directories are found to be Plat-xxx. Obviously we belongPlat-s3c24xxSo from the MM directory to the final directory (but in the middle of the plat-xxx directory, we only select the Plat-s3c24xx), we click Add tree. In this way, the entire arch directory is ready.

(5) go back to the top-level directory and let's look down and findIncludeDirectory, there are also many directories with different architecture. EnterIncludeDirectory, found manyASM-xxxFrom the name,ASM-armIs the header file related to arm,Asm-i386Is the header file related to x86. Obviously we do not need so many irrelevant directories. We will return to the top-level directory, select the include directory, and clickRemove
Tree
Remove the entire directory, and then enter the Directory and file for adding our link. The same ARM architecture also has different architectures./Include/ASM-armDirectory, there will be some separate files, we clickAdd allInAdd to projectRemove from the dialog boxInclude top level sub-DirectoriesTo process these subdirectories. Enter/Include/ASM-armDirectory, also add many of the following separate files first, as in the previous step. Then, we find thatArch-s3c2410Is what we care about./Include/ASM-arm/Arch-s3c2410Directory, click Add
All is added to the file. Return/Include/ASM-armDirectory, followed by the hardware, Mach, Plat-s3c24xx directory are generic, we select them, click Add tree to add to the project. Then,/Include/ASM-xxxDirectory.ASM-arm. Go back to the/include directory and find that there is an ASM-Generic Directory, which is a common directory from the name. We select it and add tree to the project. At this point, we do not need to consider other directories of/include/ASM-xxx. ThenCryptoDirectory starts to the last directoryVideoDirectory, are some common directories and files, fromCryptoStart directory, press shift, select the last directory, and click Add
Tree to add the remaining directory. In this case, the/include directory is all done;

(6). ReturnLinux-2.6.22.6The top-level directory and the rest of the directories without analysis are all common directories. In the first step, we have added them all. Close the add and remove project files dialog box;

(7) Finally, click Project> Synchronize files in the menu bar of source insight to synchronously generate indexes. So far, a satisfactory project has been established.

 

 

 

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.