Trace analysis of the boot process of the Linux kernel

Source: Internet
Author: User

Lab 3: Trace Analysis of the boot process of the Linux kernel

Name: Li Donghui

Study No.: 20133201

Note: 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 computer

2) function Call stack

3) Interrupt

"Operating system, two swords."

1) Interrupt context switching: Save site and restore site

2) Switching of the process context

Introduction to Linux kernel source code
    • arch/support for different CPU source code
    • documentations/Document Storage
    • init/Kernel boot-related code
    • kenerl/Process scheduling related code
    • ipc/Inter-process communication
    • lib/Common Library files
    • mm/Memory management-related code

Experimental Steps 1.Use the lab's virtual machine to open the shell and enter the commandCD Linuxkernel/qemu-kernel LINUX-3.18.6/ARCH/X86/BOOT/BZIMAGE-INITRD rootfs.img watch Menuos run.

2. Use your own 3 commands in menuos to observe the effects.

3. Use GDB debugging to observe the Start_kernel.

4. Observe init using GDB debugging.

Iii. Summary

Idle is a process with a PID number of 0. Its predecessor was the first process created by the system and the only one that was not produced by fork (). Each processor unit has a separate running queue, and there is an idle process on each running queue, that is, how many processor units there are, and how many are idle processes.
After the Linux kernel is loaded, the process starts executing start_kernel () to complete the initialization of the Linux kernel. This includes initializing the page table, initializing the interrupt vector table, initializing the system time, and so on. Then call Fork () to create the first user process: Kernel_thread (Kernel_init, NULL, CLONE_FS | Clone_sighand); This process is called the PID 1 init process, it will continue to complete the rest of the initialization work, and then Execve (/sbin/init), become the ancestors of all other processes in the system. This is the init process we saw, with the process number 1. Initialization of the last Linux call Scheule () the entire system is running. You can use the Process View command to verify the # PS aux.

Trace analysis of the boot process of the Linux kernel

Related Article

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.