This HTML page address: http://oss.org.cn/kernel-book/In- depth analysisLinuxKernel sourceObjectiveChapter I. into Linux1.1 GNU and Linux growth1.2 Linux development model and operation mechanism1.3 into Linux Kernel 1.3.1 Featur
Chapter One: Introduction to the Linux kernelI. Unix and LinuxUNIX is a powerful, robust, and stable operating system.1.UnixKernel features
Very concise: Provide only hundreds of system calls and have a clear purpose;
In Unix , most things are treated as files (or are committed);
Unix kernel is the related system tool software is written in C language, which makes the system has a strong p
The books on the kernel can be described in voluminous, but only some of the classic gods have been tested. First, there are 5 time-tested deities (the individual is summed up as "2+1+2", and the first 2 refers to 2 books that fully explain the kernel, in the middle of the 1 refers to 1 of the book Drive Development, the following 2 refers to 2 of the
Embedded System Linux kernel Development Practice Guide (ARM platform) book reviews
I am deeply touched by the heavy book embedded Linux kernel Development Practice Guide (ARM platform. This
- 设置关注变量 - 18.9 detection system 18.9.1 using UID as selection criteria
if (current->uid! = 7777)
{
/ old algorithm /
Else
{
/ New Algorithm /
}
18.9.2 Using condition variables
You can use conditional variables if your code is not process-independent, or if you want to have a mechanism that can be used for all situations to control an attribute.
This is easier than using UID, just to create a global variable as a conditional selector
到其中的一个子进程退出,此时函数返回该子进程的PID。
When you release the process descriptor, you need to call Release_task ().
3.5.2 Orphan Process
Overview: The parent process exits before the process, leaving behind the child process, the orphan process
The workaround:
Finds a new parent process within the current thread group for the orphan process, or directly with Init as its parent process
Call Order:
- do_exit()-- - >forget_original_parent()- - >find_new_p
_ Get _ priority _ Max () returns the maximum and minimum precedence for a given scheduling policy
2. System calls related to processor bindings
Linux Scheduler provides mandatory processor binding mechanism
In a CPUs _ allowed bitmask in a task _ struct
Sched_setaffinity () sets a bitmask of different combinations of one or several bits
Sched _ Getaffinity () returns the current cpus_ allowed bit mask
3. Discard Proces
Linux Kernel programming paper book recommendation-general Linux technology-Linux programming and kernel information, the following is a detailed description. These are the books read by experts. The following books are popular. I
is in the process context when it executes system calls.(2) The current pointer points to the present task, which is the process that raised the system call.(3) In the context of the process, the kernel can hibernate and can be preempted.(4) System_call () is responsible for switching to user space and letting the user continue execution when the system call returns.5.6.1 The last step of binding a system call:(1) Add the table entry in the system ca
entries that do not copy the parent process.The implementation of the Vfork () system call is done by passing a special flag to the clone () system call.3.4 Implementation of threads in Linux3.4.1 Creating ThreadsCreating a thread is similar to creating a normal process, except that you need to pass some parameter flags when invoking clone () to indicate which resources need to be shared:Clone (CLONE_VM | Clone_fs | Clone_files | clone_sighand,0);The parameter flags passed to clone () determine
queue, and then call Schedule () to select and execute a different process.The process of waking up is just the opposite of the process being set to executable state, and then moving from the wait queue to the executable red-black tree.4.6 Preemption and Context switching4.6.1 User preemptionArises in the following cases:When the user space is returned from the system, when the user space is returned from the interrupt handler;4.6.2 kernel preemption
Lea EAX,[EBX+ECX]
Leal (%EBX,%ECX),%eax
Sub eax,[ebx+ecx*4h-20h]
subl-0x20 (%ebx,%ecx,0x4),%eax
As can be seen from the table, the grammar of at-and-T is more obscure, because [Base+index*scale+disp] can see its meaning at a glance, and disp (Base,index,scale) is unlikely to do so.This approach is often used to access a field within a particular element of the data structure array, where base is the starting address of the array, and scale is the s
The operating system kernel may be a micro kernel or a single kernel (which is sometimes called a macro kernel macrokernel ). These terms are defined as follows in a similar encapsulation:
Single Kernel: Also knownMacro Kernel.
Compile the linux0.00 kernel (full Linux Kernel Analysis-based on the 0.12 kernel)
I have bought a fully-analyzed Linux kernel written by Zhao Ke-based on the 0.12 kernel. It seems that
and barrier () on UP
Smp_mb ()
Provides the mb () function on SMP and the barrier () function on UP.
Barrier ()
Prevents compilers from crossing barriers to optimize loading or storage operations
To make the preceding Small Example run correctly, use the function in the preceding table to modify the function of thread:
/** Assume the operations on A and B in thread a */void Thread_A () {a = 5; mb ();/** mb () ensure that all the operations on loading and storing v
How is Linux composed?A: Linux is made up of user space and kernel spaceWhy divide user space and kernel space?A: For CPU architectures, each processor can have multiple modes, and Linux is a partition that takes into account the system'sSecurity, such as X86 can have 4 mode
How to obtain the Linux kernel source codeHow to obtain the Linux kernel source code
To download the Linux kernel, you must go to the official website. The website provides two types of file downloads: one is the complete
Linux Kernel Analysis (2) ---- kernel module introduction | simple kernel module implementation, linux ----
Linux Kernel Analysis (2)
Yesterday we started
Tags: socket source x86 INF location Architecture level pre compositionThe world is sad to end, the Octopus elder brother also retired, even the non-sincerity does not disturb in the worship diggers also suddenly a lot less. This "Linux kernel cultivation of the road" in excellence, when, China-pub has also been on sale, although serious literature, but in order to ensure fluency, most of the text I also ar
Original address: Linux kernel source Code Analysis--Kernel boot (6) Image kernel boot (do_basic_setup function) (Linux-3.0 ARMv7) TekkamanninjaTransferred from: http://blog.chinaunix.net/uid-25909619-id-4938396.htmlAfter the basic analysis of the
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.