Discover understanding linux kernel 4th edition, include the articles, news, trends, analysis and practical advice about understanding linux kernel 4th edition on alibabacloud.com
) Initial program stack (. Stack)5) executable code and data required for shared libraries6) Heap (. Heap)Cache, and access to disk and other block devices is too slow compared to the time of RAM access.Device driver, the kernel interacts with the I/O device through device drivers (devices driver). Device drivers are included in the kernel and consist of data structures and functions that control one or mor
From Get Linux3.1.1 version of the core source code and build a good reading environment began, to now around two months time, during the Google a large and small article, just clear a little thought and found a reading of the mouth. A good guide for kernel beginners is more important than anything, and the methodology for Linux kernel learning can refer to the
* 1024 * 1024;/* We don't want to having this area swapped out, lock it */Vma->vm_flags |= vm_locked;if (Remap_page_range (VMA, Vma->vm_start, offset, size, page_shared)){PRINTK ("Remap page range failed/n");Return-enxio;}return (0);}
The function of the Remap_page_range function is to construct a new page table for mapping a physical address, which implements the mapping between kernel space and user space, with the following prototype:
contains the instruction address that generated the exception, then this error is caused by an illegal system call parameter, otherwise, it is caused by a more serious bug.Linux defines a few exception tables. The main exception table is generated automatically by the C compiler when the kernel program image is established. It is stored in the __ex_table section of the kernel code, and its starting and end
any of its child processes execution state.For example: a process can create a child process to perform a specific task, and then call some library functions such as wait () to check whether the child process terminates. If the child process terminates, its terminating designator tells the parent process whether the task has completed successfully.To follow these design choices, the Unix kernel is not allowed to discard data contained in the Process
] "M" (NEXT->THREAD.IP), \68 \*/* Regparm parameters for __switch_to (): */\[Prev] "a" (prev), \[Next] "D" (next) \72 \__switch_canary_iparam \74 \:/* Reloaded Segment Registers */\"Memory"); \(0)Second, the experimental processExperimental content1. Understand the timing of process scheduling in Linux systems, you can search the kernel code for the schedule () function, see where the schedule () is called,
Concurrent execution Quantity: If there is only one then the CPU must switch to the user state.Suspend the process's switch request: If there is any request, the kernel must execute the process dispatch; otherwise, return control to the current process.Pending signal: If a signal is sent to the current process, it must be processed.Single-Step mode: If the debugger is tracking the execution of the current process, it must resume stepping before the p
the 129th item in the page directory
The physical address of the page table in the page directory that must contain the process
If no other linear address is assigned to the process, the remaining 1023 items in the careers directory are filled with 0
The value in the Middle 10 (table field) is 0-0x03f, so only the first 64 bits of the page table are meaningful, and the remaining 960 are filled with 0
Assume that a thread reads bytes
PS: Brother Bird's third edition of private dishes printing problemsThe above meaning: D refers to the directoryFile Owner permissions: R readable w writable, X, can run,Permissions for the same group: R readable, this paragraph has a-number, which means not writable, X is operationalOther non-group permissions: R Readable, this paragraph also has a-number, indicating not writable, X can runThere is a 2 in the back, which means there are 2 files, the
back to the Linuxkernel directory, start the kernel with the following command and stop for debugging before the CPU runs the code:Qemu-kernel LINUX-3.18.6/ARCH/X86/BOOT/BZIMAGE-INITRD Rootfs.img-s-SNext, we can split a new shell window horizontally, then start GDB debugging with the following commandgdb (gdb) file Linux
file. The format is:Absolute path file name of the login ... {Individual parameter setting values, such as monthly, compress, etc.}Found: The wtmp in the/etc/logrotate.conf file is: Log the account information of the person who logged in the system correctly/etc/logrotate.d/. All files in this directory will be actively read into the/etc/logrotate.conf.TODO: File diagramJOURNALCTL command: Observe the login information, check the Systemd-journald.service dataThe actual operation is not the same
LIDS (Linux Intrusion Detection System) is a Linux kernel patch and system management employee lidsadm. it enhances the Linux kernel. It implements a security mode in the kernel-reference mode and MandatoryAccessControl (command e
3.1 OverviewMemory management covers a number of areas:
Management of physical memory pages in memory;
A partner system that allocates large chunks of memory;
Slab, Slub, slob allocator allocating small chunks of memory;
Vmalloc mechanism for allocating non-contiguous blocks of memory;
The address space of the process.
The Linux kernel typically divides the virtual address spac
Reference:Http://www.embedu.org/Column/Column240.htmHttp://www.cnblogs.com/Anker/p/3269106.htmlUser space and kernel space with user space and kernel space, the entire Linux internal structure can be divided into three parts, from the bottom to the top, in order: hardware----------------- as shown in the following: Detailed Questions to note:(1)
My erroneous understanding of Linux high-end memory is derived from this article, the article saidPhysical Address = Logical Address –0xc0000000: This is the address translation relationship for the kernel address space.This sentence suddenly shocked me, according to my knowledge of the CPU, after opening the paging, any addressing will have to pass the MMU conve
Overview:kernel space and user space often need to interact. For example: When user space uses some configuration commands such as Ifconfig or route, the kernel handler responds to these processing requests. user space and the kernel have a variety of interactive methods, the most commonly used in the following four kinds: through the/proc virtual file system, through the/sys virtual file system, through th
process has set the TLF_NEED_RESCHED flag for the current process, and if so, the entire schedule () function restarts, otherwise the function ends. The core function of the Linux dispatch encapsulates the framework of the kernel scheduler for the Schedule,schedule function. The detail implementation invokes the function implementation in the specific scheduling class. When the switching process has been s
1. Commercial UNIX operating systems include:-At and T company developed (System V Release 4) SVR4,-The 4.4BSD, published by UC Berkeley-Dec Corporation (now HP) Digital Unix-Aix of IBM Corporation-HP-UX-Sun's Solaris-apple company's Mac OS XAll commercial versions are variants of SVR4 or 4.4BSD and tend to follow some common criteria: such as the IEEE POSIX (portable Operating Systems based on Unix) and X/open CAE (Common Application environment).2. In addition to
requires balancing the total size of the physical memory, the maximum number of connections that Nginx can handle concurrently (as determined by the worker_processes and worker_connections parameters in nginx.conf). Of course, it is not appropriate to reduce the size of the sliding window simply to increase the amount of concurrency so that the server does not have an out of memory problem, because a sliding window is too small to affect the transfer speed of large data volumes. The 4 parameter
context contains all the information required for the process. In Linux, part of the hardware context of a process is stored in the task status (TSS) segment, while the remaining part is stored in the kernel state stack. Process switching only occurs in the kernel state.
Execute process switching:
Essentially, each process switchover consists of two steps:
1.
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.