I would suggest trying BOCHS to debug while writing on VGA memory. What I usually do is:
I inline one magic breakpoint before the piece of code I want to debug in the c Kernel:
Code:
asm(
"xchg bx, bx;");
I make sure you include "magic_break: enabled=1" in your .bxrc file
I execute BOCHS and F5 to execute until the magic breakpoint.
From this point, I use CTRL + F7 (Physical dump) to show 0xB8000 (VGA map) and F2 for the Stack content, while I F11 for step-by-step debugging.
On the other side, I compile my kernel using -g parameter, to include debug information and I have the output of an objdump "-D -M Intel --source" on one side of the screen.
This way I have full information to follow what exactly the kernel is doing and it helps me figure out quickly what is wrong.
This is an example:
PS: Ignore the code and the comments on my screenshots, it is just garbage. It is just to show how I debug ORIGINAL CODE:OBJDUMP OF MACHINE CODE WITH INTERLEAVED C CODE:BOCHS STOPPED AT BREAKPOINT WITH VGA CONTENT:Hope it helps !