From owner-freebsd-hackers Mon Aug 12 2:50: 6 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 16C4137B400 for ; Mon, 12 Aug 2002 02:49:58 -0700 (PDT) Received: from hotmail.com (oe72.pav0.hotmail.com [64.4.33.214]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9FC0C43E4A for ; Mon, 12 Aug 2002 02:49:57 -0700 (PDT) (envelope-from oykai@msn.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 12 Aug 2002 02:49:57 -0700 X-Originating-IP: [210.12.61.105] From: "ouyang kai" To: "Lambert Terry" , Subject: Re: Hi, how the kernel add the devices Date: Mon, 12 Aug 2002 17:49:46 +0800 MIME-Version: 1.0 X-Mailer: MSN Explorer 6.10.0016.1624 Content-Type: multipart/mixed; boundary="----=_NextPart_001_0002_01C24228.A5C40FD0" Message-ID: X-OriginalArrivalTime: 12 Aug 2002 09:49:57.0544 (UTC) FILETIME=[9E175280:01C241E5] 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 ------=_NextPart_001_0002_01C24228.A5C40FD0 Content-Type: multipart/alternative; boundary="----=_NextPart_002_0003_01C24228.A5C680D0" ------=_NextPart_002_0003_01C24228.A5C680D0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Dear Terry, >See /usr/src/sys/kernel.h. It is done using linker sets and >SYSINIT. Hmm=A1=AD. Thank you! I find the mi_startup() function in /sys/kern/init_main.c, there are some= code as follow: for (sipp =3D sysinit; sipp < sysinit_end; sipp++) { if ((*sipp)->subsystem =3D=3D SI_SUB_DUMMY) continue; /* skip dummy task(s)*/ if ((*sipp)->subsystem =3D=3D SI_SUB_DONE) continue; /* Call function */ (*((*sipp)->func))((*sipp)->udata); /* Check off the one we're just done */ (*sipp)->subsystem =3D SI_SUB_DONE; /* Check if we've installed more sysinit items via KLD */ if (newsysinit !=3D NULL) { if (sysinit !=3D SET_BEGIN(sysinit_set)) free(sysinit, M_TEMP); sysinit =3D newsysinit; sysinit_end =3D newsysinit_end; newsysinit =3D NULL; newsysinit_end =3D NULL; goto restart; } } Now, I am puzzled about the function pointer(func), which is how to work.= =20 For example, I have a NIC =A1=AEfxp0=A1=AF, so the function pointer shoul= d point to the fxp_attach? If that is right, I want to know how the kernel call the mi_startup()? Best Regards Ouyang KaiGet more from the Web. FREE MSN Explorer download : http://ex= plorer.msn.com ------=_NextPart_002_0003_01C24228.A5C680D0 Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
Dear Terry,
 >See /usr/src/sys/kernel.h.  It is done using link= er sets and
>SYSINIT.
Hmm=A1=AD. Thank you!
I find the mi_sta= rtup() function in /sys/kern/init_main.c, there are some code as follow:<= BR>for (sipp =3D sysinit; sipp < sysinit_end; sipp++) {
  = ;if ((*sipp)->subsystem =3D=3D SI_SUB_DUMMY)
   cont= inue; /* skip dummy task(s)*/
  if ((*sipp)->subsyst= em =3D=3D SI_SUB_DONE)
   continue;
  /* C= all function */
  (*((*sipp)->func))((*sipp)->udata);<= BR>  /* Check off the one we're just done */
  (*s= ipp)->subsystem =3D SI_SUB_DONE;
  /* Check if we've inst= alled more sysinit items via KLD */
  if (newsysinit !=3D NU= LL) {
   if (sysinit !=3D SET_BEGIN(sysinit_set))
&n= bsp;   free(sysinit, M_TEMP);
   sysinit= =3D newsysinit;
   sysinit_end =3D newsysinit_end;
=    newsysinit =3D NULL;
   newsysinit_en= d =3D NULL;
   goto restart;
  }
 = }
Now, I am puzzled about the function pointer(func), which is how to = work.
For example, I have a NIC =A1=AEfxp0=A1=AF, so the function poi= nter should point to the fxp_attach?
If that is right, I want to know = how the kernel call the mi_startup()?
 
Best R= egards
 Ouyang Kai
 
 

Get more from the Web. FREE MSN Exp= lorer download : http://explorer.msn.= com

------=_NextPart_002_0003_01C24228.A5C680D0-- ------=_NextPart_001_0002_01C24228.A5C40FD0 Content-Type: text/plain; name="kernel_init_problem.txt" Content-Disposition: attachment; filename="kernel_init_problem.txt" Content-Transfer-Encoding: quoted-printable Dear Terry >See /usr/src/sys/kernel.h. It is done using linker sets and >SYSINIT. Hmm=A1=AD. Thank you! I find the mi_startup() function in /sys/kern/init_main.c, there are some= code as follow: for (sipp =3D sysinit; sipp < sysinit_end; sipp++) { if ((*sipp)->subsystem =3D=3D SI_SUB_DUMMY) continue; /* skip dummy task(s)*/ if ((*sipp)->subsystem =3D=3D SI_SUB_DONE) continue; /* Call function */ (*((*sipp)->func))((*sipp)->udata); /* Check off the one we're just done */ (*sipp)->subsystem =3D SI_SUB_DONE; /* Check if we've installed more sysinit items via KLD */ if (newsysinit !=3D NULL) { if (sysinit !=3D SET_BEGIN(sysinit_set)) free(sysinit, M_TEMP); sysinit =3D newsysinit; sysinit_end =3D newsysinit_end; newsysinit =3D NULL; newsysinit_end =3D NULL; goto restart; } } Now, I am puzzled about the function pointer(func), which is how to work.= =20 For example, I have a NIC =A1=AEfxp0=A1=AF, so the function pointer shoul= d point to the fxp_attach? Best Regards Ouyang Kai If that is right, I want to know how the kernel call the mi_startup()? ------=_NextPart_001_0002_01C24228.A5C40FD0-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message