Mail Archives: djgpp/1998/06/18/10:48:26
On Wed, 17 Jun 1998 14:07:26 GMT in comp.os.msdos.djgpp Butler Owen
scm2211 <s9708172 AT tiger DOT vut DOT edu DOT au> wrote:
...
: char * screen = (char *) 0xa0000000;
: for (int x = 0; x < 320; x++)
: for (int y = 0; y < 200; y++)
: screen[y*320+y] = (char) y;
...
: This compiles fine, but when I try to run it, I get the following:
: General Protection Fault at eip=000015d4
...
: Am I declaring the pointer wrong? using it wrong? got the address wrong?
"Yes", "perhaps" and "sort of". Accessing the video memory from
protected mode is a fairly complex issue, and you should refer to the
FAQ, particularly sections 10.2 and 18.4. If you are still confused
after reading these sections, ask again explaining what you don't
understand. You might like to take a look at some existing source
code to access video memory in djgpp; there are links from DJ
Delorie's djgpp web pages at:
http://www.delorie.com/djgpp/
and from Brennan Underwood's djgpp web pages:
http://brennan.home.ml.org/djgpp/
--
george DOT foot AT merton DOT oxford DOT ac DOT uk
xu do tavla fo la lojban -- http://xiron.pc.helsinki.fi/lojban/lojban.html
- Raw text -