From owner-freebsd-hackers Sun May 12 7:14:10 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from SRDMAIL.SINP.MSU.RU (bigking.sinp.msu.ru [213.131.9.130]) by hub.freebsd.org (Postfix) with ESMTP id 3D66937B416 for ; Sun, 12 May 2002 07:13:53 -0700 (PDT) Received: from dima (helo=localhost) by SRDMAIL.SINP.MSU.RU with local-esmtp (Exim 3.34 #1) id 176u5E-000L63-00 for freebsd-hackers@FreeBSD.org; Sun, 12 May 2002 18:12:20 +0400 Date: Sun, 12 May 2002 18:12:20 +0400 (MSD) From: Dmitry Mottl To: freebsd-hackers@FreeBSD.org Subject: question: hacking init_main.c Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 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? Thank you --- init_main.c.orig Sun May 12 14:24:54 2002 +++ init_main.c Sun May 12 15:21:41 2002 @@ -109,6 +109,57 @@ struct sysinit **sysinit = (struct sysinit **)sysinit_set.ls_items; struct sysinit **newsysinit; +char *sysinit_descr[]={ +"SI_SUB_DUMMY = 0x0000000, /* not executed; for linker*/", +"SI_SUB_DONE = 0x0000001, /* processed*/", +"SI_SUB_CONSOLE = 0x0800000, /* console*/", [skipped,so on..] +}; @@ -167,6 +218,7 @@ register struct sysinit **xipp; /* interior loop of sort*/ register struct sysinit *save; /* bubble*/ + printf("*** mi_startup ***\n"); restart: /* * Perform a bubble sort of the system initialization objects by @@ -202,6 +254,7 @@ /* Call function */ (*((*sipp)->func))((*sipp)->udata); + printf("SYSINIT: %s\n", sysinit_descr[(*sipp)->subsystem]); /* Check off the one we're just done */ (*sipp)->subsystem = SI_SUB_DONE; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message