【kernel code】仿真调试boot

启动过程。

linux 0.11 里的3个汇编启动文件对应到 linux-4.19变成了一个文件:

linux-4.19\arch\x86\boot\header.S

但功能类似,都有"0xAA55"。最后跳转同一目录下的main.c 里的main()函数。这是一个解压内核的程序。

该程序生成的ELF文件为 linux-4.19\arch\x86\boot\setup.elf

然后也可以使用GDB进行仿真:

"C:\Program Files\qemu\qemu-system-i386.exe" -m 512M -smp 4 -kernel arch\x86\boot\bzImage -drive format=raw,file=../disk.raw -append "init=/linuxrc root=/dev/sda" -s -S
gdb setup.elf

仿真结果如下:

posted on 2018-11-07 14:00  lizhuohui  阅读(55)  评论(0编辑  收藏  举报

导航