Please enable JavaScript to view this site.

Virtual Alpha User Guide

When VMS or Tru64 UNIX boot on a real system, it reads the current time from the battery?backed time-of-day clock chip. It also reads the time from the clock chip when a SET TIME operation is executed. It writes to the chip when SET TIME is used to change the system time. The rest of the time, VMS relies on getting a timer interrupt at regular intervals. VMS knows how many timer interrupts go into a second, and increments its own internal time accordingly.

As described in Avanti Clock, on the emulator, we have to emulate both the battery backed clock chip and the timer interrupt.

For the clock chip, when it is written to, i.e. whenever VMS does a SET TIME=, the emulator records the difference between the time set and the current Windows time in the .TOY file. Whenever the chip is read from, the current time is obtained from Windows and the saved difference applied. Thus, Avanti time is always an offset of Windows time.

For the timer interrupt, the Windows timer is not used because it is much to coarse-grained. Instead, Avanti estimates how many instructions the emulated CPU can execute in the time between two timer interrupts. It then uses a simple instruction counter in the CPU thread. After the CPU has executed that number of instructions, Avanti generates a timer interrupt. In the main emulator thread, Avanti periodically queries Windows time and use that information to adjust the information the CPU uses to keep track of time. If Avanti determines the emulated CPU has not generated enough interrupts, it lowers the counter threshold.

If Avanti sees it has generated too many interrupts, it raises the counter threshold. This mechanism depends on Windows time progressing normally. If one were to set the Windows time ahead by 4 years, the emulator would then believe that it has missed a massive number of interrupts and lower the threshold, telling the emulated CPU to start generating timer interrupts much more rapidly: i.e. Avanti time speeds up. Vice versa, if the time is set back 4 years, the emulator would believe it has generated too many interrupts and raise the threshold, making time slow to a virtual standstill: i.e. Avanti time slows down.

In short, avoid changing Windows time while Avanti is running. Doing so impacts Avanti time keeping and may have undesirable consequences in running applications.

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Nav Header: ALT+n
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Exit Menu/Up: ESC