delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/03/21:35:29

Date: Fri, 3 Oct 1997 18:33:56 -0700 (PDT)
Message-Id: <199710040133.SAA18135@adit.ap.net>
Mime-Version: 1.0
To: "Aleko" <pbpetkov AT pathcom DOT com>, djgpp AT delorie DOT com
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: Memory in Protected Mode

At 12:38  10/3/1997 GMT, Aleko wrote:
>Hi,
>
>I recently downloaded DJGPP and am just learning to program in a 32-bit
>environment. I found an example (an SVGA PCX viewer) originally written for
>Watcom C++. It compiles with no problems, but when I run it, it displays a
>completely blank screen.
>
>I remember reading somewhere something about not being able to just write
>to video memory. If this is the case, then how _can_ you write to it.
>Here's how the example does it:
>
>memcpy( 0xA0000, Buffer, 65536 );
No you can't do it that way. Watcom is a poor excuse for a 32-bit compiler;
it doesn't really provide memory protection. Try the following:

#include <sys/movedata.h>

dosmemput(Buffer,65536,0xA0000);
/* or... */
movedata(_my_ds(),Buffer,_dos_ds,0xA0000,65536);

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


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