*BSD News Article 26295


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!bunyip.cc.uq.oz.au!harbinger.cc.monash.edu.au!msuinfo!agate!howland.reston.ans.net!pipex!uunet!auspex-gw!guy
From: guy@Auspex.COM (Guy Harris)
Newsgroups: comp.unix.bsd
Subject: Re: Setting timezone on BSD386
Message-ID: <19653@auspex-gw.auspex.com>
Date: 20 Jan 94 20:24:22 GMT
References: <1994Jan18.160650.10175@wkuvx1.wku.edu> <2hi78m$bnu@kult.regent.e-technik.tu-muenchen.de> <19639@auspex-gw.auspex.com> <genehiCJwonG.LoI@netcom.com>
Sender: news@auspex-gw.auspex.com
Organization: Auspex Systems, Santa Clara
Lines: 27
Nntp-Posting-Host: bootme.auspex.com

>Lots of people use both DOS and Unix on the same box, so the Unix has
>to convert that local time to UTC when it boots up.  The kernel time
>zone information is used for this purpose.

That may well be an error, unless the kernel time zone stuff is *not*
done in the old 4.2BSD fashion - i.e., having the kernel's time zone
notion be an offset-from-UTC and a small integer specifying one of a
small set of built-in time zone rules is unlikely to cut it in many time
zones.

A better scheme might be to have the kernel grab a time from the
superblock, in traditional UNIX fashion, when it starts up, and then
have a program get the hardware clock (e.g. with a special driver),
convert that to proper time using the time zone information from the
file to which "localtime" is linked, and then set the time to the new
value (or "adjtime()" it).

(If it's really mandatory that this be done before user-mode code is
run, I'd seriously suggest having the kernel attempt to open the
"zoneinfo" file itself, and read it with Arthur Olson-style code; if the
kernel code really uses "tz_dsttime", then it already includes the
old-fashioned conversion code - replace it with new-style Olson code.

Of course, it appears that the 4.4BSD "sys/i386/isa/clock.c" just has
DST start and end dates *hardwired* as day 119 and day 303, which will
work in even fewer time zones than would code that looks at
"tz_dsttime"....)