From owner-freebsd-hackers@FreeBSD.ORG Mon Dec 6 03:06:49 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 550FC16A4CE for ; Mon, 6 Dec 2004 03:06:49 +0000 (GMT) Received: from ion.gank.org (ion.gank.org [69.55.238.164]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1941743D2F for ; Mon, 6 Dec 2004 03:06:49 +0000 (GMT) (envelope-from craig@tobuj.gank.org) Received: from aldaris.auir.gank.org (arbiter.gank.org [64.81.113.221]) by ion.gank.org (mail) with ESMTP id 9F2A32A98A; Sun, 5 Dec 2004 21:06:48 -0600 (CST) From: Craig Boston To: freebsd-hackers@freebsd.org Date: Sun, 5 Dec 2004 21:06:35 -0600 User-Agent: KMail/1.7.1 References: <41B07635.9060705@swebase.com> In-Reply-To: <41B07635.9060705@swebase.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200412052106.36219.craig@tobuj.gank.org> cc: Stefan Midjich Subject: Re: Rebooting the kernel without resetting uptime? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Dec 2004 03:06:49 -0000 On Friday 03 December 2004 8:20 am, Stefan Midjich wrote: > I know a guy i respect on IRC told me this is not possible but since > this is the hackers list i thought the topic at least deserves a > discussion. I guess i wont be able to sit still until someone either > does it or shows me why it can't be done. Of course you can. Just attach gdb to your running kernel and muck with the global boottime structure. That's considered cheating, though, so don't do it! ( a few minutes later ) Hmm, apparently either something has changed in kgdb in 5.3 or I just forgot the magic incantation, because it doesn't seem to allow modification of memory -- just "Bad file descriptor". Getting the address from there and writing to /dev/kmem directly still works though. the-cheat# uname -r 5.3-STABLE the-cheat# uptime 9:03PM up 3485 days, 21:44, 1 user, load averages: 0.24, 0.12, 0.12 the-cheat# sysctl kern.boottime kern.boottime: { sec = 801120000, usec = 345099 } Mon May 22 00:20:00 1995 the-cheat# :-P Craig