📄 basics-devices.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 使用手册" 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" /><meta http-equiv="Content-Type" content="text/html; charset=GB2312" /></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 使用手册</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>® 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="AEN4937" name="AEN4937">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="AEN4940" name="AEN4940">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 <span class="CITEREFENTRY"><spanclass="REFENTRYTITLE">MAKEDEV</span>(8)</span> script as shown 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="AEN4953" name="AEN4953">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 <span class="CITEREFENTRY"><span class="REFENTRYTITLE">devfs</span>(5)</span>manual page for more information.</p><p><var class="LITERAL">DEVFS</var> is used by default in FreeBSD 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></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -