From owner-freebsd-hackers Mon May 13 0:46:49 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from evilpete.dyndns.org (12-232-26-46.client.attbi.com [12.232.26.46]) by hub.freebsd.org (Postfix) with ESMTP id 1490737B409 for ; Mon, 13 May 2002 00:46:41 -0700 (PDT) Received: from overcee.wemm.org ([10.0.0.3]) by evilpete.dyndns.org (8.11.6/8.11.6) with ESMTP id g4D7kaJ00691 for ; Mon, 13 May 2002 00:46:40 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.wemm.org (Postfix) with ESMTP id D7D5A3811; Mon, 13 May 2002 00:46:36 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Terry Lambert Cc: Jake Burkholder , Dmitry Mottl , freebsd-hackers@FreeBSD.ORG Subject: Re: question: hacking init_main.c In-Reply-To: <3CDF4FA5.8511B01A@mindspring.com> Date: Mon, 13 May 2002 00:46:36 -0700 From: Peter Wemm Message-Id: <20020513074636.D7D5A3811@overcee.wemm.org> 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 Terry Lambert wrote: > Jake Burkholder wrote: > > Wrong, no cookie. kernel printf uses the low level console which is > > initialized by cninit, which is called from init386 (etc), before > > mi_startup. > > > > My best guess at what's happening is that the subsystem numbers are > > "sparse", and have high numerical values, so you can't really index > > an array with them. ie you're trying to print sysinit_descr[0x1000000] > > etc. The best way I've found to do what you want is to use > > linker_ddb_search_symbol and linker_ddb_symbol_values on the sysinit > > function pointer to find its name, and to print the numerical value > > of the order/subsystem. > > > > T TERRY PLZ TO BE RESEARCHING NEXT TIME LUV JAKE > > Jake, > > *I wrote* init_main.c and kernel.h and the original SYSINIT() code; > Julian just committed it. Terry: Just because you wrote parts of it, doesn't mean that you are right. If you actually read the code, you would know that the console is initialized **WAY** before sysinit is even started. It may have been that way once in your version of the code, but it has never been that way for FreeBSD itself. > Please see my Copyrights on the files. > > You don't want to start using the kernel printf until the console > code is initialized. Trace through the code, and you will see some > bogosities that result from n-nserial console, and interaction with > the dmesg buffer. I personally have added printfs that show the sysinits running before. I have done it many times in fact. note locore.s: call init386 .... call mi_startup Now, note machdep.c: void init386(first) { ... /* * Initialize the console before we print anything out. */ cninit(); if (metadata_missing) printf("WARNING: loader(8) metadata is missing!\n"); ... } Console probe/attach is **NOT** driven by sysinit. Please spend 30 seconds reading the code before spreading misinformed FUD. Would it make you happier if I removed SI_SUB_CONSOLE to prove the point? Hmm, I think I will.. It seems to be confusing some people. Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message