20135302 Wei quiet--linux course third week experiment and summary

Source: Internet
Author: User

Experiment: Track and analyze the boot process of the Linux kernel
    • Booting from Start_kernel to init process using GDB trace debug kernel
    • Open the shell with a virtual machine in the lab building
    1. CD linuxkernel/
    2. Qemu-kernel linux-3.18.6/arch/x86/boot/bzimage -initrd rootfs.img

After the kernel boot is completed into the menu program ("Software Engineering C Coding Practice" course project), support three commands help, version and quit, you can also add more commands, for elective "Software Engineering C Coding practice" of children's shoes should be a piece of cake.

    • Debug kernel with GDB trace
    1. Qemu-kernel linux-3.18.6/arch/x86/boot/bzimage -initrd rootfs.img-s -S # Description of the-s and-s options:
    2. #-S Freeze CPU at startup (with ' C ' to start execution)
    3. #-S Shorthand for-gdb tcp::1234 If you do not want to use port 1234, you can use-GDB tcp:xxxx to replace the-s option
    • Open another Shell window
    1. Gdb
    2. (gdb)file linux-3.18.6/vmlinux # Load symbol table before Targe remote in GDB interface
    3. (GDB) Target remote:1234 # Establish a connection between GDB and Gdbserver, press C to keep the Linux on qemu running
    4. (GDB) break Start_kernel # breakpoints can be set before target remote or after

20135302 Wei quiet--linux course third week experiment and summary

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.