A VGA buffer is pretty much a &'static mut [u16; 80 * 25]. The VGA buffer is at a constant address, so I would like to use volatile writes. But if I use the nice abstraction of the mutable reference to an array, I do not know how I can make reads/writes to it volatile.
The only thing I can think of doing right now is to make a ZST VGA struct that impls Index and IndexMut that does the volatile reads/writes. But I'm not sure how the IndexMut version would work given that I need to return a mutable reference to something. Would I also need a custom RefMut type that does volatile writes when written to (not sure if this is possible)?