Mail Archives: djgpp/1997/09/27/02:00:38
Thanks everyone for your responses. I finally got it to work. Here is the nice
looking final code in case anyone is interested. The real problem was that the
other routines where not pointing to the same place as SrbSeg. I used
__djgpp_nearptr_enable() and __djgpp_conventional_base to fix my problem. (i.e.
address is NOT SrbSeg << 4).
By the way, in response to Eli Zaretskii's post, aspientry came from:
handle = open("SCSIMGR$",O_RDONLY);
ioctl(handle,DOS_RCVDATA,4,(int)&aspientry);
so it is really a 32 bit quantity with the top word being the segment, and the
bottom word being the offset. Sorry for the unclear code.
Here is the final working code for reference:
void aspi(void)
{
__dpmi_regs regs;
short stack[2];
/* clear the dpmi register */
memset(®s,0,sizeof(__dpmi_regs));
/* push the segment and offset off SRB onto the real mode stack (image) */
stack[1] = SrbSeg;
stack[0] = 0;
/* point real mode Data structure to real mode entry point */
regs.x.cs = aspientry >> 16;
regs.x.ip = aspientry & 0xFFFF;
/* call the real mode aspi driver */
__dpmi_simulate_real_mode_procedure_retf_stack(®s,4,stack);
}
- Raw text -