Deep understanding of Linux kernel books

Source: Internet
Author: User

Chapter 1 Introduction.Introduction to operating systems, file systems, and Linux. Single-core and micro-kernel (VxWorks, the micro-kernel usually contains several synchronization primitives, a simple schedulingProgramCommunication Mechanism with processes. Several system processes running on the microkernel implement such OS-level functions as memory allocation, device drivers, and system calls .) Linux uses modules to compensate.

The kernel itself is not a process, but a process manager. In addition to user processes, Unix systems also include several so-called privileged processes of kernel threads, which are characterized: 1 or less, the kernel state runs in the kernel address space. 2. It does not directly interact with users. 3. It is usually created at system startup and remains active.

The kernel control path indicates the sequence of commands executed by the kernel to process system calls, exceptions, or interruptions. The kernel control path is staggered.

The reentrant kernel can contain non-reentrant functions, and uses the lock mechanism to ensure that only one process executes one non-reentrant function at a time.

The following methods can be used to synchronize the control path of the kernel: Non-preemptible kernel, no interruption, semaphores, and spin locks to avoid deadlocks.

UNIX signals (signal) provide a mechanism for reporting system events to processes.

IPC: semaphore, message queue, and shared memory.

Kernel memory distributor features (fast, avoiding waste, reducing fragments, and cooperating with other memory management subsystems), mainly including Resource Graph allocationAlgorithm, 2 power idle linked list, buddy system, zone allocation algorithm, slab allocation algorithm, etc.

Chapter 2 memory addressing.Memory Address, hardware segment, paging, Linux segment, paging.

Differentiation: Logical addresses (included in machine language instructions used to specify an operand or an instruction address), linear addresses (also known as virtual addresses) physical address (used for addressing memory chip-level memory units ). Relationship: MMU converts a logical address into a linear address through a hardware circuit called a segmentation unit. Then, the hardware circuit of the paging unit converts the linear address into a physical address.

Segment in hardware: Segment selection operator and segment register, segment descriptor, fast access segment descriptor, and segment unit.

For Linux 2.6, segmentation is only required in the 8086 structure.

To quickly locate the segment selection operator, the processor provides the segment register for storing the segment selection operator (the segment selection operator is part of the Logical Address ). CSCodeSegment register, pointing to the segment containing program instructions. The SS stack segment register points to the segment that contains the current program stack. DS data segment register, pointing to a segment that contains static or global data. In addition, elasticsearch, FS, and GS can point to any data segment. CS specifies the privilege level.

Each segment is represented by an 8-byte segment descriptor. It describes the features of the segment and is placed in the Global Descriptor Table or Local Descriptor Table. There are several different segments and their corresponding segment descriptors: segment descriptor, data segment descriptor, task status segment descriptor (used to save the content of the Processor register), and Local Descriptor Table descriptor.

Each CPU has a gdt Global Descriptor Table, which contains 18 segment descriptors. The call door is stored in the LDT table and used to change the CPU privilege level when calling a predefined function.

Pages in hardware: Regular pages, extended pages, and hardware protection solutions.

Chapter 3 process. Process and Its descriptor, process switching, creation, cancellation, and thread.

Chapter 4 interruptions and exceptions. Interrupt signal function, processing program, initialization Interrupt Descriptor Table, exception interrupt processing, Soft Interrupt and tasklet, work queue, return from interrupt and exception.

Chapter 5 kernel Synchronization. How to provide services for requests, synchronize primitives, and synchronize access to the kernel data structure.

Chapter 6 scheduled Measurement. Clock and timing circuit, Linux timing system structure, update date and time, update system count, soft timer and delay function.

Chapter 7 Process Scheduling. Balance Among Scheduling Policies, algorithms, data structures, functions, and running queues in a multi-processor system.

Chapter 8 Memory Management. Ye Kuang, memory zone management, non-continuous memory zone management. (How does the kernel allocate primary memory to itself)

Chapter 9 process address space. Memory descriptor, linear zone, page missing, process address space creation and deletion, and heap management. (How to assign a linear address to a process)

Chapter 10 system calls. Posix api and System Call, system call handler and service routine, entry and exit system call, parameter transfer, and kernel encapsulation routine.

Chapter 1 signal. Signal function, generation, transmission.

Chapter 2 VFS. Function, data structure, FS type, processing, path name search, implementation of VFS system calls, and file locking.

Chapter 4 I/O architecture and Device Drivers. Device File, device driver model.

Chapter 4 block Device Drivers. Common block layer, block device processing, Io scheduling program, open block device files.

Chapter 1 high-speed cache. Place blocks in the page cache, dirty pages are written back, sync (), fsync (), and fdatasync () are called by the system.

Chapter 4 access a file. Read/write files, memory ing, direct Io transfer, asynchronous Io.

Chapter 4 clear Ye Kuang. Reclaim algorithms, reverse ing, pfra implementation, and switching.

Chapter 2 ext2 and ext3 FS. Features, disk data structure, memory data structure, creation, functions, and disk management.

Chapter 4 Process Communication IPC. MPs queue, FIFO, System v ipc, and POSIX message queue.

Chapter 4 Program Execution. Executable File, format, execution domain, exec function.

Appendix 1 system startup.

Appendix 2.

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.