Starting from the kernel and starting from the kernel

Source: Internet
Author: User

Starting from the kernel and starting from the kernel

(1): Obtain the kernel source code
1: through the website https://www.kernel.org/can get the latest version of the kernel source code, now the latest version of the kernel source code version is

If you want to get the kernel source code of a previous version, click to enter the https://www.kernel.org/pub/ to go to the branch. In the book "Design and Implementation of Linux kernel", we use
Kernel version 2.6.18.

2: Get the Linux kernel source code from git. In terminal, run the git clone git: // git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git command to update the kernel source code to the latest version: git pull

(2): kernel source code tree
Next let's take a look at the composition of the Linux kernel source code tree. The following is our kernel source code book:

There are still some files in the kernel source code tree. The COPYING file is the kernel license. CREDITS is the list of developers who have developed many kernel codes, and MAINTAINERS is the maintainer list,
They are responsible for maintaining kernel subsystems and drivers. Makefile is the Makefile of the basic kernel.

(3) kernel Compilation
This will be learned in a separate section. For kernel compilation, the book "Linux kernel design and implementation" is not very detailed. In the compilation of linux kernel, the most important thing is the kernel configuration. It is necessary to understand each of the above parameters. Therefore, I will learn this before adding a new system call to the Linux kernel practice.

(4) features of kernel development
1: You cannot access the C library or the standard C header file during kernel programming.
2: gnu c must be used for Kernel programming.
3: Kernel programming lacks memory protection mechanisms like user space
4: It is difficult to execute floating-point operations during kernel programming.
5: The kernel only has a small fixed-length stack for each process.
6: Because the kernel supports asynchronous interrupt, preemption, and SMP, you must always pay attention to synchronization and concurrency.
7: The importance of portability should be considered.

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.