Any method to print on startup or check stuck point?

My attempt at coremap initialization stuck the kernel startup procedure, and only one line about sys161 printed:

sys161: System/161 release 2.0.8, compiled Jan 9 2017 17:17:19

It’s really hard to figure out which step in my coremap_bootstrap stop the whole kernel startup procedure, for kprintf won’t work until startup finished. Is there any trick to debug in this stage? :slight_smile:

Use gdb with a breakpoint set at the function coremap_bootstrap, then step through.

Yeah… I’ve tried to connect gdb to the kernel (success), add breakpoints at first line of coremap_bootstrap() (success), and continue or step – but still no response shown in gdb & kernel, which really confused me a lot…

Maybe try to break earlier in main.c then step

Edit: Could be caused by the where you placed coremap_bootstrap in main.c, order matters

do you know how to fix this problem? :))