It sounds like you want to write some secret message on the screen from your hardware or driver.
It’s going to be WAY more complex than just writing to physical address 0xA0000. That might have worked in 1986, but displays are a lot more complex now.
If you search this list, you will find a thread from a year or so ago (with comments from me) about having an app allocate a DirectX surface and passing that down to a driver that then writes to it. This method should be pretty independent of that hardware. There was a report in that thread of this being successful. I once used this for testing some inter device DMA operations, and the video buffer just happened to be a handy high bandwidth target.
You also realize if you write to the screen buffer, an application can potentially read the screen buffer and capture anything you display. Windows DOES have support for DRM protected video, which should (in theory) not be accessible by a user mode program. You might investigate what a DRM protected video kernel component needs to do to generate protected content.
Jan
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@gmail.com
Sent: Wednesday, March 14, 2012 11:05 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] How to directly write to the frame buffer in windows driver
I am writing the driver that can directly write data to the frame buffer, so that I can show the secret message on the screen while the applications in user space can’t get it. Below is my code that trying to write the value to the frame buffer, but after I write the value to the frame buffer, the values i retrieved from the frame buffer are all 0.
I am puzzled, anyone knows the reason? Or anyone knows how to display a message on the screen while the applications in the user space can’t get the content of the message? Thanks a lot!
#define FRAME_BUFFER_PHYSICAL_ADDRESS 0xA0000 #define BUFFER_SIZE 0x20000
void showMessage()
{
int i;
int *vAddr;
PHYSICAL_ADDRESS pAddr;
pAddr.QuadPart = FRAME_BUFFER_PHYSICAL_ADDRESS;
vAddr = (int *)MmMapIoSpace(pAddr, BUFFER_SIZE, MmNonCached);
KdPrint((“Virtual address is %p”, vAddr));
for(i = 0; i < BUFFER_SIZE / 4; i++)
{
vAddr[i] = 0x11223344;
}
for(i = 0; i < 0x80; i++)
{
KdPrint((“Value: %d”, vAddr[i])); // output are all zero
}
MmUnmapIoSpace(vAddr, BUFFER_SIZE);
}
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer