Mail Archives: djgpp/1999/04/01/16:26:06
From: | "Kecskemeti Balazs" <balazs AT tiszanet DOT hu>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | _farsetsel?
|
Date: | Wed, 31 Mar 1999 15:40:03 +0200
|
Organization: | MatavNet
|
Lines: | 35
|
Message-ID: | <7dt8lm$10a$1@bolka.matav.net>
|
NNTP-Posting-Host: | ppp148.tiszanet.hu
|
X-Trace: | bolka.matav.net 922887670 1034 195.228.98.148 (31 Mar 1999 13:41:10 GMT)
|
X-Complaints-To: | abuse AT matav DOT net
|
NNTP-Posting-Date: | 31 Mar 1999 13:41:10 GMT
|
X-Newsreader: | Microsoft Outlook Express 4.72.2106.4
|
X-MimeOLE: | Produced By Microsoft MimeOLE V4.72.2106.4
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
Hi!
i compiled something like this:
#include "vesa.h"
#include <dpmi.h>
#include <sys\farptr.h>
#include <stdio.h>
int main()
{
__dpmi_meminfo mi;
short sel = __dpmi_allocate_descriptors(1); // successful
InitVbe();
SetVbeSurface(400,300,8); // these set up VESA 400x300x256 mode
ok (LFB)
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);
__dpmi_set_descriptor_access_rights(sel, 0x4092); // successful
_farsetsel(sel); // that causes GPF
_farnspokeb(0,15);
getch();
ShutDown(); // back to text mode
}
how can _farsetsel cause a GPF, when eveything is valid? i debugged
the program, and a 'mov fs,bx' instruction causes it, where bx is
0x12f - seems correct, doesn't it? Then, what can be the problem?
Please help.
Thanks.
- Raw text -