Date: Tue, 18 Jul 2000 07:48:16 +0200 (DFT) From: Szopko Szilard To: djgpp AT delorie DOT com Subject: TSR program containing interrupt handler in DPMI. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Dear Colleagues! My name is Szilard Szopko. I'm working at the Research Institute of Applied Chemistry in Miskolc in Hungary. I have to program hardware and I have a problem which I haven't been able to solve yet. I'm working on a CAN-PCI331 type CAN-BUS interface card. I have to fit this device to a program written in TURBO PASCAL under MS-DOS operating system. The install disk of the card contains only a driver written in GNUC. I have tried to include the routines of the driver into PASCAL, but it seems, it's not possible. So I have thought, I write a TSR program using the functions of the driver. This program is an interface beetwen the card and the PASCAL program. The PASCAL program and the interface program communicate through any kind of reserved memory area. The interface program has an interrupt handler routine chained to the 1Ch interrupt handler. This routine examine the status of the memory area used in the communication, and call the functions of the driver, if it's suitable. 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. 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. So I have the following questions: How shall I write a TSR program in protected mode? 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? Whould you send me some small sample program? Would You help me? It will be very important and urgent! My E-mail address: szopko AT me DOT akki DOT hu Best Regards!