Chapter I. Linux Introduction to the kernel
1.1Unix History
UNIX Features: 1, very concise
2. Everything is treated as a document
3, the UNIX kernel and related system Tools software are written in C language
4, process creation very quickly
So UNIX is very powerful.
1.2 Quest Linus Footprints: Linux Introduction
Linus Development. Linux is a Unix-like system. The Linux kernel is also free software.
1.3 Introduction to operating systems and kernels
Operating system: The parts of the system that are responsible for completing the most basic functions and systems management. Includes kernels, device drivers, boot bootstrapper, command-line shell, or other kinds of user interfaces, basic file management tools, and system tools.
Kernel: The kernel is the core of the operating system. A scheduler that is responsible for responding to interrupt and interrupt service programs, managing multiple processes to share processor time, and a system service program that manages the process address space, such as the memory management program and the network, interprocess communication, and so on. Independent of ordinary applications, generally in the system State .
The system runs applications that communicate with the kernel through system calls. The kernel is also responsible for managing the hardware devices of the system.
1.4Linux comparison between the kernel and the traditional kernel
Single Core
From the whole is implemented as a single large process. Everyone is in the same address space, and the communication between the cores is trivial. The single module has the characteristics of simplicity and high performance.
Micro-core
The microkernel function is divided into several separate processes. Using interprocess communication (IPC) mechanism to process micro-kernel communication through message passing
A micro-kernel-based system that is actually applied allows most or all of the servers to be in the kernel.
Linux kernel
Support dynamic load kernel module, support symmetric multi-processing mechanism, kernel can preempt, all processes are the same for kernel, provide object-oriented device model of bupt device class;
1.5Linux Kernel version
Stable and in development.
Naming mechanism: with "." The separated number. The first number is the major version number, the second number is from the version number, the third number is the revision number, and the fourth optional number is the stable version number.
1.6Linux Kernel Developer Community
The Linux kernel mailing list is useful.
Chapter II Starting from the kernel
2.1 get the kernel source code
Linux Kernel official website http://www.kernel.org
Use Git to get a copy of the latest commit to the Linux version tree: Git clone git://git.kernel.org/pub/scm/linux/kernel/gie/torvalds/linux-2.6.git
Use incremental patches to want to update version: Patch–pl<.. /patch-x.y.z
2.3 compiling the kernel
Configuration is required before compiling the kernel. Configured to two select one (yes or no) or three select one (yes or no or module)
Configuration tool: Make config traverses all configuration items and takes a long time
Make Menuconfig graphical interface tool based on the NCurse library
Make Gconfig GTK +-based graphical tools
Make defconfig default configuration
Configuration complete requires make to compile
2.4 features of kernel development
Different from application development:
L can neither access the C library nor access the standard C header file library
L must use gun C
l Lack of memory protection mechanisms like user space
L difficult to perform floating-point arithmetic
l give each process only a small fixed-length stack
• Because the kernel supports asynchronous interrupts, preemption, and SMP, you must always be aware of synchronization and concurrency
L to consider portability
"Linux kernel design and implementation" Reading notes 1&2