Newsgroups: comp.os.msdos.djgpp From: Butler Owen scm2211 Subject: GPF when trying to access VGA adapter Content-Type: TEXT/PLAIN; charset=US-ASCII Message-ID: Sender: news AT matilda DOT vut DOT edu DOT au Organization: Victoria University of Technology Mime-Version: 1.0 Date: Wed, 17 Jun 1998 14:07:26 GMT Lines: 51 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk I am having trouble making a pointer to my VGA card memory using djgpp. here is my code: // start #include #include void setgmode() { union REGS r; r.x.ax = 0x13; int86(0x10, &r, &r); } int main() { setgmode(); // sets vga adapter to mode 13h char * screen = (char *) 0xa0000000; for (int x = 0; x < 320; x++) for (int y = 0; y < 200; y++) screen[y*320+y] = (char) y; return 0; } //end This compiles fine, but when I try to run it, I get the following: General Protection Fault at eip=000015d4 eax=00000000 ebx=000221a0 ecx=00000000 edx=a0000000 esi=00000054 edi=0000a6d4 ebp=009c3fd4 esp=009c3fc8 program=C:\OWEN\CODE\A.EXE cs: sel=00a7 base=8266e000 limit=009c3fff ds: sel=00af base=8266e000 limit=009c3fff es: sel=00af base=8266e000 limit=009c3fff fs: sel=0087 base=0000a310 limit=0000ffff gs: sel=00bf base=00000000 limit=ffffffff ss: sel=00af base=8266e000 limit=009c3fff Call frame traceback EIPs: 0x000015d4 0x00001b42 eek. Am I declaring the pointer wrong? using it wrong? got the address wrong? Owen Butler