I'm refining some code which simulated a context-switching scheduler on x86 Windows systems. The program compiles on Windows XP (Edit: probably not Windows 7) with some ancient Borland C compiler, and is being ported to being MSVC compilable.
At one point, the code installs ISRs through these unavailable functions in dos.h
:
void (*)() getvect(int)
void setvect(int, void (*)());
Specifically, the code installs an ISR for a (cyclic) timer interrupt. The calls are:
tick_isr_old = getvect(0x08);
setvect(0xF2, tick_isr_old);
setvect(0x08, (void interrupt (*)(void)) tick_isr);
setvect(0xF1, (void interrupt (*)(void)) context_switch_isr);
Does anyone have any idea what would be a reasonable way to set those ISRs (with the Windows API maybe?). To make things worse, the functions are implemented in assembly language (they need to perform a context switch after all...). Is there at least any documentation which interrupt vectors the integer constants (0x08, 0xF2, 0xF1) refer to? Google didn't really come up with something I could work with.
UPDATE: Since it is apparently not possible to get those DOS calls working in Windows 7, I need a way to asynchronously call a function in a generally single threaded environment.
Under linux, the signal()
and raise()
functions can do this, but under Windows they are only supported in the most minimal way that is possible. Is there a way to achieve that under Windows?