From: George Foot Newsgroups: comp.os.msdos.djgpp Subject: Re: GPF when trying to access VGA adapter Date: 17 Jun 1998 17:47:32 GMT Organization: Oxford University, England Lines: 34 Message-ID: <6m8vfk$jnj$1@news.ox.ac.uk> References: NNTP-Posting-Host: sable.ox.ac.uk To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk On Wed, 17 Jun 1998 14:07:26 GMT in comp.os.msdos.djgpp Butler Owen scm2211 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