Write directly to video buffer in modern os : I want to draw red line on my monitor directly writing to memory from my c++ code.

I know that modern operating system protect physical memory and it is hard to do. 

Assuming that I know video card that I`m currently using(it is nvidia geforce 820m in my case) also I could give all needed system rights for my application. I know that this is "bad idea". It is just my curiosity.

Is it possible on linux or windows?