-
Notifications
You must be signed in to change notification settings - Fork 448
Description
TLDR: It would be useful for OS and embedded it there was a way to handle reading / writing to specific memory addresses.
Heya, I tried to see if something like this was already suggested, but I could not find a similar feature request. I would also fully understand if people think this is out of scope for Miri.
In several contexts, mostly embedded and OS development, you will read and write to specific memory addresses to control peripherals. It would be awesome if Miri could somehow handle these situations. The simplest and most flexible method I can think of is being about to register a handler through an FFI interface that is given the address and optionally the value that is being written. Then, when an invalid address is read or written to, all the handlers are enumerated and called. When a handler is succeeds or explicitly fails, that handler is used as the result for read/write.
There is probably a better solution that I am not seeing. If this use case is worth considering for Miri, then I propose a bit of time is spent on what solution would be ideal.
Thank you in advance.