-
-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
monitor: Add support for write command #1589
base: master
Are you sure you want to change the base?
Conversation
Thank you for the PR I was certain this must exist in QEMU monitor already, and was totally surprised not to find it! I usually just use GDB to do this, but I think it would be nice for users to be able to easily poke memory in the monitor too, for playing with games and whatnot, and the feature is not too complex. In the future maybe we should just bake in a GDB client for people to use. In the mean time, can you please expand the PR to support writing to both physical and virtual arbitrary addresses, regardless of any particular internal region. You can model this after the other related monitor / GDB stub commands. This feature might also be good for upstream QEMU, if you're interested in submitting to qemu-devel. |
I added an extra command, so there is one for virtual and one for physical now. I'm assuming the syntax and everything is okay but if you think anything else needs to be changed let me know. |
#include "qemu/timer.h" | ||
#include "qemu/sockets.h" | ||
#include "qemu/help_option.h" | ||
#include "exec/memory.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert any non-essential changes to this header order
#include "sysemu/kvm.h" | ||
#include "sysemu/runstate.h" | ||
#include "sysemu/tcg.h" | ||
#include "qemu/accel.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment as above re header order
QTAILQ_FOREACH (mr, &sm->subregions, subregions_link) { | ||
if (strcmp(memory_region_name(mr), "xbox.ram") == 0) { | ||
uint8_t *ram_ptr = qemu_map_ram_ptr(mr->ram_block, addr); | ||
memcpy(ram_ptr, buf, len); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there not an existing physical memory write function somewhere?
Anyway, we should check here that we don't accidentally write out of bounds
Adds a new command to monitor named
write|w
. The syntax iswrite addr size data
. This adds the capability to write up to 4 bytes of data at a time to the xbox.ram memory region.