Message-Id: <200007181612.TAA00842@mailgw1.netvision.net.il> Date: Tue, 18 Jul 2000 19:11:56 +0200 To: Szopko Szilard X-Mailer: Emacs 20.6 (via feedmail 8.2.emacs20_6 I) and Blat ver 1.8.5b From: "Eli Zaretskii" CC: djgpp AT delorie DOT com In-reply-to: (message from Szopko Szilard on Tue, 18 Jul 2000 07:48:16 +0200 (DFT)) Subject: Re: TSR program containing interrupt handler in DPMI. References: Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Date: Tue, 18 Jul 2000 07:48:16 +0200 (DFT) > From: Szopko Szilard > > The functions of the driver use DPMI so I have to write the interrupt > handler and the hole program in DJGPP. I know, how to write an interrupt > handler and a TSR program in real mode, but I have never wrote them in > protected mode. The writing of a interrupt handler is not a problem, the > DJGPP offers well used routines for this purpose. The making of a TSR > program seems more difficult. Are you sure you really need a TSR? You instead could write a normal DJGPP program which installs a handler for Int 1Ch, and then spawns a secondary COMMAND.COM. Won't this be good enough for you? > I have found two functions called > __dpmi_terminate_and_stay_resident and > __dpmi_install_resident_service_provider_callback. When I wanted to take > resident a program in real mode I had to call the keep function at the end > of the program. It seems the first function is similar to the keep > function in its operation, but if I would like to use this routine I have > to call the second function before. The second routine has a > __dpmi_callback_info type parameter. I don't know how to fill its fields, > and I haven't found document explains this to me. I don't want to try. Download v2tk/djgpptsr.zip and look there. It includes a small but functional TSR that works with CWSDPMI. Note that the DPMI functions you mentioned above are not part of the DPMI 0.9 spec, and so most DPMI servers don't support them. In addition, TSRs in DPMI are tricky, to say the least. So I really suggest to try the alternative approach I mentioned above. > How shall I use the __dpmi_terminate_and_stay_resident and > __dpmi_install_resident_service_provider_callback functions? > What does the argument of the two functions mean exactly? > How does the fields of the __dpmi_callback_info structure mean exactly and > how shall I fill it to take a program TSR? If you are serious about these questions, I suggest to download the DPMI v1.0 spec (the URL is in the DJGPP FAQ, section 22.6) and carefully read the description of these functions.