[Info-vax] clock problems with OpenVMS x86 on VirtualBox

gah4 gah4 at u.washington.edu
Fri May 12 06:24:37 EDT 2023


On Friday, May 12, 2023 at 2:56:13 AM UTC-7, Johnny Billquist wrote:

(snip, I wrote)

> > How does VMS keep track of time?

> Same as pretty much anything else. You have a clock interrupt at a 
> regular interval and the OS counts time based on that. 
 
> VMS started off on the VAX, however, and that architecture do not have a 
> WAIT instruction, so at idle, the processor is really just spinning. 
> Not sure if that was amended on Alpha or later. 
 
> But a WAIT is commonly only stopping the processor until something 
> happens, which usually is an interrupt. If there is still nothing to do 
> after the interrupt handler finish, the processor would loop back to the 
> WAIT again. 
 
Yes.  On the other hand, when the OS gives up, usually at IPL time when
something fails, there is disabled WAIT state.  That is, no interrupts
enabled, in which case it stops.

> simh (for example) do detect the idle loop in VMS (on VAX), and pause 
> execution if it detects this loop, to let the host rest. 
 
Some put a special instruction in the loop to make it easier for emulators.

There are two time related things that OS need to do.  One is tell what
time of day, month, year, it is.  The other is task switching, and any other
short time related events.  

IBM S/360 uses the same system for both, as you describe.

But S/370 adds a TOD clock, which keeps track of time, and a separate
system for non TOD related timing.  One complication with the TOD clock
in Y2K days, is that access is not privileged, such that it can't be emulated
by VM.  So, VM/370 and successor guests read the hardware TOD clock.
But other timing uses a different timer which is emulated.

So, some VirtualBox guests have a special way to get the host clock for 
TOD functions, but the interrupt clock for others. Saves a lot of work
keeping two clocks synchronized.







More information about the Info-vax mailing list