www.delorie.com/djgpp/v2faq/faq153.html | search |
| Previous | Next | Up | Top |
_go32_...
functions, but now comes v2 which also has __dpmi_...
functions. Are there any differences between these two
varieties?
Q: Do I need to convert my old v1.x code to use the new __dpmi_...
functions?
__dpmi_...
functions are just bare-bones wrappers of the DPMI API calls (see DPMI Specification), generally unsuitable for use with handlers written in C,
whereas the old _go32_...
functions are intelligent helper routines which only make sense if your interrupt handlers are C functions. They save all the registers on the stack (to be
restored before return to caller), and set up DS, SS, and ES registers as GCC assumes in the code it produces for a C program. If these assumptions
are wrong, the C functions called by an interrupt handler will crash miserably.
The problem with the _go32_...
functions is that they don't lock all the code and data they (and your handlers) use, so they can crash on memory-tight machines and thus aren't suitable
for production-quality code. But they are certainly useful in the initial stages of writing and debugging code that hooks hardware interrupts, and for migrating existing v1.x code to v2. Some of
the old names were just #define
d to the new names where the functionality is identical.
The bottom line is that it shouldn't be necessary to convert your code for it to work at least as well as it did in v1.x; but if you want it to be more stable, you should rewrite your handlers in
assembly and use the new __dpmi_...
functions (see How to install a hardware interrupt handler).
webmaster donations bookstore | delorie software privacy |
Copyright ⌐ 1998 by Eli Zaretskii | Updated Sep 1998 |
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)