http://www.osdev.org/mediawiki/index.ph ... ample_Code
I recently setup my exception handlers and I have setup the PIT IRQ.
Now, I was wondering how could I accurately calculate how many fractions of an mS and how many mS should I add to the system timer each time the IRQ fires?
I tried looking at the code example, but for some reason I don't really get why 2^32 and 256 is used everywhere (I do understand why the example uses 3579545/3 though). Maybe coffee level dropped too low or I didn't sleep enough, but I'm not getting it at the moment.
Anyone want to look at it and perhaps post their thoughts?
PIT Channel 0 Example Code @ Wiki
Re: PIT Channel 0 Example Code @ Wiki
Hi,
![Wink ;)](./images/smilies/icon_wink.gif)
Cheers,
Brendan
I took a look - it was unnecessarily complicated and had some bugs. I fixed the bugs and simplified it a little...bughunter wrote:I tried looking at the code example, but for some reason I don't really get why 2^32 and 256 is used everywhere (I do understand why the example uses 3579545/3 though). Maybe coffee level dropped too low or I didn't sleep enough, but I'm not getting it at the moment.
Anyone want to look at it and perhaps post their thoughts?
![Wink ;)](./images/smilies/icon_wink.gif)
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.