Is there a way to make a manually-defined io device in QEMU?
Posted: Sun Oct 22, 2023 12:20 pm
I need help finding a way to debug some really annoying memory management bugs. I have my memory management almost working but strings still overwrite the first character of the next string in certain situations. The bochs breakpoint and memory view feature just isn't good enough to be helpful. For several reasons. What I wish I could do is emulate a UART serial out and every time memory is allocated and deallocated, I wish I could output "memory allocation of size 20 at position 0x502525" for example. I bet I could find the bug right away if I could do that.
Currently my only ways of debugging consist of the bochs debugger or viewing what gets outputted onto the screen (and annoyingly enough, I can't have both screen output and debugging at the same time in bochs). That's it. I really need a way to view larger quantities of information output to a text file or serial prompt, I have to be able to enable or disable this on command while the system is running and I have to have a way of viewing what's on the screen while debugging features are active. It would be nice if there was already a built-in way of defining a manual io device with a python script or something. If not, figuring out how to modify the source code of either qemu or bochs to do this would be a difficult but I think necessary task to try to undertake.
Does anyone have any better ideas?
Currently my only ways of debugging consist of the bochs debugger or viewing what gets outputted onto the screen (and annoyingly enough, I can't have both screen output and debugging at the same time in bochs). That's it. I really need a way to view larger quantities of information output to a text file or serial prompt, I have to be able to enable or disable this on command while the system is running and I have to have a way of viewing what's on the screen while debugging features are active. It would be nice if there was already a built-in way of defining a manual io device with a python script or something. If not, figuring out how to modify the source code of either qemu or bochs to do this would be a difficult but I think necessary task to try to undertake.
Does anyone have any better ideas?