Mac RTC, was Re: 2.6.37 and other things.
On Tue, 1 Mar 2011, Thorsten Glaser wrote:
> Geert Uytterhoeven dixit:
> >So can't you hack MacOS to consider the RTC in UTC, cfr. the unixclock
> If itʼs true that the timezone is stored there as well
I'll assume for the moment that it is true (for System 7)...
> , this isnʼt actually needed, just a change to Linux to read it out and
> use it (upon boot / first-time setting).
There are pros and cons to both approaches. Consider that we need to
support both bootloaders: Penguin (which implies MacOS) and Emile (which
doesn't need MacOS).
At present, if MacOS is not in use, you can just use UTC. Whereas, the
kernel would have to store the timezone in PRAM when it wrote to the RTC
if were to depend on a valid timezone there. And I'm not sure that the
kernel even knows what timezone it is in (?)
So for dual boot, you'd need an invertible mapping between the kernel's
representation of the timezone (assuming it has one) and MacOS timezone
FWIW, drivers/rtc/rtc-efi.c is an example of a device that stores a
timezone (there are others mentioned in comments in drivers/rtc), but a
quick grep would indicate that none of them use it...
./rtc-efi.c: eft->timezone = EFI_UNSPECIFIED_TIMEZONE;
So, I suspect that Geert's solution is probably the simplest. It is
probably just a matter of hooking a trap or two. Or perhaps Penguin can
convert the PRAM prior to starting Linux by changing the clock to UTC and
changing the PRAM timezone to Reykjavik.