![]() |
|
| Daemon News Ezine | BSD News | BSD Mall | BSD Support Forum | BSD Advocacy | BSD Updates |
Updating your NetBSD Real-Time Clock Offset without RecompilingBill Studenmund <wrstuden@netbsd.org>As y'all know, the clocks changed last weekend. *BSD automatically takes care of this, so machines that have been up all the time (or run just Unix) are fine. Machines (i386) that dual-boot, though, have a problem. Windows keeps the RTC in local time, so the clock jumped 60 minutes (3600 seconds). For time-specific protocols, like Kerberos, that can be a killer.
FreeBSD has a facility called
There is a fix though. If you are dual-booting like this, chances are you've set the kernel option RTC_OFFSET, like "options RTC_OFFSET=480" to set the kernel to keep the RTC 8 hours behind UTC. So you now need to have that be 420 for DST (and in the fall, it'll need to be 480 again). Obviously you can just change the line and recompile. But there's another thing you can do: you can change that 480 in your compiled kernel, without having to recompile! The number from the RTC_OFFSET option gets stored in the rtc_offset variable in the compiled kernel. So all we need to do is change it with gdb, and we're done! You need to be root to do this, since you're writing the kernel image.
Note this works even if the kernel is stripped: > file /netbsd /netbsd: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped Enjoy! |