#include <dpmi.h> int _go32_dpmi_set_protected_mode_interrupt_vector(int vector, _go32_dpmi_seginfo *info);
See section DPMI Overview
This function sets the protected mode interrupt vector specified to
point to the given function. The pm_offset
and
pm_selector
fields of info must be filled in
(see section _go32_my_cs). The following should be noted:
longjmp
out of an interrupt handler.
printf
.
_go32_dpmi_allocate_iret_wrapper
and
_go32_dpmi_chain_protected_mode_interrupt_vector
functions can
wrap your function if you want.
_go32_my_cs
to get a selector valid for your functions.
Zero on success, nonzero on failure.
not ANSI, not POSIX
volatile int tics = 0; timer_handler() { tics++; } int main() { _go32_dpmi_seginfo old_handler, new_handler; printf("grabbing timer interrupt\n"); _go32_dpmi_get_protected_mode_interrupt_vector(8, &old_handler); new_handler.pm_offset = (int)tic_handler; new_handler.pm_selector = _go32_my_cs(); _go32_dpmi_chain_protected_mode_interrupt_vector(8, &new_handler); getkey(); printf("releasing timer interrupt\n"); _go32_dpmi_set_protected_mode_interrupt_vector(8, &old_handler); return 0; }
Go to the first, previous, next, last section, table of contents.