From owner-freebsd-hackers@FreeBSD.ORG Thu Nov 20 09:53:09 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81DE8106564A; Thu, 20 Nov 2008 09:53:09 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 0EE548FC08; Thu, 20 Nov 2008 09:53:09 +0000 (UTC) (envelope-from des@des.no) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 0BDF56D43F; Thu, 20 Nov 2008 09:53:08 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id DF381844A1; Thu, 20 Nov 2008 10:53:07 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Jeremy Chadwick References: <20081028081154.GQ6808@hoeg.nl> <20081118213410.GA81783@hoeg.nl> <20081118214919.GM83287@bunrab.catwhisker.org> <7d6fde3d0811190202p4f6d8941h3932b70b8fe1a93a@mail.gmail.com> <20081119104731.GA83366@icarus.home.lan> <20081120063936.GU51761@server.vk2pj.dyndns.org> <20081120070820.GA19307@icarus.home.lan> Date: Thu, 20 Nov 2008 10:53:07 +0100 In-Reply-To: <20081120070820.GA19307@icarus.home.lan> (Jeremy Chadwick's message of "Wed, 19 Nov 2008 23:08:21 -0800") Message-ID: <86r656oha4.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: FreeBSD Hackers Subject: Re: [Testers wanted] /dev/console cleanups X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2008 09:53:09 -0000 Jeremy Chadwick writes: > Peter Jeremy writes: > > This is deliberate. If the system panics, stuff that was in the > > message buffer (and might not be on disk) can be read when the > > system reboots. If there is no crashdump, this might be the only > > record of what happened. > That doesn't sound deliberate at all -- it sounds like a quirk that > people (you?) are relying on. No, it is deliberate. Just because you don't like it doesn't mean we're morons. > You're under the mentality that the information is *always* available > after a panic/reboot -- it isn't. I have 4 different Supermicro > motherboards (all from different years) which will "most of the time" > lose the msgbuf after rebooting from single-user -- but sometimes the > msgbuf is retained. And no, bad hardware is not responsible for the > randomness of the problem. We know there are systems where it doesn't work. That doesn't mean it's not useful when it *does* work. There are also systems where it works reliably, including most SoC and SFF systems. > I think it's been discussed in the past how/why this can happen. It has > to do with what each BIOS manufacturer chooses to do with some parts of > memory during start-up. Mostly whether memory remains powered-on through the reset process. Speaking only of i386 / amd64 systems, there are several ways to reboot a computer: - Return to real mode and call the BIOS reboot subroutine. This will perform a cold boot (memory is cleared) or a warm boot (memory should not be cleared, but the BIOS may do so anyway) depending on the value stored at a specific location in memory. - On systems with an i8042 keyboard controller, one of the controller's output lines is usually wired to the CPU's reset pin. Writing a specific value to one of the keyboard controller's control registers causes it to pull that pin low. - Triple fault: set up an empty interrupt descriptor table and trigger an interrupt (e.g. divide by zero). The CPU will fail to invoke the corresponding interrupt descriptor, causing a double fault interrupt, which will fail to execute, causing a CPU reset. The latter two techniques can be used (and *have* been used) to switch back from protected mode to real mode, because they are faster than the documented method. Memory is *not* cleared, and the CPU will start executing whatever code is stored at 0xfffffff0 in real memory; this is normally a far jump into the BIOS reboot subroutine, so if you don't pull any tricks (e.g. jump to your own code that does whatever it was you needed to do in real mode, then return to protected mode), they are equivalent to the first technique. - ACPI reset: store the value specified by RESET_VALUE in the FADT into the register specified by RESET_REG in the FADT. According to the ACPI spec, this results in a cold boot. However, this part of the spec is optional, so not all motherboards support it. FreeBSD will only use ACPI reset if the hw.acpi.handle_reboot sysctl is not zero, which it is by default (mostly, if I recall correctly, because ACPI reset is unreliable). DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no