PIT Question under Bochs

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
elaverick

PIT Question under Bochs

Post by elaverick »

I've been using the following code to implement the PIT in my Kernel http://www.osdever.net/bkerndev/Docs/pit.htm the thing is the comments in the code suggest that 18 ticks should be equal to one second with the default phase. Now I've tried both with the default phase and with a phase of 100Hz using the phase changing code also included in that tutorial but both seem to be off by a magnitude of 10 when run under Bochs (E.G. It's actually 180 ticks or 1000 ticks per second). So is Bochs simulating too fast or are the code comments incorrect?
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:PIT Question under Bochs

Post by Candy »

elaverick wrote: So is Bochs simulating too fast or are the code comments incorrect?
I'm going to go for "you didn't configure bochs". Did you tell bochs how fast to simulate? Do you happen to make about 10 million IPS? That pretty much explains it. You can recompile bochs to use your real computers timing for those events, which make them more predictable but they do make your output non-repeatable.
elaverick

Re:PIT Question under Bochs

Post by elaverick »

Perfect, thanks. I'd missed it the first time I'd configured Bochs, I'd assumed it would run in real time by default. Another case of RTFM I'm afraid.
Post Reply