On Wednesday, March 13, 2013 at 12:29 PM, Brian Hechinger wrote:
On 3/13/2013 3:10 PM, Cory Smelosky wrote:
"Solaris timing uses a real-time clock that can generate interrupts at a resolution
bound by the processor speed. For scheduling purposes, it fires every 10 milliseconds.
As in Linux, this is a clock "tick." Note that 2.6 Linux uses a 1000-tick/second
clock, as
opposed to the 100-tick/second clock used by Solaris and by previous versions of
Linux. User-level programs on Solaris can program the real time clock to fire at
nanosecond granularity, rounded up by processor time--much finer than the clock
tick granularity of ten or one milliseconds. However, the program interface to use
the high-resolution timers is not visible in the DDI/DKI. See clock_settime(3rt) for
user-level details andusr/src/uts/common/os/cyclic.c for details on high-resolution
timing in Solaris.
Also note that in Solaris, you can change the value of hz or clock ticks/second by
setting hires_tick to 1 and hires_hz to the desired time in the /etc/system file.
The default is 1000 ticks per second. Here's an example:
set hires_tick=1
set hires_hz=10000 <~--- 10000 ticks per second"
Looks like Solaris can set it in user mode, too.
Are you going to take a stab at this, Mark? If not, I will.
I don't have a platform to test on, so I'd suggest that you first try messing with
the values in /etc/system and if that gets things working, then I'll add it to the
FAQ. If it doesn't then messing with the mentioned APIs can be explored. Since the
size of the system clock tick is system wide, you can explore this without making any
changes to the simh code. Write s simple program which tries to set the tick to 1ms and
then sleeps until it is interrupted. While running this program start simh and see what
it thinks about idling....
- Mark