cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/14/15:44:18

Message-Id: <199709140119.LAA12066@rabble.uow.edu.au>
Subject: Re: How can i create a working virtual screen i DJGPP?
To: 97andbj AT ostrabo DOT uddevalla DOT se (Andreas Björk)
Date: Sun, 14 Sep 1997 11:19:58 +1000 (EST)
Cc: djgpp AT delorie DOT com (DJGPP)
In-Reply-To: <34196A4D.1539879@ostrabo.uddevalla.se> from =?UNKNOWN-8BIT?Q?Andreas_Bj=F6rk?= at "Sep 12, 97 06:14:05 pm"
From: *** Brett *** <bporter AT rabble DOT uow DOT edu DOT au>
MIME-Version: 1.0

[Charset iso-8859-1 unsupported, filtering to ASCII...]
> How can i easy create a virtual screens and then flip them to the
> VGA memory (0xA0000)?? Is there anyone out there who has
> good routines for it??
>
> 
> Exiting due to signal SIGSEGV
> General Protection Fault at eip=000126b9

These few lines are a good indication that you did something that protected
mode didn't like. :(

> ------------------------------------------------------------------------
> 
> parts of my code:
> 
> void SetUpVirtual()
> {
>   unsigned char *ScreenBuf = (unsigned char*) calloc(64000,1);

Just curious... why not use malloc or xalloc instead of this calloc?

>   memcpy(vga,ScreenBuf,64000);
This is the culprit... I assume you set up vga like this:

unsigned char *vga = 0xA0000;

This will not work in protected mode. Try _dosmemput(__dos_ds+0xA0000,64000).

This probably makes no sense to you, but I don't really need to try and give
a full explanation here as Eli has already done such a good job in the FAQ. 
Check out the info docs for information on _dosmemput, and some other handy
things for accessing physical memory addresses, like _farpoke/_farpeek and
movedata.

I can't point you to the right section in the FAQ right now because it is on
my computer, not where I am typing this, but I'm sure you will be able to
find it :)

Good luck
Brett

-- 
Brett Porter
bporter AT rabble DOT uow DOT edu DOT au

http://www.geocities.com/CollegePark/Union/3596
	Humour, Programming, and more.

- Raw text -


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