Date: Sun, 12 May 2002 11:26:13 -0700 From: Terry Lambert <tlambert2@mindspring.com> To: Dmitry Mottl <dima@sinp.msu.ru> Cc: freebsd-hackers@FreeBSD.org Subject: Re: question: hacking init_main.c Message-ID: <3CDEB3C5.7D08D187@mindspring.com> References: <Pine.BSF.4.43.0205121758360.38560-100000@BigKing.sinp.msu.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3CDEB3C5.7D08D187>