From owner-freebsd-hackers Mon Aug 12 5:18:46 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 88AD737B400 for ; Mon, 12 Aug 2002 05:18:42 -0700 (PDT) Received: from hotmail.com (oe40.pav0.hotmail.com [64.4.32.120]) by mx1.FreeBSD.org (Postfix) with ESMTP id 24F2E43E65 for ; Mon, 12 Aug 2002 05:18:42 -0700 (PDT) (envelope-from oykai@msn.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 12 Aug 2002 05:18:42 -0700 X-Originating-IP: [210.12.61.105] From: "ouyang kai" To: "Lambert Terry" , Subject: How the kernel add the devices when the kernel start Date: Mon, 12 Aug 2002 20:18:34 +0800 MIME-Version: 1.0 X-Mailer: MSN Explorer 6.10.0016.1624 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0004_01C2423D.6F19DF40" Message-ID: X-OriginalArrivalTime: 12 Aug 2002 12:18:42.0118 (UTC) FILETIME=[658D3E60:01C241FA] 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_0004_01C2423D.6F19DF40 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Dear Terry, (*((*sipp)->func))((*sipp)->udata); =20 I saw the corresponding code based on your hints. I have some questions.= =20 When the kernel process this code to check the SI_SUB_DRIVERS, it would = find =20 the registed 'fxp' device(fxp_probe), right? If the 'fxp' device is exist, the kernel will try to attach it(fxp_atta= ch), right? Another, If we do not compile the 'vr' device into the kernel and we d= o load the corresponding 'ko', so the kernel will not check the device, that is to say, the 'vr' device = does not registe to kernel, right? But, I have some problem : 1. When the kernel process the specified device, the 'func' means what? =20 For example: the member 'if_ioctl' of the structure 'ifnet', when the = kernel process the 'fxp' device, I know it should call the function 'fxp_ioctl'. But I do not the 'func' mea= ns what when it check SI_SUB_DRIVERS. 2. In NetBSD, I can find main() function in init_main.c, but in FreeBSD, = I could not find it, I am puzzled about the place of the FreeBSD main process. =20 Thank you so much! Best Regards Ouyang KaiGet more from the Web. FREE MSN Explorer download : http://e= xplorer.msn.com ------=_NextPart_001_0004_01C2423D.6F19DF40 Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable
Dear Terry,
 
(*((*sipp)->func))((*sipp)->udata);
&= nbsp;
 I saw the corresponding code based on your hints. I have s= ome questions. 
 When the kernel process this c= ode to check the SI_SUB_DRIVERS, it would find
the registed 'fxp' dev= ice(fxp_probe), right?
  If the 'fxp' device is exist, the kernel= will try to attach it(fxp_attach), right?
   Another, If we= do not compile the 'vr' device into the kernel and we do load the corres= ponding 'ko',
so the kernel will not check the device, that is to say,= the 'vr' device does not registe to kernel, right?
  But, I have= some problem :
1. When the kernel process the specified device, the '= func' means what?
   For example: the member 'if_ioctl' of = the structure 'ifnet', when the kernel process the 'fxp' device, I
kno= w it should call the function 'fxp_ioctl'. But I do not the 'func' means = what when it check SI_SUB_DRIVERS.
2. In NetBSD, I can find main() fun= ction in init_main.c, but in FreeBSD, I could not find it, I am puzzled a= bout
the place of the FreeBSD main process.
  Thank y= ou so much!
Best Regards
  Ouyang Kai
 
<= /BODY>

Get more from the Web. FREE MSN Explore= r download : http://explorer.msn.com<= /a>

------=_NextPart_001_0004_01C2423D.6F19DF40-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message