Date: Mon, 12 Aug 2002 20:18:34 +0800 From: "ouyang kai" <oykai@msn.com> To: "Lambert Terry" <tlambert2@mindspring.com>, <freebsd-hackers@FreeBSD.ORG> Subject: How the kernel add the devices when the kernel start Message-ID: <OE40UwWpSWerOc0Ne0P000151cc@hotmail.com>
next in thread | raw e-mail | index | archive | help
------=_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 <HTML><BODY STYLE=3D"font:10pt verdana; border:none;"><DIV>Dear Terry,</D= IV> <DIV> </DIV> <DIV>(*((*sipp)->func))((*sipp)->udata);<BR>&= nbsp;<BR> I saw the corresponding code based on your hints. I have s= ome questions. </DIV> <DIV> When the kernel process this c= ode to check the SI_SUB_DRIVERS, it would find <BR>the registed 'fxp' dev= ice(fxp_probe), right?<BR> If the 'fxp' device is exist, the kernel= will try to attach it(fxp_attach), right?<BR> Another, If we= do not compile the 'vr' device into the kernel and we do load the corres= ponding 'ko',<BR>so the kernel will not check the device, that is to say,= the 'vr' device does not registe to kernel, right?<BR> But, I have= some problem :<BR>1. When the kernel process the specified device, the '= func' means what? <BR> For example: the member 'if_ioctl' of = the structure 'ifnet', when the kernel process the 'fxp' device, I<BR>kno= w it should call the function 'fxp_ioctl'. But I do not the 'func' means = what when it check SI_SUB_DRIVERS.<BR>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<BR>the place of the FreeBSD main process. </DIV> <DIV> Thank y= ou so much!<BR>Best Regards<BR> Ouyang Kai</DIV> <DIV> </DIV><= /BODY></HTML><br clear=3Dall><hr>Get more from the Web. FREE MSN Explore= r download : <a href=3D'http://explorer.msn.com'>http://explorer.msn.com<= /a><br></p> ------=_NextPart_001_0004_01C2423D.6F19DF40-- 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?OE40UwWpSWerOc0Ne0P000151cc>