site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding; b=skeWTT7jKxSrkexwHt9viZtSRWOpMrVflf8G5awLYLN6EpZlJ0akdTVod/8RoUkBiiptisDTpF0B5UUamrCxaJklrkmUN1cnn6VGqZ4CqM5u61G3jlFxx4xnjSODcgyf9hw3p2EYJbknEUQFXVsgcAX25z0kp2b4gc5FxR8NV3g= I am attempting to add the ntp_adjtime() system call present on FreeBSD systems to Darwin. It is needed for an Internet2 network performance measurement project where microsecond-level timing accuracy (or better) is required from NTP. I already have CDMA timing clocks hooked in through the serial ports working properly. To do this, I grabbed the timex.h and kern_ntptime.c files from the FreeBSD distribution, and added ntp_adjtime() into the xnu kernel as system call #369, and compiled successfully. Although ntpq -p reports the times succesfully with a high degree of accuracy, when I attempted to use the owamp and bwctl applications (from Internet2), which rely on the ntp_adjtime() call that I added, to query ntp, I received UNSYNC errors, which is both bizarre and inaccurate. To explore further, I built the ntptime application from Apple's ntp-16 distribution by commenting out the ntp_gettime() calls and replacing the ntp_adjtime(x) calls with syscall(369,x). Unfortunately, ntptime only returns errors, as follows: /tmp/ntp/Build/util root# ./ntptime ntp_gettime() returns code 5 (ERROR) time 83a27e80.b580f000 Thu, Dec 25 1969 14:21:52.708, (.708999), maximum error 3259744661 us, estimated error 2273678227 us, TAI offset -1035222635 ntp_adjtime() returns code 5 (ERROR) modes 0x0 (), offset 0.000 us, frequency 0.000 ppm, interval 1 s, maximum error 500000 us, estimated error 500000 us, status 0x40 (UNSYNC), time constant 0, precision 0.000 us, tolerance 496 ppm, I'm assuming that adding this system call and making it work successfully isn't as simple as what we did. There are problem status/control codes to set in the timex.h file that aren't set properly for Mac OS X 10.3.x Server, as they are for FreeBSD. Alternatively, perhaps there's something else going on between NTP and the kernel? Does anyone have any thoughts on how to fix the situation? Any changes I can make to timex.h or kern_ntptime.c? Or anything else? Many thanks, Sean -- Sean Peisert http://www.sdsc.edu/~peisert/ Fellow, San Diego Supercomputer Center University of California, San Diego _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com