From owner-freebsd-hackers Sun May 12 23:37: 3 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from pintail.mail.pas.earthlink.net (pintail.mail.pas.earthlink.net [207.217.120.122]) by hub.freebsd.org (Postfix) with ESMTP id 0D71A37B403 for ; Sun, 12 May 2002 23:37:00 -0700 (PDT) Received: from pool0246.cvx40-bradley.dialup.earthlink.net ([216.244.42.246] helo=mindspring.com) by pintail.mail.pas.earthlink.net with esmtp (Exim 3.33 #2) id 1779S5-00001A-00; Sun, 12 May 2002 23:36:58 -0700 Message-ID: <3CDF5EEB.ACEB8F8@mindspring.com> Date: Sun, 12 May 2002 23:36:27 -0700 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Jake Burkholder Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: question: hacking init_main.c References: <3CDEB3C5.7D08D187@mindspring.com> <20020512162506.I2566@locore.ca> <3CDF4FA5.8511B01A@mindspring.com> <20020513015926.J2566@locore.ca> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Jake Burkholder wrote: > I know that you wrote it and I know that you're wrong. > > Take sparc64_init() for example, which is called from locore.S before > mi_startup(): [ ... ] > These printfs work fine. [ ... ] > Come to think of it: > > > cd /usr/current/src/sys/ > > find . -name "*.[ch]" | xargs grep SI_SUB_CONSOLE > ./sys/kernel.h: * The SI_SUB_CONSOLE and SI_SUB_SWAP values represent values used by > ./sys/kernel.h: SI_SUB_CONSOLE = 0x0800000, /* console*/ > > > > There don't seem to be any SYSINITs that run at SI_SUB_CONSOLE. I guess your unique point of view here explains the misunderstanding... 8-). What can I say... PC hardware is stupid. The SPARC console code is handled by the PROM code. PC hardware rarely has code in the POST routines to set up a console properly (you can get AMD BIOS that has the ability to send everything out the serial consle, and assumes it's talking to a VT100, but most motherboards don't have it). If he wants to be guaranteed that it will work on any system, he needs to delay the console printf's until after the console initialization has happened, if it doesn't happen at hardware reset. Personally, I'd also suggest just printing out the subsystem and order structure elements as hex, rather than relying on strings having been defined (or add a string element to the sysinit structure itself). Normally, when I do this, I just put out the hex codes. I've done this more than once (e.g. adding a 4M page allocation type to the kernel, etc.). Actually, it would be nice to be able to set these flags into some global context somewhere, and then use it when doing the printf()'s, so that you could give a list of subsystems whose printf's you wanted to ignore. In my experience, it's a common thing for managers to want to suppress many of the boot messages from appearing on the console, so as to hide the fact that they are using FreeBSD... never mind the fact that this makes field diagnostics a real pain for the engineers (I said it was common to want it ... not clever... 8-)). Really, there wants to be a seperation of the console from the dmesg from the klog for messages, so you can select what goes where (or if it goes at all). -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message