Mail Archives: djgpp/1995/12/20/01:35:44
On 18 Dec 1995, Laszlo Vecsey wrote:
> Help! I get a general protection fault when accessing a pointer to video memory.
>
> In Borland C++ I'm used to putting pixels to the screen as follows:
>
> unsigned char far *videomemory = (unsigned char far*)(0xA0000000);
> videomemory[320*y+x] = color;
Please read the DJGPP FAQ list (available as faq102.zip from the same
place you get DJGPP), section 10.6, which explains why this won't work
and gives you a way to do this correctly. The short answer is that in a
protected-mode environment you cannot just poke any address, you must do
it in a way that's compliant with memory-protection mechanism.
- Raw text -