VOGONS

Common searches


First post, by IBM Portable PC

User metadata
Rank Newbie
Rank
Newbie

For applications that utilize the time, like BBS software, how accurate can the RTC emulation be?

How many seconds or minutes per hour will generally be lost?

Are there any ways to improve emulated RTC accuracy?

Last edited by IBM Portable PC on 2015-12-18, 20:28. Edited 1 time in total.

Reply 1 of 4, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

DOSBox is intended for running DOS games, and support for applications is incidental at best. You should consider a different virtualization for your BBS software, more so if you're concerned about issues of accuracy. That said, here's some information about time handling:

DOSBox uses the date and time from the host system when the emulated RTC registers are read directly or through INT 1Ah functions, so it's as accurate as the host.

The BIOS timer ticks, which are separate from the RTC and used by DOS time functions, are initially set to the host time when DOSBox starts up and can drift out of sync with the host as the session goes on. Software running within the emulation can affect the amount/rate of drift. Some unofficial builds have a patch which tries to keep the timer synced with the host.

Reply 2 of 4, by Scali

User metadata
Rank l33t
Rank
l33t

I would like to add that the RTC was not available on the PC and XT models, and was introduced on the AT.
So there's a good chance that software doesn't try to read the RTC directly, but uses DOS time functions instead, because this is the more compatible and common way to handle time in DOS (in that case, the RTC is only used on startup by DOS to set the initial time, after which it continues keeping time with BIOS ticks).
In other words, you probably aren't looking for good RTC accuracy, but for good timer tick accuracy.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 3 of 4, by IBM Portable PC

User metadata
Rank Newbie
Rank
Newbie
Scali wrote:

I would like to add that the RTC was not available on the PC and XT models, and was introduced on the AT.
So there's a good chance that software doesn't try to read the RTC directly, but uses DOS time functions instead, because this is the more compatible and common way to handle time in DOS (in that case, the RTC is only used on startup by DOS to set the initial time, after which it continues keeping time with BIOS ticks).
In other words, you probably aren't looking for good RTC accuracy, but for good timer tick accuracy.

Ah yes, thank you for refreshing my memory from my PCDOS days.....

I spent a few hours with Google and found: http://ansis.lv/uptimer/index.en.php

Uptimer appears to work well with DOSBox, however I have only used it for about one hour. I will update this thread in a few days time once I have time to test further.

Reply 4 of 4, by IBM Portable PC

User metadata
Rank Newbie
Rank
Newbie
IBM Portable PC wrote:

Ah yes, thank you for refreshing my memory from my PCDOS days.....

I spent a few hours with Google and found: http://ansis.lv/uptimer/index.en.php

Uptimer appears to work well with DOSBox, however I have only used it for about one hour. I will update this thread in a few days time once I have time to test further.

I have now tested Uptimer for several hours, over a few days, and have not experienced any issues.

Uptimer keeps the time accurate to at least within a minute or less, likely within about 10 seconds of the hosts clock.

I don't mind using a TSR to correct the time, however I am open to all other suggestions.