[time-nuts] FreeBSD, NetBSD, or Minix-III?

Hal Murray hmurray at megapathdsl.net
Sun May 17 03:15:23 UTC 2009


> [1] This is why I say that FreeBSD is a generation ahead, I have yet
> to see any other operating system support PPS-API on hardware captured
> signals. 

This is one of the reasons why I was looking for a low-cost FPGA on PCI board 
with some way to get a couple of external inputs.

You could easily put the Unix format clock into the FPGA and map it (read 
only?) into user space.  Then you just read the time.  No kernel call.

Adding PPS support would be simple.  :)




Things get interesting if your hardware splits a 64 bit read into 2 32 bit 
transfers.  Many years ago, all Intel chips did that.  I don't know about 
today.

The usual fix is to do 3 reads: high, low, high, compare the highs, and try 
again if they are different.  If they differ, the clock overflowed from the 
bottom word while you were reading it and you don't know which one matches 
the low bits.

You can play other games, for example latch the high bits when the low bits 
are read.  Then you have to ask what happens if 2 processs/threads read at 
the same time.  You can assign a separate address for each thread/process, 
but that's probably more complicated than it's worth.  You could read it from 
the kernel...



-- 
These are my opinions, not necessarily my employer's.  I hate spam.






More information about the time-nuts mailing list