delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/03/14/01:02:11

Date: Sun, 13 Mar 1994 23:59:57 -0500 (EST)
From: "David J. Greback" <vette AT chopin DOT udel DOT edu>
Subject: Conflict with windows!!
To: DJGPP Mailing List <djgpp AT sun DOT soe DOT clarkson DOT edu>

This is a very simple routine, can somebody tell me why when windows is 
running I get a Segmentaion Violation trying to execute this code.

The only thing that I can guess is that writing to 0xD0000000 is either 
being used by windows or whatever. I have to admit that I am ignorrant of 
the DPMI.H and am striving to decypher it:) Please give a little help. It 
will be greatly appreciated. I love this compiler!!


#include <grx.h>
#include <std.h>
#include <malloc.h>



main()
{
  char *VideoScreen = (char *)0xD0000000;
  char *Buffer;

  Buffer = (char *)malloc(64000);
  
  memset(Buffer, 15, 64000);

  GrSetMode(GR_default_graphics); /* 320x200x256 */

  memcpy((char *)VideoScreen, (char *)Buffer, 64000);

  getkey();
  GrSetMode(GR_default_text);
  return 1;
}

/***************************************************************************/
/* David Greback vette AT strauss DOT udel DOT edu       University of Delaware       */
/* Jr. Systems Programmer  (302) 831-1129      NSS/Software Systems        */
/***************************************************************************/


- Raw text -


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