DOS program is losing time compared to host clock

Discussions related to using VirtualBox on Windows hosts.
Post Reply
ES44AC
Posts: 7
Joined: 21. Dec 2012, 17:30

DOS program is losing time compared to host clock

Post by ES44AC »

Hello,

Please go easy on me this is my first post to the forum!

I am running HOST:VBOX 4.2.6 r82870 on Win 7 64, the guest is Win XP Pro 32 SP2 sorry I don't know what else you need here... The host has 6 GB RAM the processor is an Intel Core Two Quad the video card is an NVIDIA GeForce 8800 GTS.

The main reason I am running the VM is to allow me to use a DOS based satellite tracking program called STSORBITPLUS or simply STSPLUS. Upon getting things to work I note that the clock in STSPLUS is constantly losing time compared to the system clock on the host.

Can anyone tell me why the DOS program is losing time? The clock being accurate is of paramount importance to making accurate predictions of satellite accessibility.

Since I need to print out the predictions that are generated I chose to run the program under Win XP. If I were to install DOS and then use STSPLUS, I doubt I would be able to print out the data.

Thank you all in advance. There are other small problems but since I am allowed only one question per topic I will save them for later if the clock issue can be fixed!

Regards,

ES44AC
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Any and all
Contact:

Re: DOS program is losing time compared to host clock

Post by michaln »

ES44AC wrote:Can anyone tell me why the DOS program is losing time?
Not really. There are quite a few methods by which a DOS program can track time. Even if the standard DOS timekeeping is used, there is still a number of possible reasons why the time within the guest might be drifting.
ES44AC
Posts: 7
Joined: 21. Dec 2012, 17:30

Re: DOS program is losing time compared to host clock

Post by ES44AC »

michaln wrote:
ES44AC wrote:Can anyone tell me why the DOS program is losing time?
Not really. There are quite a few methods by which a DOS program can track time. Even if the standard DOS timekeeping is used, there is still a number of possible reasons why the time within the guest might be drifting.
I wouldn't have minded if you had named some specifics. I will say that the program never did this when running in Win XP & DOS without V Box.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: DOS program is losing time compared to host clock

Post by Perryg »

Let me give it a shot.

An OS (guest) in a virtual machine (regardless of which virtualizer) is not running on the hosts clock so to speak. To accomplish time sync they use an addition which we call guest additions to achieve the sync from guest to host. Now the issue is DOS does not have guest additions available, so that takes VirtualBox out of the equation of providing the sync. I don't know if the other virtualizers have additions for DOS but it would surprise me if they do. Whether it is possible to use something else I don't remember as it has been way to long since I had to do anything specific with DOS except for nostalgia.
jorgensen
Posts: 589
Joined: 20. Oct 2009, 01:22
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows

Re: DOS program is losing time compared to host clock

Post by jorgensen »

XP uses a virtual clock for 16-bit programs which i not synchronized with the real clock. To get the real clock, the program must call the 32-bit API in XP.

Win98 would work for you, or you could try DOSBox, which might have the real clock.
ES44AC
Posts: 7
Joined: 21. Dec 2012, 17:30

Re: DOS program is losing time compared to host clock

Post by ES44AC »

Thank you both for the details.

I will say that if I run my tracking program under XP w/o VBox it keeps much better time than with it. In fact after 7 hours of idle time my digital watch, the STS program and XP's clock all agree to the second. Conversely the STS program was 4 minutes behind when started in VBox, which I have removed.

I considered DOSBOX but would be unable to print out predication data as my printer is USB and STS wouldn't recognize it.
Thank you again, I may just keep my dual boot system the way it is if only to run my tracking program.

Regards,

ES44AC
michaln
Oracle Corporation
Posts: 2973
Joined: 19. Dec 2007, 15:45
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Any and all
Contact:

Re: DOS program is losing time compared to host clock

Post by michaln »

ES44AC wrote:I wouldn't have minded if you had named some specifics.
Well, that's like saying "I have a pet" and expecting me to guess if it's a cat, a dog, or a gold fish. There are so many possible DOS configurations that I wouldn't even know where to start. Since DOS didn't have a particularly rich API, various applications used very different methods to accomplish things. The general problem is that DOS applications often don't know how to be idle and hog the CPU all the time. They may also do interesting things to the hardware timers that make emulation harder. Since you're using this application (which I never heard of), I was hoping you might know something about it...
Post Reply