From owner-freebsd-hackers Sun May 12 11:26:53 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from albatross.prod.itd.earthlink.net (albatross.mail.pas.earthlink.net [207.217.120.120]) by hub.freebsd.org (Postfix) with ESMTP id AABA937B400 for ; Sun, 12 May 2002 11:26:46 -0700 (PDT) Received: from pool0083.cvx40-bradley.dialup.earthlink.net ([216.244.42.83] helo=mindspring.com) by albatross.prod.itd.earthlink.net with esmtp (Exim 3.33 #2) id 176y3P-0006A1-00; Sun, 12 May 2002 11:26:43 -0700 Message-ID: <3CDEB3C5.7D08D187@mindspring.com> Date: Sun, 12 May 2002 11:26:13 -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: Dmitry Mottl Cc: freebsd-hackers@FreeBSD.org Subject: Re: question: hacking init_main.c References: 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 Dmitry Mottl wrote: > > I got a page fault (page not present, supervisor read) when I try to > modify /sys/kern/init_main.c > > I want kernel print each subsytem name when it called from mi_startup. > So I define char *sysinit_desct[] array and populate it with > description strings. > > After I boot kernel I saw expected '*** mi_startup ***' (see patch) > and pagefault after that. > > Where is my fault? [ ... ] > + printf("*** mi_startup ***\n"); *** BOGUS [ ... ] > + printf("SYSINIT: %s\n", sysinit_descr[(*sipp)->subsystem]); *** BOGUS Your console must be initialized before you can call printf. Try this *one line* instead: 201a202,204 > if ((*sipp)->subsystem > SI_SUB_CONSOLE) > printf("SYSINIT: %s\n", sysinit_descr[(*sipp)->subsystem]); > Notice that with this patch, it only does printf's after console initialization has taken place (unlike your patch). -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message