counting seconds

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
sancho1980
Member
Member
Posts: 199
Joined: Fri Jul 13, 2007 6:37 am
Location: Stuttgart/Germany
Contact:

counting seconds

Post by sancho1980 »

hi

if i set my clock to a rate generator and set the reload value to 0x91A7 and then increment the "number of seconds" counter on every 32nd clock interrupt, that should be correct, or am i doing some calculation wrong?

im running on bochs and to me it seems seconds are passing *way* to fast (maybe even twice as fast as they should)...is that due to some inaccuracy with bochs or are my calculations wrong?
User avatar
lukem95
Member
Member
Posts: 536
Joined: Fri Aug 03, 2007 6:03 am
Location: Cambridge, UK

Post by lukem95 »

bochs timer is always fast, you can sync it to real time and it should be normal.

Try it with another emulator
~ Lukem95 [ Cake ]
Release: 0.08b
Image
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Freenode IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

bochs is by default set for speed and repeatability. i.e. time passes as fast as bochs can make it pass

to fix this, either use the realtime or the slowdown timer. The realtime one is faster, the slowdown is more accurate. check your bochs config for the IPS and clock lines and read the corresponding documentation
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Post Reply