Date: Mon, 12 Aug 2002 16:32:27 +0800 From: "ouyang kai" <oykai@msn.com> To: <freebsd-hackers@FreeBSD.ORG> Message-ID: <OE97NfJfuyh6wnF2GmG00021552@hotmail.com>
next in thread | raw e-mail | index | archive | help
------=_NextPart_001_0000_01C2421D.D87200F0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Hi Everybody, I am a jackaroo to FreeBSD kernel. I have a question about how the kern= el add all devices. =20 For example, in NetBSD, I can find the code in /sys/kern/init_main.c: /* Attach pseudo-devices. */ for (pdev =3D pdevinit; pdev->pdev_attach !=3D NULL; pdev++) (*pdev->pdev_attach)(pdev->pdev_count); I know the NetBSD kernel add devices(such as storage device and network d= evice) by them. But in FreeBSD, I can not locate the place. which part code should I read? Thank you. =20 Best Regards Ouyang KaiGet more from the Web. FREE MSN Explorer download : http://e= xplorer.msn.com ------=_NextPart_001_0000_01C2421D.D87200F0 Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable <HTML><BODY STYLE=3D"font:10pt verdana; border:none;"><DIV> <P class=3DMs= oNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US><FONT face=3D"Ti= mes New Roman" size=3D3>Hi Everybody,</FONT></SPAN></P> <P class=3DMsoNor= mal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US><FONT size=3D3><FONT= face=3D"Times New Roman"><SPAN style=3D"mso-spacerun: yes"> </SPAN= >I am a jackaroo to FreeBSD kernel. I have a question about how the kerne= l add all devices. </FONT></FONT></SPAN></P> <P class=3DMsoNormal style=3D= "MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US><FONT size=3D3><FONT face=3D"Tim= es New Roman"><SPAN style=3D"mso-spacerun: yes"> </SPAN>For example= , in NetBSD, I can find the code in /sys/kern/init_main.c:</FONT></FONT><= /SPAN></P> <P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3D= EN-US><FONT size=3D3><FONT face=3D"Times New Roman"><SPAN style=3D"mso-sp= acerun: yes"> </SPAN>/* Attach pseudo-devices. */<?xml:namespace pre= fix =3D o ns =3D "urn:schemas-microsoft-com:office:office" /><o:p></o:p><= /FONT></FONT></SPAN></P> <P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0p= t; TEXT-INDENT: 10.5pt; mso-char-indent-count: 1.0; mso-char-indent-size:= 10.5pt"><SPAN lang=3DEN-US><FONT size=3D3><FONT face=3D"Times New Roman"= >for (pdev =3D pdevinit; pdev->pdev_attach !=3D NULL; pdev++)<o:p></o:= p></FONT></FONT></SPAN></P> <P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm= 0pt"><SPAN lang=3DEN-US><FONT size=3D3><FONT face=3D"Times New Roman"><S= PAN style=3D"mso-tab-count: 1"> </SPA= N><SPAN style=3D"mso-tab-count: 1"> <= /SPAN>(*pdev->pdev_attach)(pdev->pdev_count);</FONT></FONT></SPAN><= /P> <P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US= ><FONT face=3D"Times New Roman" size=3D3>I know the NetBSD kernel add dev= ices(such as storage device and network device) by them.</FONT></SPAN></P= > <P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US><= FONT face=3D"Times New Roman" size=3D3>But in FreeBSD, I can not locate t= he place.</FONT></SPAN></P> <P class=3DMsoNormal style=3D"MARGIN: 0cm 0cm= 0pt"><SPAN lang=3DEN-US><FONT face=3D"Times New Roman" size=3D3>which pa= rt code should I read?</FONT></SPAN></P> <P class=3DMsoNormal style=3D"MA= RGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US><FONT face=3D"Times New Roman" size= =3D3>Thank you.</FONT></SPAN></P> <P class=3DMsoNormal style=3D"MARGIN: 0= cm 0cm 0pt"><SPAN lang=3DEN-US><FONT size=3D3><FONT face=3D"Times New Rom= an"> <o:p></o:p></FONT></FONT></SPAN></P> <P class=3DMsoNormal style= =3D"MARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US><FONT face=3D"Times New Roman= " size=3D3>Best Regards</FONT></SPAN></P> <P class=3DMsoNormal style=3D"M= ARGIN: 0cm 0cm 0pt"><SPAN lang=3DEN-US><FONT size=3D3><FONT face=3D"Times= New Roman"><SPAN style=3D"mso-spacerun: yes"> </SPAN>Ouyang Kai</F= ONT></FONT></SPAN></P></DIV></BODY></HTML><br clear=3Dall><hr>Get more fr= om the Web. FREE MSN Explorer download : <a href=3D'http://explorer.msn.= com'>http://explorer.msn.com</a><br></p> ------=_NextPart_001_0000_01C2421D.D87200F0-- 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?OE97NfJfuyh6wnF2GmG00021552>