Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 May 2002 01:59:26 -0400
From:      Jake Burkholder <jake@locore.ca>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: question: hacking init_main.c
Message-ID:  <20020513015926.J2566@locore.ca>
In-Reply-To: <3CDF4FA5.8511B01A@mindspring.com>; from tlambert2@mindspring.com on Sun, May 12, 2002 at 10:31:17PM -0700
References:  <Pine.BSF.4.43.0205121758360.38560-100000@BigKing.sinp.msu.ru> <3CDEB3C5.7D08D187@mindspring.com> <20020512162506.I2566@locore.ca> <3CDF4FA5.8511B01A@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Apparently, On Sun, May 12, 2002 at 10:31:17PM -0700,
	Terry Lambert said words to the effect of;

> 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.

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():

void
sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec)
{
...
        /*
         * Initialize the console before printing anything.
         */
        cninit();

        /*
         * Panic is there is no metadata.  Most likely the kernel was booted
         * directly, instead of through loader(8).
         */
        if (mdp == NULL || kmdp == NULL) {
                printf("sparc64_init: no loader metadata.\n"
                       "This probably means you are not using loader(8).\n");
                panic("sparc64_init");
        }

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.

Jake

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?20020513015926.J2566>