Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 May 2002 00:46:36 -0700
From:      Peter Wemm <peter@wemm.org>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        Jake Burkholder <jake@locore.ca>, Dmitry Mottl <dima@sinp.msu.ru>, freebsd-hackers@FreeBSD.ORG
Subject:   Re: question: hacking init_main.c 
Message-ID:  <20020513074636.D7D5A3811@overcee.wemm.org>
In-Reply-To: <3CDF4FA5.8511B01A@mindspring.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020513074636.D7D5A3811>