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
- CD linuxkernel/
- 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
- Qemu-kernel linux-3.18.6/arch/x86/boot/bzimage -initrd rootfs.img-s -S # Description of the-s and-s options:
- #-S Freeze CPU at startup (with ' C ' to start execution)
- #-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
- Gdb
- (gdb)file linux-3.18.6/vmlinux # Load symbol table before Targe remote in GDB interface
- (GDB) Target remote:1234 # Establish a connection between GDB and Gdbserver, press C to keep the Linux on qemu running
- (GDB) break Start_kernel # breakpoints can be set before target remote or after
20135302 Wei quiet--linux course third week experiment and summary