Review 1.中断上下文的切换——保存现场恢复现场Main course content of this section introduction to Linux kernel source code1. Open the Kernel source code pagearch/目录:支持不同CPU的源代码;其中的X86是重点init/目录:内核启动相关的代码基本都在该目录中(比如main.c等)start_kernel函数就相当于普通C程序的main函数kernel/目录:Linux内核核心代码在kernel目录中Readme介绍了什么是Linux,Linux能够在哪些硬件上运行,如何安装内核源代码等Construct a simple Linux system menuos Trace Analysis of the boot process of the Linux kernelBoot Kern
Trace Analysis The boot process of the Linux kernel uses GDB to trace the debug kernel
Using QEMUqemu -kernel linux-3.18.6 /arch/x86/boot/bzImage -initrd rootfs.img -s -SParameters:
-S: Freezes the CPU at initialization
-S: assigning 1234 ports to GDB
GDB debuggingOpen th
He Bong + Original works reproduced please specify the source + "Linux kernel analysis" MOOC course http://mooc.study.163.com/course/USTC-1000029000I. Experimental process1, open the shell, enter the start command, the kernel starts to enter the menu program, support three commands help, version and quit.2. Then use GDB to trace the debug kernel, enter the command Qemu-kernel LINUX-3.18.6/ARCH/X86/BOOT/BZIM
Kernel Source Directory1, Arch: recorded x86 focus on2. Init: Start_kernel in MAIN.C under directory is the starting point of the boot kernel3. IPC: Directory of inter-process communicationExperimentOpen the shell with a virtual machine in the lab buildingCD linuxkernel/Qemu-kernel LINUX-3.18.6/ARCH/X86/BOOT/BZIMAGE-INITRD rootfs.imgUse gdb Trace Debug Kernelqemu
Experimental requirements:
Booting from Start_kernel to init process using GDB trace debug kernel
Detailed analysis of the process initiated from Start_kernel to Init process and the combination of experiments to write a signed blog, and in the blog post "real name (and the name of the final application certificate must be consistent) + Original works reproduced please specify the source +" Linux kernel Analysis "MOOC Course/http mooc.stu
established during the initialization of the system and persisted during the system's operation, while process No. 0 generated the 1th process, as well as numerous subsequent processes. Finally entered the cpu_startup_entry. This is actually called the Cpu_idle. In fact, it is in the while loop called the No. 0 process. Although in the experiment I did not understand the Linux system startup process, but the understanding of Linux system is not deep, need to further strengthen.Liu ShuaiOriginal
Lab 3: Trace Analysis of the boot process of the Linux kernelName: Li DonghuiStudy No.: 20133201Note: Original works reproduced please specify the source + "Linux kernel analysis" MOOC course http://mooc.study.163.com/course/USTC-1000029000"Computer Three Magic Weapon"1) Stored program computer2) function Call stack3) Interrupt"Operating system, two swords."1) Interrupt context switching: Save site and rest
Li Yajian "Linux kernel Analysis" MOOC course http://mooc.study.163.com/course/USTC-1000029000first, the experimental process :Experimental content starts with the GDB trace debug kernel from Start_kernel to init process1. According to the experimental guidance according to the process, in the laboratory building environment Open the shell:CD linuxkernel/Qemu-kernel linux-3.18.6/arch/x86/boot/bzimage -initr
, Init_idle_bootup_tast () Initializes an idle (idle) process, which does nothing else but consumes time slices.The process is then set through schedule_preempt_disabled to not be dispatched. Since the CPU is obviously better at utilization, it is not possible for the scheduler to schedule a process that consumes only the time slices.Finally, the Cpu_startup_entry will allow the CPU to work in a loop like idle, constantly reciprocating, never returning.
12345
voidcpu_startup
code as follows, he mainly through Kernel_thread (call Do_fork) created two process init, kthread.init--Process Entry Kernel_init (). We look at Kernel_init this function of the START process, in fact, he is, looking for each directory in the INIT program to use the shell form to start, until found,So here we actually start the second process of the system, and we usually see the init process.The code here does not get PID, so we can not print it out, but we know that this PID should be 1, beca
Trace Analysis of the boot process of the Linux kernelShahuzy 20122137Original works reproduced please specify the source + "Linux kernel analysis" MOOC course http://mooc.study.163.com/course/USTC-1000029000first, the contents of the experiment:Use the GDB trace debug kernel to boot from Start_kernel to init process.
now.Numa_default_policy ();Set the memory access policy for the NUMA (Non-uniform Memory Access Architecture) system as the default.Reference: NUMA technology for LinuxPID = Kernel_thread (Kthreadd, NULL, CLONE_FS | Clone_files);Creates a Kthreadd kernel thread that manages and dispatches other kernel threads.Rcu_read_lock ();Kthreadd_task = Find_task_by_pid_ns (PID, init_pid_ns);Gets the thread information for the Kthreadd and gets the completion instructions Kthreadd has been created successf
OS X after upgrading to El Capitan, providing a security-related pattern called SIP (System Integrity Protection), also known as rootless mode, this new feature is in the security of the enhanced OS X, which prohibits the software from being rooted in the Run on Mac, and in the upgrade to OS X 10.11 You may see that some applications are disabled so that/usr/bin folders we cannot read and write properly, but also cause some programs (such as homebrew and Git) to perform exceptions in command-lin
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.