env:
qemu-system-i386
QEMU emulator version 7.0.0
Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers
hi:
I use "qemu-system-i386 -kernel Prekernel" to run my kernel and then I use lldb to debug it, I add '0x7c00' breakpoint, then I run 'c' in lldb,it was not hit the '0x7c00' breakpiont, but if I use qemu '-cdrom' option, it can hit '0x7c00' breakpoint! I don't know why, it confuse me! any help is greatly appreciated!
why use qemu '-kernel' option can't hit '0x7c00' breakpoint
Re: why use qemu '-kernel' option can't hit '0x7c00' breakpo
qemu-system-i386 -help
Linux/Multiboot boot specific:
-kernel bzImage use 'bzImage' as kernel image
https://qemu-project.gitlab.io/qemu/sys ... xboot.html
what is qemu Direct Linux Boot process?
Linux/Multiboot boot specific:
-kernel bzImage use 'bzImage' as kernel image
https://qemu-project.gitlab.io/qemu/sys ... xboot.html
what is qemu Direct Linux Boot process?
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: why use qemu '-kernel' option can't hit '0x7c00' breakpo
When booting from CD, the bootloader starts executing at 0x7C00, so you hit the breakpoint at the start of the bootloader. When booting using QEMU's "-kernel" option, there is no bootloader at 0x7C00, so you don't hit the breakpoint.Princekin wrote:I use "qemu-system-i386 -kernel Prekernel" to run my kernel and then I use lldb to debug it, I add '0x7c00' breakpoint, then I run 'c' in lldb,it was not hit the '0x7c00' breakpiont, but if I use qemu '-cdrom' option, it can hit '0x7c00' breakpoint! I don't know why, it confuse me! any help is greatly appreciated!
If you want to debug your kernel, set a breakpoint in your kernel instead of in your bootloader.