www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/04/02/01:02:18

Date: Fri, 2 Apr 1999 08:00:15 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Kecskemeti Balazs <balazs AT tiszanet DOT hu>
cc: djgpp AT delorie DOT com
Subject: Re: _farsetsel?
In-Reply-To: <7dt8lm$10a$1@bolka.matav.net>
Message-ID: <Pine.SUN.3.91.990402075347.22974E-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 31 Mar 1999, Kecskemeti Balazs wrote:

>     mi.size=vib.TotalMemory*65536;    // this is 2048K
>     mi.address=mib->PhysBasePtr;      // this is 0xE0000000
>     __dpmi_physical_address_mapping(&mi);    // successful
>     __dpmi_set_segment_base_address(sel, mi.address);
>     __dpmi_set_segment_limit(sel, 120000);
                                    ^^^^^^
Where did that 120,000 come from?  The size of the memory is 
vib.TotalMemory*65535 (which is 2MB as you say in the comment).  So what 
kind of number is 120000?

Also, please note that the limit should be 1 less than the size, so you 
need to subtract 1.

> how can _farsetsel cause a GPF, when eveything is valid?

Please always post the entire regsiters' dump and call traceback when you 
report crashes.  This is very important information you omitted.

> i debugged
> the program, and a 'mov fs,bx' instruction causes it, where bx is
> 0x12f - seems correct, doesn't it?

One of the possible reasons could be the access rights you define.  
Please post the details why 0x4092 is the right value in your case.

- Raw text -


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