I'm glad to see you used a VM. That's the first step in the right direction. Others have mentioned that you should've used printk(), which is true.
I'll mention that you can also run the kernel in a debugger: https://www.kernel.org/doc/html/latest/dev-tools/gdb-kernel-...