Date: Sun, 12 May 2002 18:12:20 +0400 (MSD) From: Dmitry Mottl <dima@sinp.msu.ru> To: freebsd-hackers@FreeBSD.org Subject: question: hacking init_main.c Message-ID: <Pine.BSF.4.43.0205121758360.38560-100000@BigKing.sinp.msu.ru>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.43.0205121758360.38560-100000>