Subject: port-macppc/9373: kernel should convert RTC value to UTC without RTC_OFFSET option
To: None <gnats-bugs@gnats.netbsd.org>
From: Erik E. Fair <fair@digital.clock.org>
List: netbsd-bugs
Date: 02/08/2000 01:51:38
>Number:         9373
>Category:       port-macppc
>Synopsis:       kernel should convert RTC value to UTC without RTC_OFFSET option
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-macppc-maintainer (NetBSD/macppc Portmaster)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Feb  8 01:50:59 2000
>Last-Modified:
>Originator:     Erik E. Fair
>Organization:
International Organization of Internet Clock Watchers
>Release:        1.4.1
>Environment:
	
System: NetBSD digital.clock.org 1.4.2_ALPHA NetBSD 1.4.2_ALPHA (DIGITAL) #10: Mon Jan 10 22:38:56 PST 2000 fair@doomsday.clock.org:/usr/obj/sys/arch/alpha/compile/DIGITAL alpha


>Description:
	The MacOS keeps its hardware Real Time Clock (RTC) in local time.

	NetBSD has an option(4) to deal with this: RTC_OFFSET
	However, this is a compile-time option, and this is not
	flexible enough (NetBSD users do not all live in the same
	timezone - so we have to have 24 binary kernel distributions?
	Also there are laptoys which change timezone as the user travels).

	While it is possible to simply set the RTC to UTC/GMT, this
	is inconvenient, if you alternately boot NetBSD and MacOS.

	Fortunately, the Macintosh also keeps its location
	(latitude/logitude, no less!) and offset from UTC in
	"extended parameter RAM" (non-volatile).  This means that
	a suitably modified "clock" driver can read the clock, and
	the P-RAM offset, and correctly set NetBSD's system time
	at boot, without hosing up the the RTC value from MacOS's
	point of view. The URL

	http://developer.apple.com/techpubs/mac/OSUtilities/OSUtilities-94.html

	documents that these values are available. A little more
	searching in the Apple documentation should reveal the
	format of "extended parameter RAM" and make this change
	possible.

	In addition, it may be desireable to add something to rc.local
	for macppc to change the link for /etc/localtime to whatever is
	read from Macintosh P-RAM.

	This PR also applies to port-mac68k

>How-To-Repeat:
	
>Fix:
	
>Audit-Trail:
>Unformatted: