Sleep function not working
Posted: Fri Dec 27, 2013 6:33 am
Hello,
I'm very new to OSdev, and I'm stuck. I have this sleep function:
and this is my PIT IRQ:
Now this code does not work, it just hangs forever. However, when I change the sleep function to:
it suddenly does work?
can someone explain this to me?
Thanks
I'm very new to OSdev, and I'm stuck. I have this sleep function:
Code: Select all
void sleep(uint32_t dur)
{
uint32_t goal_tick=tick+dur;
while(tick<=goal_tick);
return;
}
Code: Select all
static void timer_irq(uint32_t n)
{
tick++;
}
Code: Select all
void sleep(uint32_t dur)
{
uint32_t goal_tick=tick+dur;
while(tick<=goal_tick&&pow(5,5));//just add some random function call
return;
}
can someone explain this to me?
Thanks