Dai Wen's Linux kernel topic

Source: Internet
Author: User

Press:

Dai Wen, author of this article. kohler. devyn Collier Johnson is 19 years old this year, but he has rich experience in Linux kernel, AI, and programming language, this article is a series of articles on the kernel that it serialized on linux.org. The article is written in a simple way. This site is not simple. The LCTT member geekpi has translated a series of articles to share with Linux enthusiasts.

 

In 1991, a Finnish student named linnasbennaducket towaz created a very popular operating system kernel. He released Linux September 1991 in 0.01 and authorized the kernel by using the GPL license on 1992. The GNU General License (GPL) allows people to use, possess, modify, and distribute source code legally and freely. This makes the kernel very popular because anyone can download it for free. Now anyone can generate their own kernel, which helps people learn how to get, edit, configure, compile and install the Linux kernel.

The kernel is the core of the operating system. The operating system is a series of programs that manage hardware and allow users to run applications on their computers. The kernel controls hardware and applications. Applications do not directly deal with hardware, but first interact with the kernel. In short, the software runs on the kernel, while the kernel operates on the hardware. Without a kernel, a computer is useless.

There are various reasons for users to make their own kernels. Many users may want a system kernel that only contains the code they need. For example, my kernel contains a fuse device driver, but my computer lacks these ports. When the system is started, the time and memory will be wasted on devices that are not installed on my system. If I want to simplify my kernel, I will make a kernel that does not contain the FireWire driver myself. For another reason, a user may have a device with special hardware, but the kernel in the latest Ubuntu version lacks the required driver. This user can download the latest kernel (newer than the current Ubuntu Linux kernel) and create their own kernel with the corresponding driver. Either way, these two reasons are common reasons for users to make their own Linux kernel.

Before downloading the kernel, we should discuss some important terms and facts. The Linux kernel is a macro kernel, which means that the entire operating system runs in the memory reserved by the kernel. More clearly, the kernel is stored in the memory. The space used by the kernel is reserved by the kernel. Only the kernel can use the reserved kernel space. The kernel has the memory space until the system is shut down. The user space corresponds to the kernel space. User space is the space owned by the user program in the memory. For example, browsers, video games, word processors, media players, wallpapers, themes, and so on are all in the memory of the user space. When a program is closed, any program can use the newly released space. In the kernel space, once the memory is occupied, no other program can use this space.

The Linux kernel is also a preemptible multi-task kernel. This means that the kernel can pause some tasks to ensure that any application has the opportunity to use the CPU. For example, if an application is running but waiting for some data, the kernel will suspend the application and allow other programs to use the newly released CPU resources until the data arrives. Otherwise, the system will waste resources for tasks that are waiting for data or other programs to execute. The kernel will force the program to wait or stop using the CPU. Without kernel permission, applications cannot be disconnected from the pause or use the CPU.

The Linux kernel displays the device as a file in the/dev folder. For example, the USB port is located at/dev/bus/usb. The hard disk partition is located in/dev/disk/partition. Because of this feature, many people say: "On Linux, everything is a file ". For example, if a user wants to access the data on the memory card, they can access the data through the device file. The original Article is "If a user wanted to access data on their memory card, for example, they cannot access the data through these device files. ", but according to context and actual experience, it should be" can ")

Linux Kernel is portable. Portability is one of the most important reasons for Linux's popularity. Portability allows the kernel to work on a variety of processors and systems. Some kernel-supported processor models include Alpha, AMD, ARM, C6X, Intel, x86, Microblaze, MIPS, PowerPC, iSCSI, UltraSPARC, etc.

In the boot folder (/boot), you will see files such as "vmlinux" or "vmlinuz. Both are compiled linux kernels. The end of "z" is compressed. "Vm" represents the virtual memory. You can see a zImage file on the system of the iSCSI processor. A small part of users can find a bzImage file, which is also a compressed Linux kernel. No matter which file the user has, these boot files cannot be changed unless the user knows what they are doing. Otherwise, the system will become unable to boot, that is, the system cannot be started.

The source code of the kernel is the program code. With the source code, programmers can modify the kernel and observe how the kernel works.

Download the kernel:

Now, if we want to learn more about the kernel, We need to download the kernel source code. Go to kernel.org and click the huge Download button. Decompress the downloaded file.

For this article, the source code I use is Linux kernel 3.9.4. All the guidance in this article series is the same for all kernel versions (or very similar)

For more highlights, see the next page:

Linux Kernel: click here
Linux Kernel: click here

Recommended reading:

How to install Linux 3.11 Kernel on Ubuntu

The Ubuntu 13.10 (Saucy Salamander) Kernel has been upgraded to Linux Kernel 3.10 RC5

Linux Kernel Parameter Setting file sysctl. conf

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9 ..
  • 21
  • Next Page

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.