From owner-freebsd-emulation@FreeBSD.ORG Thu Jan 26 13:19:06 2006 Return-Path: X-Original-To: freebsd-emulation@freebsd.org Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F12B16A420 for ; Thu, 26 Jan 2006 13:19:06 +0000 (GMT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (gndrsh.dnsmgr.net [205.238.40.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id CF94643D45 for ; Thu, 26 Jan 2006 13:19:05 +0000 (GMT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.9.3/8.9.3) id FAA80592 for freebsd-emulation@freebsd.org; Thu, 26 Jan 2006 05:19:03 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <200601261319.FAA80592@gndrsh.dnsmgr.net> To: freebsd-emulation@freebsd.org Date: Thu, 26 Jan 2006 05:19:03 -0800 (PST) X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Patch] ports/rtc Timing will be inaccurate, please increase kern.hz X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2006 13:19:06 -0000 This is a long standing problem that has confused many users and I could find at least 1 post in 2004 that stated the fix but didnt provide a patch. Users are confused by this diagnostic message more than they are helped because it is printing the -current- value of HZ, not the value requested. This is caused by the order of things in the code, we clober the sc->var.freq value because it is too large before we print the diagnostic saying what value was too large.... Very simple fix, move the clober to be after the printf. sysctl -a | grep hz kern.clockrate: { hz = 200, tick = 5000, profhz = 1024, stathz = 128 } Before PATCH: rtc: 200 > kern.hz: Timing will be inaccurate, please increase kern.hz. After PATCH: rtc: 256 > kern.hz: Timing will be inaccurate, please increase kern.hz. The request made by vmware was infact 256 in both cases. --- files/rtc.c.orig Tue Nov 29 07:43:43 2005 +++ files/rtc.c Thu Jan 26 04:45:32 2006 @@ -269,8 +269,8 @@ } sc->var.freq = freq; if ((sc->var.freq > hz) && (hz < 1000)) { - sc->var.freq = hz; printf("rtc: %d > kern.hz: Timing will be inaccurate, please increase kern.hz.\n", sc->var.freq); + sc->var.freq = hz; } sleep = hz / sc->var.freq; DLog(Linfo, "Set RTC freq %d", sc->var.freq); -- Rod Grimes freebsd@freebsd.org