Date: Fri, 2 Apr 1999 08:00:15 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Kecskemeti Balazs cc: djgpp AT delorie DOT com Subject: Re: _farsetsel? In-Reply-To: <7dt8lm$10a$1@bolka.matav.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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.