Tuesday, March 20, 2007

Writing to video memory

Jay and I were having a discussion about directly writing to video memory. Being the adventurous type I ordained to try it. The device I had to use to accomplish anything was /dev/fb0current. The first picture is simply /dev/mem > /dev/fb0current. The second one is from writing the video memory to a file and then rewriting it back after moving around windows...it pretty much restored the state it was in including the AIM conversation. The third one is of something weird I found...I loaded a picture during one of these runs and found that it was permanently screwed up...even after restoring everything(By going to a VT and back to X), and refreshing the image it stayed the same, no clue why. The last one was simply switching to a vt and issuing sleep 3; cat /dev/urandom > /dev/fb0current; DISPLAY="0:0" ksnapshot and then switching to X(Rather bland but I put up anyway). All this was done in a Knoppix live CD. As always click pictures for higher res photos:

Edit: Jay pointed out to me that the last picture is gigantic(~2MB) compared to the other files (~0.2MB). This is due to the fact that since the data is random there is no way to compress it down, so every single pixel has to be accounted for.

No comments: