Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757298AbZFYGhd (ORCPT ); Thu, 25 Jun 2009 02:37:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751663AbZFYGhY (ORCPT ); Thu, 25 Jun 2009 02:37:24 -0400 Received: from bilbo.ozlabs.org ([203.10.76.25]:39793 "EHLO bilbo.ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750893AbZFYGhX (ORCPT ); Thu, 25 Jun 2009 02:37:23 -0400 Subject: Re: How the kernel printk works before do console_setup. From: Michael Ellerman Reply-To: michael@ellerman.id.au To: Johnny Hung Cc: Benjamin Herrenschmidt , linuxppc-dev@lists.ozlabs.org, linux-embedded@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: References: <4A41B3A5.9010807@am.sony.com> <1245884203.21200.18.camel@pasglop> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-43lc7/jLw0CPhY+C4l75" Date: Thu, 25 Jun 2009 16:37:25 +1000 Message-Id: <1245911845.11532.20.camel@concordia> Mime-Version: 1.0 X-Mailer: Evolution 2.26.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2574 Lines: 67 --=-43lc7/jLw0CPhY+C4l75 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Thu, 2009-06-25 at 14:27 +0800, Johnny Hung wrote: > 2009/6/25 Benjamin Herrenschmidt : > > > >> Before the console is set up, the printk data is formatted > >> and put into the kernel log buffer, but not sent to any console. > >> Any messages printk'ed before that are buffered but do not > >> appear. When the console is initialized, then all buffered > >> messages are sent to the console, and subsequent printks cause > >> the message to go to the log buffer, but then immediately > >> get sent from there to the console. > >> > >> Under certain conditions you can examine the log buffer of > >> a kernel that failed to initialize it's console, after a > >> warm reset of the machine, using the firmware memory dump > >> command. > > > > On ppc, we have tricks to display things earlier :-) > > > > We can initialize the serial ports way before console_setup() (and we d= o > > in most cases) and we use what we call the "udbg" console until the rea= l > > one takes over. The "udbg" console is a very small layer which outputs > > via a provided "putc" routine. Platforms can provide their own here, we > > have a collection of standard ones for legacy UARTs (it should be > > automatically setup in that case by the code in legacy_serial), Apple > > ESCCs, etc... We even have compile time options that allow that stuff t= o > > be initialized before start_kernel... >=20 > Thank you. This is what I described and want to understand. The > arch/powerpc/kernel/legacy_serial.c > do find_legacy_serial_ports then take a default serial port by using > open firmware device tree > information. The find_legacy_serial_ports() called form setup_arch but > I don't know who call > setup_arch (setup_32.c)function. Can you give me a hint ? Thanks in advan= ced. setup_arch() is called from start_kernel() in init/main.c cheers --=-43lc7/jLw0CPhY+C4l75 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEABECAAYFAkpDGyUACgkQdSjSd0sB4dIvigCfV3efnXTX8vAjThX/KGx/OHq+ 5FgAmgLMogbMi/GzA5SJmA7CqpNldRyr =EWua -----END PGP SIGNATURE----- --=-43lc7/jLw0CPhY+C4l75-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/