From: Mitch Randall Newsgroups: comp.os.msdos.djgpp Subject: Re: Lauching ASPI from DJGPP Date: Thu, 25 Sep 1997 14:31:30 -0600 Organization: National Center for Atmospheric Research Lines: 35 Message-ID: <342ACA22.12A7@ncar.ucar.edu> References: <3426D17B DOT 2A6B AT ncar DOT ucar DOT edu> NNTP-Posting-Host: 128.117.78.142 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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); }