Google Grupper støtter ikke lenger nye Usenet-innlegg eller -abonnementer. Historisk innhold er fortsatt synlig.

Simulate real mode procedure call (retf)

Sett 3 ganger
Hopp til første uleste melding

Igor

ulest,
11. juni 2003, 04:05:4111.06.2003
til
Trying to allocate XMS memory, I used DPMI function 0x0301 to call XMS
service function. But result was in silent system crush in function
0x0301 call (int386x()).

I post some source code, does anyone see what's wrong?
Has anyone coded a Realmode/Protectedmode program in Watcom? Can you
give me some examples?

Target: Dos 6.22 PM
Compiller: Watcom C 11.0c
Extender: DOS4G 2.60 Professional (which supports DPMI 301h)

Additional: only himem.sys loaded with no options


====[ Code Snippet START
]=============================================

union REGS inregs, outregs;
struct SREGS sregs;

memset(&inregs, 0, sizeof(inregs));
memset(&outregs, 0, sizeof(outregs));

// check for XMS services present

inregs.w.ax=0x4300;
int386(0x2F, &inregs, &outregs);
if (outregs.h.al!=0x80)
exit(0); // services not present


memset(&inregs, 0, sizeof(inregs));
memset(&outregs, 0, sizeof(outregs));

// get service function real mode address (ebx:esi)

inregs.w.ax=0x4310;
int386(0x2F, &inregs, &outregs);

// try to call this service to get XMS version

/* Set up real-mode call structure */

memset(&RMI,0,sizeof(RMI));

// put address into CS:IP

RMI.CS=outregs.x.ebx;
RMI.IP=outregs.x.esi;

memset(&inregs, 0, sizeof(inregs));
memset(&outregs, 0, sizeof(outregs));
memset(&sregs, 0, sizeof(sregs));

/* Use DPMI call 301h to issue the DOS function call */

inregs.x.eax=0x0301;

sregs.es = FP_SEG(&RMI);
inregs.x.edi = FP_OFF(&RMI);

int386x(0x31, &inregs, &outregs, &sregs);

// on the last line program crushes without any info


====[ Code Snippet END ]=============================================

Igor

ulest,
13. juni 2003, 07:38:5413.06.2003
til

inregs.w.ax=0x4310;
int386(0x2F, &inregs, &outregs);

memset(&RMI,0,sizeof(RMI));

RMI.CS=outregs.x.ebx;
RMI.IP=outregs.x.esi;

inregs.x.eax=0x0301;

int386x(0x31, &inregs, &outregs, &sregs);

---== Posted via the PFCGuide Web Newsreader ==---
http://www.pfcguide.com/_newsgroups/group_list.asp

0 nye meldinger