开发者

timer doesn't generate interrupts... or what?

#define TIMER_IVT_ENTRYNUM 0x1C or #define TIMER_IVT_ENTRYNUM 0x08

    prevInt = getvect(TIMER_IVT_ENTRYNUM);
    setvect(TIMER_IVT_ENTRYNUM, currInt);

that is how I set my own interrupt handler which looks like this:

void interrupt Timer::currInt(...) {
    (*prevInt)(); //old timer routine
    cout << "TIMER occurence" << endl;

    lock();
    counter++;
    tick(); //empty body

    if ( (Kernel::getRunning() -> getTimeSlice() > 0) )
        if (counter >= Kernel::getRunning() -> getTimeSlice()) {
           unlock();
           dispatch();
           //dispatchInterrupt();
        };

    unlock();
};

anyway, timer interrupts don't occur on their own, at all... but if i开发者_开发问答 call the int routine explicitly using geninterrupt(TIMER_IVT_ENTRYNUM) it works...

Like timer never generates interrupts itself... o.O I'm on Win XP 32bit, Borland C++ 3.1 (it's mandatory)


Are you trying to apply some DOS stuff in Win XP? The last OS where it could work was Win98. Starting from WinNT, you can have direct access to hardware resources only in the kernel mode, writing kernel mode drivers.

In your case, try to find some user-mode equivalent for a timer interrupt handling (like Multimedia timers, http://msdn.microsoft.com/en-us/library/dd743609(v=vs.85).aspx), or start writing Windows drivers: http://msdn.microsoft.com/en-us/windows/hardware/default.aspx

Regarding Borland C++ 3.1... I really have nothing to say :(

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜