delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/04/04/01:49:09

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: DOS/Windows Pointer Corruption
Date: Thu, 04 Apr 2002 09:30:47 +0300
Lines: 28
Message-ID: <3CABF317.991AE1AE@is.elta.co.il>
References: <3CAA5C53 DOT 6020805 AT vif DOT com> <3CAA9C0E DOT 24631B8C AT is DOT elta DOT co DOT il> <3CAB71AB DOT 3060807 AT vif DOT com>
NNTP-Posting-Host: 192.116.55.139
Mime-Version: 1.0
X-Trace: fu-berlin.de 1017902109 29706431 192.116.55.139 (16 [61365])
X-Mailer: Mozilla 4.7 [en] (Win98; I)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Sahab Yazdani wrote:
> 
> > Doesn't the VESA initialization function returns a pointer in conventional
> > memory?  If so, you cannot use memset with it, unless you enable near
> > pointers and add __djgpp_conventional_base to the pointer VESA returns.
> 
> i *do* add __djgpp_conventional_base as it wouldn't work in either DOS
> or windows if I didn't (also using this line to enable near pointers:
> int _crt0_startup_flags = _CRT0_FLAG_NEARPTR | _CRT0_FLAG_NONMOVE_SBRK; )

Well, in that case, more information is needed to understand what's wrong. 
Charles asked for the full crash message; in addition, at least the code
fragments that call the VESA function, add __djgpp_conventional_base to it,
and then call memset, would be useful.

Does the VESA function return a positive indication that it succeeded?

> > Also, what size is the memory region set up by the VESA function, and what
> > is the value of width*height*bitDepth?
> 
> well I am finding a 640X480 by 8 bit screen (standard mode 0x101), and
> width*height*bitDepth>>3 is 921600 bytes.  but I don't think that VESA
> gives the actual size of the memory region, and that this *is* the way
> to calculate it).

Well, obviously, there should be _some_ relation between the argument you
pas to memset and the size of the memory allocated by VESA.  Otherwise, you
are accessing memory that doesn't belong to you.

- Raw text -


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