Global Timer Issue
Posted: Sun Jun 24, 2012 3:06 am
Hello, mates,
I've got my multitasking working and it is working - well nice enough.
Now I encountered a "how is this even possible" kind of issue.
So basically, I have three threads that just "hlt" in a loop - their page directories are all linked above 3Gb mark and each has its own stack.
My IRQ0 event handler looks like this:
The problem is, every 1000 ticks( 1 second) I get three lines in the console of identical value. Four if I have four threads running, and so forth.
Any ideas on how it's possible? I have verified that Ticks points to the same physical address in all threads, and also interrupts are disabled in the IRQ stub.
I've got my multitasking working and it is working - well nice enough.
Now I encountered a "how is this even possible" kind of issue.
So basically, I have three threads that just "hlt" in a loop - their page directories are all linked above 3Gb mark and each has its own stack.
My IRQ0 event handler looks like this:
Code: Select all
Ticks++;
if(Ticks%1000==0)
{
*Graphics::GetConsole()<<Ticks<<endl;
}
...
Any ideas on how it's possible? I have verified that Ticks points to the same physical address in all threads, and also interrupts are disabled in the IRQ stub.