From: Leif Leonhardy Newsgroups: comp.os.msdos.djgpp Subject: __dpmi_simulate_real_mode_procedure_retf[stack](): Links to bug fixes? FAQ? Date: Sat, 08 Sep 2001 05:42:47 +0200 Organization: delta t Computerservice Lines: 77 Message-ID: <3B9993B7.7673E4B7@dtcs.de> NNTP-Posting-Host: pd9e0e1c2.dip0.t-ipconnect.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.online.de 999920491 24719 217.224.225.194 (8 Sep 2001 03:41:31 GMT) X-Complaints-To: abuse AT online DOT de NNTP-Posting-Date: 8 Sep 2001 03:41:31 GMT Cc: leif AT dtcs DOT de X-Mailer: Mozilla 4.01 [de] (Win95; I) X-Priority: 3 (Normal) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com DISCLAIMER: I've not been using djgpp much the *last years* so I didn't follow the mailing list... I'm trying to search the mail archive but queries are that kind of slow... :-( PROBLEM: passing arguments to real mode procedures via the (which?!) stack I tried BOTH __dpmi_simulate_real_mode_procedure_retf_stack() AND __dpmi_simulate_real_mode_procedure_retf() setting up the stack (regs.x.ss, regs.x.sp) by myself - with exactly the same results. Few minutes ago ;-) I was happy to find a patch for d0301_s.S (from about a year ago), not immediately realizing that this patch wouldn't solve my problem because the function without the extra stack parame- ters behaves exactly (?) the same :-( [Btw: The fixed bug (s.a.) in the ..._stack() version is so obvious even to me that I only wondered that it is (still) there and, as somebody mentioned, nobody seems to use this function. On the other hand I found 'happy' people's statements 'now it works' in the archive dated between 1995 and 1997...] What I want to do is to call the ASPI manager which takes one argument from the stack, a pointer to the SRB (SCSI request block). Getting the ASPI function entry point and calling it works fine (and I'm sure I'm really calling it), but waiting for SRB completion by polling the status byte in the SRB (in conventional memory of course) won't terminate, i.e., status remains 'pending' until I interrupt it - no error occurs. Then I got the idea of inspecting AX (the place where C programmers expect a return value - but the DOS ASPI spec doesn't mention any return value but the status byte in the SRB!) and found 81h, which indicates 'Invalid host adapter'. But my specified host adapter (0) should always (and does) exist in HA_inquiry, which returns information not only about installed host adapters but the driver itself (i.e., it should at my opinion never fail unless there's actually no driver. So what follows is that the ASPI manager seems to get some 'random' SRB (address), which on one hand specifies some non-existing host adapter (!=0), on the other hand makes it impossible for me to observe the SRB's status. [Still want to read more? I first used GO32's transfer buffer for the SRB because DJ says I can do that - try some debugging printf()s between dosmemput() and the DPMI call! ;-) ] To come to an end: I verified that a) the buffer in conventional memory is set up properly and contains valid data b) the registers in the __dpmi_regs structure contain what one would expect (no single-step in %eflags) c) the function specified in CS:IP is successfully called [I resorted to BASIC/C64 times and poked (real mode) test functions in a buffer and called them; B8 11 47 CB* returns 4711h (in AX) while 58 5B 53 50 CB** does NOT return anything I passed via the stack.] d) the behaviour does not depend on calling the ..._stack() or the other version (with SS:SP and what it points to set up manually) of the function _________ * mov ax,4711; retf ** pop ax; pop bx; push bx; push ax; retf Thanks in advance for any help, hint or pointer to this problem and/or its solution, or to a fast mirror of DJ's mailing-list archive search engine! (Wouldn't it be a nice idea to sort the search results by date, too?) Leif (leif AT dtcs DOT de) P.S.: - Configuration: DOS Box within Win95b, DJGPP 2.03, Pentium, 64MB,... - I thought ASPI were a common topic being 'where is libaspi.a?' a FAQ by newbies, so years later: where is it or why isn't it there? (I read DJ wrote a CD-R burn program years ago...)