www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/18/10:48:26

From: George Foot <mert0407 AT sable DOT ox DOT ac DOT uk>
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: <Pine DOT SOL DOT 3 DOT 95 DOT 980617235959 DOT 21339B-100000 AT tiger DOT vut DOT edu DOT au>
NNTP-Posting-Host: sable.ox.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019