Mail Archives: djgpp/1999/04/02/01:02:18
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 -