Mail Archives: djgpp/1997/09/14/15:44:18
[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 -