⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basics-devices.html

📁 这是很好的学习嵌入式LINUX的文章
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta name="generator" content="HTML Tidy, see www.w3.org" /><title>Devices and Device Nodes</title><meta name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.7" /><link rel="HOME" title="FreeBSD Handbook" href="index.html" /><link rel="UP" title="UNIX Basics" href="basics.html" /><link rel="PREVIOUS" title="Text Editors" href="editors.html" /><link rel="NEXT" title="Binary Formats" href="binary-formats.html" /><link rel="STYLESHEET" type="text/css" href="docbook.css" /></head><body class="SECT1" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#840084"alink="#0000FF"><div class="NAVHEADER"><table summary="Header navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><th colspan="3" align="center">FreeBSD Handbook</th></tr><tr><td width="10%" align="left" valign="bottom"><a href="editors.html"accesskey="P">Prev</a></td><td width="80%" align="center" valign="bottom">Chapter 3 UNIX Basics</td><td width="10%" align="right" valign="bottom"><a href="binary-formats.html"accesskey="N">Next</a></td></tr></table><hr align="LEFT" width="100%" /></div><div class="SECT1"><h1 class="SECT1"><a id="BASICS-DEVICES" name="BASICS-DEVICES">3.11 Devices and DeviceNodes</a></h1><p>A device is a term used mostly for hardware-related activities in a system, includingdisks, printers, graphics cards, and keyboards. When FreeBSD boots, the majority of whatFreeBSD displays are devices being detected. You can look through the boot messages againby viewing <tt class="FILENAME">/var/run/dmesg.boot</tt>.</p><p>For example, <tt class="DEVICENAME">acd0</tt> is the first IDE CDROM drive, while <ttclass="DEVICENAME">kbd0</tt> represents the keyboard.</p><p>Most of these devices in a <span class="TRADEMARK">UNIX</span>&reg; operating systemmust be accessed through special files called device nodes, which are located in the <ttclass="FILENAME">/dev</tt> directory.</p><div class="SECT2"><h2 class="SECT2"><a id="AEN5038" name="AEN5038">3.11.1 Creating Device Nodes</a></h2><p>When adding a new device to your system, or compiling in support for additionaldevices, you may need to create one or more device nodes for the new devices.</p><div class="SECT3"><h3 class="SECT3"><a id="AEN5041" name="AEN5041">3.11.1.1 MAKEDEV Script</a></h3><p>On systems without <var class="LITERAL">DEVFS</var> (this concerns all FreeBSDversions before 5.0), device nodes are created using the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=MAKEDEV&sektion=8"><spanclass="CITEREFENTRY"><span class="REFENTRYTITLE">MAKEDEV</span>(8)</span></a> script asshown below:</p><pre class="SCREEN"><samp class="PROMPT">#</samp> <kbd class="USERINPUT">cd /dev</kbd><samp class="PROMPT">#</samp> <kbd class="USERINPUT">sh MAKEDEV ad1</kbd>   </pre><p>This example would make the proper device nodes for the second IDE drive wheninstalled.</p></div><div class="SECT3"><h3 class="SECT3"><a id="AEN5054" name="AEN5054">3.11.1.2 <varclass="LITERAL">DEVFS</var> (DEVice File System)</a></h3><p>The device file system, or <var class="LITERAL">DEVFS</var>, provides access tokernel's device namespace in the global file system namespace. Instead of having tocreate and modify device nodes, <var class="LITERAL">DEVFS</var> maintains thisparticular file system for you.</p><p>See the <ahref="http://www.FreeBSD.org/cgi/man.cgi?query=devfs&sektion=5&manpath=FreeBSD+6-current"><span class="CITEREFENTRY"><span class="REFENTRYTITLE">devfs</span>(5)</span></a> manualpage for more information.</p><p><var class="LITERAL">DEVFS</var> is used by default in FreeBSD&nbsp;5.0 and above.</p></div></div></div><div class="NAVFOOTER"><hr align="LEFT" width="100%" /><table summary="Footer navigation table" width="100%" border="0" cellpadding="0"cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="editors.html"accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html"accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="binary-formats.html"accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Text Editors</td><td width="34%" align="center" valign="top"><a href="basics.html"accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Binary Formats</td></tr></table></div><p align="center"><small>This, and other documents, can be downloaded from <ahref="ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/">ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/</a>.</small></p><p align="center"><small>For questions about FreeBSD, read the <ahref="http://www.FreeBSD.org/docs.html">documentation</a> before contacting &#60;<ahref="mailto:questions@FreeBSD.org">questions@FreeBSD.org</a>&#62;.<br />For questions about this documentation, e-mail &#60;<ahref="mailto:doc@FreeBSD.org">doc@FreeBSD.org</a>&#62;.</small></p></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -