From owner-freebsd-hackers Sun May 12 22:49: 6 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from k6.locore.ca (k6.locore.ca [198.96.117.170]) by hub.freebsd.org (Postfix) with ESMTP id BEAAD37B400 for ; Sun, 12 May 2002 22:49:02 -0700 (PDT) Received: (from jake@localhost) by k6.locore.ca (8.11.6/8.11.6) id g4D5xRd29117; Mon, 13 May 2002 01:59:27 -0400 (EDT) (envelope-from jake) Date: Mon, 13 May 2002 01:59:26 -0400 From: Jake Burkholder To: Terry Lambert Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: question: hacking init_main.c Message-ID: <20020513015926.J2566@locore.ca> References: <3CDEB3C5.7D08D187@mindspring.com> <20020512162506.I2566@locore.ca> <3CDF4FA5.8511B01A@mindspring.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3CDF4FA5.8511B01A@mindspring.com>; from tlambert2@mindspring.com on Sun, May 12, 2002 at 10:31:17PM -0700 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 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