mit-pdos / xv6-riscv

Xv6 for RISC-V
Other
6.63k stars 2.4k forks source link

Qemu hangs after execute instruction "mret" in start #84

Closed yodalee closed 3 years ago

yodalee commented 3 years ago

I encounter following issued on my computer, and I have no clue how to solve it or what the problem is. Here is my environment:

The problem is that, my breakpoint does not work in main function. I can step to the line asm volatile("mret"); in function start. However, the debugger just hangs after this instruction, it does not hit my breakpoint set on main function. I can send interrupt by press Ctrl+C, it seems that sometimes it will stop in function timervec. I think the timer interrupt is worked as expected. Have no clue what the problem is and how to fix it. Does anyone face same issue?

yodalee commented 3 years ago

I just found that, the problem is caused by qemu v6. I switch to qemu v5.2 and I can break at main function now.