\documentclass[letterpaper]{article}
\nonstopmode
\akai
\usepackage{linuxdoc-sgml}
\usepackage{qwertz}
\usepackage{url}
\usepackage[latin1]{inputenc}
\usepackage{t1enc}
\usepackage[english]{babel}
\usepackage{epsfig}
\usepackage{null}
\def\addbibtoc{
\addcontentsline{toc}{section}{\numberline{\mbox{}}\relax\bibname}
}%end-preamble
\setcounter{page}{1}
\title{The Linux Plug-and-Play HOWTO ÖÐÎÄ°æ}
\author{×÷Õß: David S.Lawyer {\ttfamily \onlynameurl{bf347@lafn.org}}\\ 
ÒëÕß: ¶Å¿ËÊ¯ {\ttfamily \onlynameurl{rock@371.net}}}
\date{v0.00, November 1998}
\abstract{°ïÖúÄãÀí½âºÍÊ¹ÓÃ PnP Éè±¸. ÈçºÎÊ¹ÄãµÄ Linux Ö§³Ö PnP. µÚÒ»¸ö°æ±¾ÊÇ²»ÍêÕûµÄ,
µ«Ò²Ðí¶ÔÄãÓÐÓÃ.}


\begin{document}
\maketitle
\tableofcontents

\section{½éÉÜ}


\subsection{°æÈ¨, ÉÌ±ê, ²»µ£±£, ºÍ ÐÅÓÃ}

±¾Ð¡½ÚÇë¿´Ô­ÎÄ




\subsubsection{°æÈ¨}

 Copyright (c) 1998 by David S. Lawyer. Please freely copy and
distribute (sell or give away) this document.  You may create
derivative works and distribute them provided you:

I. For the case of minor changes and corrections where there exists a
current maintainer:\\  
Send your proposed changes to the current maintainer first.  You may
distribute (per II. below) only if the current maintainer neglects to
incorporate your changes in a timely manner.  If the changes are only
to correct typos, you need not wait for a reply from the maintainer
before you distribute.

II. In all other cases:\\ 
\begin{enumerate}
\item  Make a good faith effort to insure that a copy of the derivative
work (including any master copy) gets on the Internet at a
well-known (and mirrored) site for free downloading.\\ 
\item  If you change the license, license the work in the spirit of this
license, or use GPL (Free Software Foundation).  
\item  The major authors become the copyright owners (not to exceed 2).
Minor contributions do not make you an author.\\ 
\item  Make a good faith effort to contact the maintainer (or 
copyright owners if there is no maintainer) to let them know what you
have done.  If the changes are extensive, then you should also attempt
to make more such contacts (including prior to your project).\\ 
\item  Give full credit to significant previous authors and contributors
although the credits section need not exceed 1\% of the length of the
document.
\end{enumerate}





\subsubsection{ÉÌ±ê}

 If certain words are trademarks, the context should make it clear
to whom they belong.  For example "MS Windows" (or just "Windows")
implies that "Windows" belongs to Microsoft (Micro\$oft).




\subsubsection{²»µ£±£}

 Much of the info in this HOWTO was obtained from 
Serial-HOWTO, the Internet, sales clerks, etc. and may be unreliable.
While I haven't intentionally tried to mislead you, there are likely a
number of errors in this document.  Please let me know about them.
Since this is free documentation, it should be obvious that neither I
nor previous authors can be held legally responsible for any errors.




\subsection{Î´À´¼Æ»®: ÄãÒ²¿ÉÒÔ°ïÃ¦}

Çë¸æËßÎÒÄãµÄÖÖÖÖÏë·¨. µ«Ê×ÏÈ×¢Òâ, Èç¹ûÄãÊÖÖÐµÄ°æ±¾ÊÇÒ»¸öÔÂÒÔÇ°µÄ,
Çë¿´ÊÇ·ñÓÐÐÂ°æ±¾. 

´Ë HOWTO µÚÒ»¸ö°æ±¾, 0.00, ÎÒÉõÖÁÃ»ÓÐ¿´Êé: PnP ÌåÏµ½á¹¹, Ò²²¢²»ÍêÈ«Àí½â PnP.
Ò²Ã»ÓÐ±È½Ï¶þ¸ö°Ñ Linux ±ä³É PnP ²Ù×÷ÏµÍ³µÄ²¹¶¡µÄ²»Í¬. ÎÒ²»»á³ä·Ö½âÊÍ BIOS
ÈçºÎÉèÖÃ PnP(¸ü²»ÒªËµ²¹¶¡ÈçºÎ×öÁË). ´Ë HOWTO
ÊÇ²»ÍêÕûµÄ²¢ÇÒ¿ÉÄÜ²»ÕýÈ·(¼ÙÈçÎÒ´íÁË, Çë¸æËßÎÒ). ÔÚ´Ë HOWTO ÖÐÎÒÊ¹ÓÃ ??
À´±íÊ¾ÎÒ²»ÖªµÀ´ð°¸. ÄãÏë¸Ä½ø(ÖØÐ´)ºÍÎ¬»¤´Ë HOWTO Âð? ÎÒÕýÔÚÕÒÈË.




\subsection{´Ë HOWTO µÄÐÂ°æ±¾}

 
´Ë HOWTO µÄÐÂ°æ±¾¿ÉÒÔÔÚ LDP µÄ¾µÏñÕ¾µãÉÏÕÒµ½. Ê×ÏÈ¿´
\nameurl{http://sunsite.unc.edu/LDP/mirrors.html}{},
µ±ÄãÕÒµ½Ò»¸ö½üµÄ¾µÏñÕ¾µãáá, µã»÷ "Linux Documentation Project" (LDP),
ÔÚÆäËü¸ñÊ½ HOWTO ÖÐÕÒ.
Èç¹ûÄã½ö½öÏëÖªµÀ×îÐÂ°æ±¾µÄÈÕÆÚ, Äã²»±ØÊ¹ÓÃ¾µÏñÕ¾µã, ¿´
\nameurl{http://sunsite.unc.edu/LDP/HOWTO/Plug-and-Play-HOWTO.html}{} ¼´¿É.




\section{PnP Ôõ÷á×ö: ·ÖÅä "×ÊÔ´"}


\subsection{Ê²÷áÊÇ Plug-and-Play (PnP)? }

Plug-and-Play ¾ÍÊÇ×Ô¶¯ÅäÖÃ(µÍ²ã)¼ÆËã»úÖÐµÄ²å¿¨ºÍÆäËûÉè±¸,
È»áá¸æËß¶ÔÓ¦µÄÉè±¸¶¼×öÁËÊ²÷á. Plug-and-Play
µÄÈÎÎñÊÇ°ÑÎïÀíÉè±¸ºÍÈí¼þ(Éè±¸Çý¶¯³ÌÐò)ÏàÅäºÏ, ²¢²Ù×÷Éè±¸,
ÔÚÃ¿¸öÉè±¸ºÍËüµÄÇý¶¯³ÌÐòÖ®¼ä½¨Á¢Í¨ÐÅÍ¨µÀ. »»ÖÖËµ·¨, PnP
·ÖÅäÏÂÁÐ×ÊÔ´¸øÉè±¸ºÍÓ²¼þ: I/O µØÖ·, IRQ, DMA Í¨µÀ, ÄÚ´æ¶Î. ¼ÙÈçÄã²»Àí½âÕâ 4 Ïî,
¿´ÏÂÃæµÄ. Ò»µ©ÕâÐ©×ÊÔ´±»·ÖÅä, Éè±¸(Ãû×ÖÔÚ /dev
Ä¿Â¼ÖÐ)¾Í×¼±¸ºÃ±»Ê¹ÓÃ(ÌÈÈôÕâÐ©ÎïÀíÉè±¸ÔÚÄãµÄ PC ÖÐ).

PnP ÅäÖÃ×ÊÔ´, µ«½öÊÇÒ»¶¨³Ì¶ÈÉÏµÄÅäÖÃ×ÊÔ´. ¾¡¹ÜÊ¹ÓÃÁË PnP, Ðí¶àÉè±¸ÈÔ²»ÊÇ±» PnP
À´ÅäÖÃ. Èçµ÷ÖÆ½âµ÷Æ÷µÄÅäÖÃ, 'init string' ±»Í¨¹ý I/O µØÖ·Í¨µÀËÍ¸øµ÷ÖÆ½âµ÷Æ÷, ¾¡¹Ü I/O
µØÖ·Í¨µÀÊÇÓÉ PnP ·ÖÅäµÄ, µ« 'init string' Óë PnP ÎÞ¹Ø.
ÉèÖÃ´®¿ÚµÄËÙ¶ÈÊÇÓÉÓÃ»§Ö´ÐÐ³ÌÐòÀ´×öµÄ¶ø²»ÓÉ PnP. ËùÒÔµ±ËµÆð PnP µÄÊ±ºò,
'×ÊÔ´'ÒâÎ¶Öø×ÊÔ´ÖÐµÄÒ»²¿·Ö, 'ÅäÖÃ'ÒâÎ¶ÖøÄ³Ð©ÀàÐÍµÄÅäÖÃ.




\subsection{¼ÆËã»úÈçºÎÕÒÉè±¸(ºÍ ·´¹ýÀ´)}

¼ÆËã»ú°üÀ¨ CPU À´ÔËËã, ÄÚ´æÀ´´æ´¢³ÌÐòºÍÊý¾Ý. »¹ÓÐÒ»Ð©Éè±¸, Èç´ÅÅÌÇý¶¯Æ÷, ÏÔÊ¾¿¨,
¼üÅÌ, Íø¿¨, modem ¿¨, Éù¿¨, ´®¿ÚºÍ²¢¿Ú, µÈµÈ. »¹ÓÐµçÔ´Ìá¹©µçÄÜ,
Ö÷°åÉÏµÄ¸÷ÖÖ×ÜÏß°ÑÉè±¸ºÍ CPU Á¬ÔÚÒ»Æð, »úÏä°ÑËüÃÇ×°ÆðÀ´.

¹ýÈ¥, Ðí¶àÉè±¸¶¼ÊÇ²å¿¨(Ó¡Ë¢ÏßÂ·°å). ½ñÌì, ³ýÁË²å¿¨Ö®Íâ,
Ðí¶àÉè±¸ÒÑ¾­Ð¡µ½Ò»¿éÐ¾Æ¬±»×öÔÚÖ÷°æÉÏ. Ö÷°æÉÏµÄ²å¿¨Ò²Ðí°üº¬²»Ö¹Ò»¸öÉè±¸.
ÄÚ´æÓÐÊ±Ò²±»ÈÏÎªÊÇÉè±¸µ«²»ÊÇ´Ë HOWTO ÖÐµÄ plug-and-play.

¼ÆËã»úÒªÕý³£¹¤×÷, Ã¿¸öÉè±¸±ØÐëÔÚËüµÄÇý¶¯³ÌÐò(ËüÒ²ÊÇ²Ù×÷ÏµÍ³µÄÒ»²¿·Ö,
ÔÚCPUÉÏÔËÐÐ)¿ØÖÆÏÂÔËÐÐ. Çý¶¯³ÌÐòÓë /dev Ä¿Â¼ÏÂµÄÌØÊâÎÄ¼þÁªÏµÔÚÒ»Æð,
¾¡¹ÜËûÃÇ²»ÊÇÕæÕýµÄÎÄ¼þ. ËüÃÇÓÐÏó hda1, ttyS0, eth1 µÈÕâÑùµÄÃû×Ö.
Âé·³µÄÊÇÑ¡ÔñÌØÊâÉè±¸µÄÇý¶¯³ÌÐò, ¾ÍËµ eth1 °É, ÒÀÀµÓÚÄãÊ¹ÓÃµÄÍø¿¨µÄÀàÐÍ. ÕâÑù eht1
¾Í²»ÄÜ·ÖÅä¸ø³ýÁË¿ÉÒÔÊ¹Äã°²×°µÄÍø¿¨Õý³£¹¤×÷µÄÇý¶¯³ÌÐòÍâµÄÆäËüÇý¶¯³ÌÐò.
ÎªÁË¿ØÖÆÉè±¸, CPU (ÔÚÇý¶¯³ÌÐòµÄ¿ØÖÆÏÂ)ÏòÉè±¸·¢ËÍÃüÁîºÍ´ÓÉè±¸¶ÁÈ¡ÐÅÏ¢.
ÒªÕâÑù×ö, Ã¿¸öÉè±¸Çý¶¯³ÌÐò±ØÐëÖªµÀÉè±¸µÄ½Ó¿ÚµØÖ·, ±ÈÈçÓÃÓÚÍ¨ÐÅµÄµØÖ·.
ÖªµÀÕâÑùµÄµØÖ·¾ÍÈçÍ¬½¨Á¢ÁËÒ»ÌõÍ¨ÐÅÍ¨µÀ, ¼´Ê¹Õâ¸öÍ¨µÀÊÇ PC
ÀïµÄÐí¶àÉè±¸¹²ÏíµÄÊý¾Ý×ÜÏß.

PC ÓÐ 3 ÀàµØÖ·¿Õ¼ä: ÄÚ´æ, I/O, ºÍÅäÖÃ(½öÏÞÓÚ PCI ×ÜÏß). Ö»ÓÐÇ°Á½¸ö(ÄÚ´æ, I/O)±» PnP
ÅäÖÃ. ÔÚ PC ÀïÕâ3ÖÖÀàÐÍµÄµØÖ·¹²ÏíÍ¬ÑùµÄ×ÜÏß. (ÁíÍâ: ¶ÔÓÚ PCI ×ÜÏß,
ËüÓÃÓÚ´«ÊäÊý¾Ý). µ«ÊÇÓÉÌØ¶¨µçÂ·À´¸æËßÉè±¸µØÖ·ÊÇÔÚ I/O ¿Õ¼ä»òÔÚÄÚ´æ¿Õ¼ä.(ÒëÕß×¢:
ÆäÊµ¾ÍÊÇ×ÜÏß¿ØÖÆµçÂ·ÖÐµÄÄÚ´æÊ¹ÄÜÏß, µ±ËüÎª 0 µçÆ½Ê±, ±íÊ¾µ±Ç°µØÖ·ÊÇÄÚ´æµØÖ·, Îª
1 µçÆ½Ê±, ±íÊ¾µ±Ç°µØÖ·ÊÇ I/O µØÖ·.) Éè±¸Í¨³£Ê¹ÓÃ I/O µØÖ·¿Õ¼ä. ·ÖÅä I/O
µØÖ·Ö÷ÒªÓÐÁ½²½.

\begin{enumerate}
\item  ÉèÖÃ²å¿¨µÄ I/O µØÖ·,µÈ.(²å¿¨¼Ä´æÆ÷µØÖ·ÖÐµÄÒ»¸ö)
\item  ÈÃÉè±¸Çý¶¯³ÌÐòÖªµÀÕâÐ© I/O µØÖ·.
\end{enumerate}
 

µÚÈý²½ÊÇÔÚ /dev Ä¿Â¼ÖÐ¸øÉè±¸ºÍËüµÄÇý¶¯³ÌÐòÈ¡Ò»¸öÃû×Ö, Èç hda, ttyS0, »ò eth1.
Ç°Á½²½¾ÍÏó½â¾öÔÚÒ»Ìõ½ÖµÀÉÏÕÒÄ³ÈËµÄ×¡Õ¬ºÅÂëµÄÎÊÌâ.
Äã±ØÐëÖªµÀ×¡Õ¬ºÅÂë²¢ÇÒÄ³ÈË±ØÐë°ÑºÅÂë·ÅÔÚ×¡Õ¬Ç°Ãæ, Äã²Å¿ÉÒÔÕÒµ½Ëü. ÔÚ¼ÆËã»úÖÐ,
Çý¶¯³ÌÐò±ØÐëÖªµÀ½Ó¿ÚµØÖ·, ²¢ÇÒÓ²¼þ±ØÐëÉèÖÃÎªÏàÍ¬µÄµØÖ·,
µ±È»ÕâÐ©µØÖ·Ó¦ÊÇ²å¿¨¼Ä´æÆ÷µØÖ·ÖÐµÄÒ»¸ö. ÕâÁ½Ñù¶¼Òª×ö,
´íÎóµÄÊÇÓÐÐ©ÈË½ö×öÁËÆäÖÐÒ»Ñù, È»ááÈ´¶Ô¼ÆËã»úÕÒ²»µ½Éè±¸¸Ðµ½Ææ¹Ö.
ÏÂÃæ½âÊÍÉÏÃæµÄ: 
\ref{interrupt_over} {(IRQ's)}, \ref{dma_} {(DMA Í¨µÀ)}
IRQ, DMA Í¨µÀ, ºÍ \ref{mem_} {(ÄÚ´æµØÖ·)}, ËùÓÐÕâÐ©¶¼½Ð"{\itshape ×ÊÔ´\/}".




\subsection{IRQ's -- ¸ÅÊö \label{interrupt_over} }

¿´¹ýÏÂÃæµÄ¼òÂÔ½éÉÜ, ÄãÒ²Ðí»¹Ïë¿´¸üÏêÏ¸µÄ\ref{interrupt_detail} {(ÖÐ¶Ï -- Ïê½â)}.
¼òÊö: ³ýÁËµØÖ·Íâ, »¹ÓÐÖÐ¶ÏÐèÒª´¦Àí(Èç IRQ5). °ÑËü½ÐÖÐ¶ÏºÅ.
ÎÒÃÇÔÚÉÏÃæÒÑ¾­Ëµ¹ýÉè±¸Çý¶¯³ÌÐòÎªÁËÄÜÍ¨ÐÅ±ØÐëÖªµÀ²å¿¨µÄµØÖ·.
ÄÇ÷á·´¹ýÀ´Ôõ÷á°ìÄØ? Éè±¸ÈçºÎÓëÇý¶¯³ÌÐòÍ¨ÐÅÄØ? ËùÒÔÉè±¸ÐèÒªÖªµÀÇý¶¯³ÌÐòµÄµØÖ·,
ÕâÑùÉè±¸¾Í¿ÉÒÔºô½ÐÇý¶¯³ÌÐòÁË. ÀýÈç: Éè±¸½ÓÊÕµ½Ò»Ð©ÐèÒª´«ËÍµ½Ö÷´æµÄÊý¾Ý,
ËüÐèÒª¸æËßÇý¶¯³ÌÐòÂíÉÏÀ´ÄÃÕâÐ©Êý¾Ý, ²¢°ÑÊý¾Ý´ÓÉè±¸µÄ»º³åÇøËÍµ½Ö÷´æ.

Éè±¸ºô½ÐÇý¶¯³ÌÐòÓÃ°ÑÒ»¸öÖÐ¶ÏµçÂ·Á¬Ïß(×ÜÏßµÄÒ»²¿·Ö)µÄµçÆ½Ì§¸ßµÄ·½·¨.
ÓÐ16¸öÕâÑùµÄÁ¬Ïß, Ã¿¸öÁ¬ÏßÓëÒ»¸öÌØ¶¨µÄÉè±¸Çý¶¯³ÌÐò¹ØÁª. Ã¿¸ùÁ¬ÏßÓÐÒ»¸öÌØ¶¨µÄ
IRQ(Interrupt ReQuest) ºÅ. Éè±¸ÐèÒª°ÑÖÐ¶Ï·Åµ½Ç¡µ±µÄÁ¬ÏßÉÏ,
²¢ÇÒÇý¶¯³ÌÐò±ØÐëÕìÌýÍ¬Ò»Á¬Ïß. ¾¿¾¹Ê¹ÓÃÄÄ¸ùÁ¬ÏßÈ¡¾öÓÚ´æÖüÔÚÉè±¸ÖÐµÄÖÐ¶ÏºÅ,
´ËÖÐ¶ÏºÅ±ØÐë±»Çý¶¯³ÌÐòÖªµÀ, ÕâÑùËü²ÅÖªµÀÐèÒªÕìÌýÄÇ¸ùÖÐ¶ÏÏß.




\subsection{DMA Í¨µÀ \label{dma_}}

DMA ´ú±í 'Direct Memory Access'(Ö±½ÓÄÚ´æ·ÃÎÊ). ¾ÍÊÇÔÊÐíÉè±¸´Ó CPU
ÊÖÖÐ½Ó¹ÜÏµÍ³×ÜÏß, ²¢Ö±½Ó°ÑÊý¾Ý´«ËÍµ½Ö÷ÄÚ´æ. Í¨³£ CPU ·ÖÁ½²½À´´«ËÍÊý¾Ý: 1.
´ÓÉè±¸µÄ I/O ´æ´¢¿Õ¼ä¶ÁÊý¾Ý, °ÑÊý¾Ý·ÅÔÚ CPU ÄÚ²¿. 2. CPU
°ÑÊý¾Ý´ÓÆäÄÚ²¿ËÍµ½Ö÷ÄÚ´æ. DMA ·½Ê½Í¨³£ÓÃÒ»²½¾Í¿É°ÑÊý¾Ý´ÓÉè±¸Ö±½ÓËÍµ½Ö÷ÄÚ´æ.
Éè±¸Ó²¼þ±ØÐëÄÚÖÃÓÐÕâÖÖÄÜÁ¦²¢²»ÊÇËùÓÐµÄÉè±¸¶¼¿ÉÒÔÊ¹ÓÃ DMA µÄ. ´Ó DMA
´«ÊäÕ¼ÓÃÏµÍ³×ÜÏß¿ªÊ¼µÄ´«Êä¹ý³ÌÖÐ CPU ¾Í²»×öÊ²÷áÁË.

µ±Ò»¸öÉè±¸ÊÔÍ¼½øÐÐ DMA Ê±, Ëü»á·¢³öÒ»¸öÇëÇó(ÓÃ¸Ä±ä×ÜÏßµÄ DMA
ÇëÇóÁ¬ÏßµÄµçÆ½µÄ·½Ê½). DMA ÇëÇóÒ²¿ÉÒÔÓÃÖÐ¶ÏµÄ·½Ê½À´ÊµÏÖ, µ«»áÓÐÒ»¶¨µÄÑÓÊ±,
ËùÒÔÎªÁË¿ìËÙ, ¾ÍÓÃÒ»ÖÖÌØÊâÀàÐÍµÄÖÐ¶Ï 'DMA-ÇëÇó' À´ÊµÏÖ. ÏóÖÐ¶ÏÒ»Ñù, °Ñ
'DMA-ÇëÇóÏß' ±àºÅÀ´Ê¶±ðÊÇÄÄ¸öÉè±¸·¢³öµÄÇëÇó. ÕâÐ©±àºÅ¾Í½Ð DMA-Í¨µÀ. ÒòÎª DMA
´«ÊäÊ¹ÓÃÏµÍ³×ÜÏß(Í¬Ò»Ê±¼äÖ»ÄÜÓÐÒ»¸öÊ¹ÓÃ), ËùÒÔËüÃÇÊµ¼ÊÉÏÓÃÍ¬Ò»¸öÍ¨µÀ,
±àºÅÖ÷ÒªÓÃÀ´Ê¶±ðË­ÔÚÊ¹ÓÃÍ¨µÀ. Ö÷°åÉÏµÄÓ²¼þ¼Ä´æÆ÷¼ÍÂ¼¸÷Í¨µÀµÄµ±Ç°×´Ì¬.
Òª·¢³öÒ»¸ö DMA ÇëÇó, Éè±¸±ØÐëÖªµÀ×Ô¼ºµÄ DMA Í¨µÀºÅ,
Í¨µÀºÅÓÉÎïÀíÉè±¸´æ´¢ÔÚ×Ô¼ºÄÚ²¿.




\subsection{Memory ¶Î \label{mem_}}

Ïñ I/O µØÖ·Ò»Ñù, Ò»Ð©Éè±¸ÔÚÖ÷ÄÚ´æÖÐ·ÖÅäÓÐµØÖ·. µ±Äã²åÕâÑùµÄ¿¨Ê±,
ÄãÊµ¼ÊÉÏÒ²²åÁËÒ»¿éÄÚ´æÄ£¿é(Ö÷ÄÚ´æ, ²»ÊÇ I/O ÄÚ´æ). Õâ¶ÎÄÚ´æ±»Éè±¸ºÍ CPU
¹²Ïí(ÔËÐÐÉè±¸Çý¶¯³ÌÐòáá). Õâ¿éÄÚ´æÒâÎ¶ÖøÉè±¸ºÍÖ÷ÄÚ´æÖ®¼ä'Ö±½Ó'´«ÊäÊý¾Ý.
ÆäÊµ²»ÊÇÕæÕýµÄ´«Êä, Éè±¸°ÑÊý¾Ý·Åµ½Ëü×Ô¼ºµÄÄÚ´æÖÐÍ¬Ê±Ò²¾Í·Åµ½ÁËÖ÷ÄÚ´æÖÐ.
²å¿¨ºÍÉè±¸Çý¶¯³ÌÐò±ØÐëÖªµÀÄÚ´æ¿éµÄµØÖ·.




\subsection{Á½ÖÖ "×ÊÔ´"}

±ØÐë°ÑÉè±¸Çý¶¯³ÌÐòºÍËûÃÇ¿ØÖÆµÄÓ²¼þÁªÏµÆðÀ´. ÕâÓÉÏòËûÃÇÌá¹©ÏàÍ¬µÄ×ÊÔ´À´½â¾ö.
ÀýÈç: ´®ÐÐ¿ÚÊ¹ÓÃÁ½¸ö×ÊÔ´: Ò»¸ö IRQ ºÍ Ò»¸ö I/O µØÖ·.
ÕâÐ©×ÊÔ´±ØÐëÌá¹©¸øÉè±¸Çý¶¯³ÌÐòºÍÎïÀíÉè±¸Á½Õß. Çý¶¯³ÌÐò(ºÍËüµÄÉè±¸)±»ÃüÃû(Èç
ttlyS1). µØÖ·ºÍ IRQ ºÅ±»²å¿¨´æ´¢ÔÚ×Ô¼ºµÄ¼ÇÒäÌåÖÐ(»òÖ÷°åµÄÒ»¸öÐ¾Æ¬ÖÐ). 




\subsection{ÎÊÌâ}

PC ÌåÏµÖ»Ìá¹©ÓÐÏÞµÄ IRQ, DMA Í¨µÀ, I/O µØÖ·,µÈ.
¼ÙÈçÖ»ÓÐ¼¸ÖÖÉè±¸²¢ÇÒÉè±¸¶¼Ê¹ÓÃ±ê×¼µÄ×ÊÔ´,
°ÑÇý¶¯³ÌÐòºÍÉè±¸ÁªÏµÔÚÒ»ÆðÃ»Ê²÷áÎÊÌâ.
Ã¿¸öÉè±¸ÓÐÒ»¸ö¹Ì¶¨µÄ×ÊÔ´²¢ÇÒ²»Óë»úÆ÷ÖÐµÄÆäËûÉè±¸³åÍ». Ã»ÓÐÁ½¸öÉè±¸Ê¹ÓÃÏàÍ¬µÄ
I/O µØÖ·, IRQ, µÈ. ±àÐ´Çý¶¯³ÌÐòÊ±°ÑÕâÐ©×ÊÔ´Ð´½øÈ¥¼´¿É. ÕâÑùÊÂÇé¾Í¼òµ¥ÁË.

µ«Êµ¼ÊÇé¿ö²»ÊÇÕâÑù. ½ñÌì²»½öÓÐÐí¶à²»Í¬µÄÉè±¸ÇÒËüÃÇ¼«ÓÐ¿ÉÄÜ·¢Éú³åÍ»,
¶øÇÒÍ¬Ê±ÓÖÒªÊ¹ÓÃ²»Ö»Ò»¸öÍ¬ÖÖÀàÐÍµÄÉè±¸.
ÀýÈçÒ»¸öÈË¿ÉÄÜÏëÊ¹ÓÃ¼¸¸ö²»Í¬µÄ´ÅÅÌÇý¶¯Æ÷, ¼¸¸ö´®¿Ú, µÈµÈ.
ËùÒÔÉè±¸±ØÐëÓÐÒ»¶¨µÄÁé»îÐÔÕâÑù¿ÉÒÔ°ÑËüÃÇÉèÖÃÎªÈÎÒâµÄµØÖ·, IRQ, µÈµÈ.
ÒòÎªÒª±Ü¿ª×ÊÔ´³åÍ». µ«ÊÇÒ»Ð© IRQ ºÍ µØÖ·ÊÇÏàµ±±ê×¼µÄÈçÊ±ÖÓºÍ¼üÅÌ.
ËüÃÇ²»ÐèÒªÕâÑùµÄÁé»îÐÔ. 

³ýÁË×ÊÔ´³åÍ»Ö®Íâ, »¹ÓÐÒ»¸öÎÊÌâÊÇ¸æËßÇý¶¯³ÌÐò´íÎóµÄ×ÊÔ´ÐÅÏ¢. ÀýÈç:
Äã¸ù¾Ý²ÂÏëÔÚÅäÖÃÎÄ¼þÖÐÊäÈë IRQ4, ¿ÉÉè±¸Êµ¼ÊÊ¹ÓÃµÄÊÇ IRQ5.
ÕâÊÇ×ÊÔ´·ÖÅäµÄÁíÒ»ÖÖ´íÎó.

×ÊÔ´·ÖÅä, Èç¹û×öµÄÕýÈ·, ¿ÉÒÔÔÚÓ²¼þºÍËüÃÇµÄÇý¶¯³ÌÐòÖ®¼ä½¨Á¢Í¨ÐÅÍ¨µÀ. ÀýÈç,
Ò»¸öÌØ¶¨µÄ I/O µØÖ·¡õÎ§·ÖÅä¸øÒ»¸öÉè±¸Çý¶¯³ÌÐòºÍÒ»¿éÓ²¼þ,
ÄÇ÷á¾Í¿ÉÔÚËüÃÇÖ®¼ä½¨Á¢Í¨ÐÅÍ¨µÀ. Çý¶¯³ÌÐò¿ÉÒÔÏòÉè±¸ËÍÃüÁîºÍÐÅÏ¢.
Êµ¼ÊÉÏ²»Ö»Ò»ÌõÍ¨µÀ, ÒòÎªÇý¶¯³ÌÐò¿ÉÓÃ¶ÁÉè±¸¼Ä´æÆ÷µÄ·½Ê½µÃµ½ÐÅÏ¢.
µ«ÊÇÉè±¸²»ÄÜÓÃÕâÖÖ·½Ê½Í¨ÐÅ. ·ÖÅäÒ»¸ö IRQ,
°ÑËü×÷ÎªÇý¶¯³ÌÐòºÍÉè±¸¿ÉÒÔ½»»¥µÄÁíÒ»ÌõÍ¨ÐÅÍ¨µÀ. 




\section{Plug-and-Play (PnP) ½â¾ö·½°¸}


\subsection{½éÉÜ}

PnP °Ñ PnP ×ÊÔ´×Ô¶¯·ÖÅä¸øÓ²¼þºÍ¶ÔÓ¦µÄÈí¼þ. ¾ÍÊÇ,
°ÑÉè±¸ºÍËüÃÇµÄÇý¶¯³ÌÐòÅä¶Ô²¢½¨Á¢Í¨ÐÅÍ¨µÀ. ÔÚÊ¹ÓÃ PnP Ö®Ç°, Ó²¼þ¿¿ÌøÏß,
Èí¼þ¿¿ÅäÖÃÎÄ¼þ(»òÀàËÆµÄ·½·¨)»ò²Â²âÓ²¼þÊ¹ÓÃµÄ×ÊÔ´À´·ÖÅä×ÊÔ´.
ÕâÑù²¢²»ÄÜ×ÜÊÇÕý³£¹¤×÷. 

ÍêÈ«µÄ PnP (Ò²²»ÄÜ×ÜÊÇÕý³£¹¤×÷), ÐèÒª PnP BIOS ºÍ²Ù×÷ÏµÍ³µÄÅäºÏ.
µ±¼ÆËã»ú¿ª»úÊ± BIOS »áÔËÐÐÀ´Æô¶¯. ¼ÙÈç²Ù×÷ÏµÍ³´æ´¢ÔÚÓ²ÅÌÉÏ(Í¨³£ÊÇÕâÑù), ÄÇ÷á
BIOS ±ØÐëÁË½âÕâ¸öÓ²ÅÌ. Èç¹ûÓ²ÅÌÊÇ PnP µÄÄÇ÷á BIOS »áÊ¹ÓÃ PnP ·½Ê½ÕÒµ½Ëü. Í¬Ñù,
µ±¼ÆËã»úÆô¶¯Ê±ÎªÁËÅäÖÃ BIOS, ÏÔÊ¾¿¨ºÍ¼üÅÌÊ±±ØÐëµÄ, ËùÒÔÈç¹ûÐèÒªµÄ»° BIOS
±ØÐëÅäÖÃÕâÐ©Éè±¸.

Ò»µ© BIOS Ê¶±ðÁËÓ²ÅÌ, ÏÔÊ¾¿¨, ºÍ¼üÅÌ, Ëü¾Í×¼±¸ 'boot'(´ÓÓ²ÅÌµ÷Èë²Ù×÷ÏµÍ³).
¼ÙÈçÄãÒÑ¾­¸æËß BIOS ÄãÓÐÒ»¸ö PnP µÄ²Ù×÷ÏµÍ³,
Ëü½«×öÕâ÷á¶à²¢ÈÃ²Ù×÷ÏµÍ³Íê³ÉÆäâÅµÄ PnP ÅäÖÃ. ·ñÔò, PnP-BIOS ½«Íê³ÉÊ£âÅµÄ PnP
ÅäÖÃ.




\subsection{Linux ÐèÒª PnP }

Wintel(Microsoft ºÍ Intel) ´´ÔìÁË PnP. ÓÉÓÚÖÖÖÖÔ­Òò, Linux ÉçÇøÓÐÈË²»Ï²»¶ PnP.
µ«²»¹ÜÏ²»¶Óë·ñ, ½ñÌìµÄÓ²¼þ´ó²¿·ÖÊÇ PnP µÄ, ³ýÁËÓÐÐ§µÄ´¦Àí PnP Íâ, Linux ±ðÎÞÑ¡Ôñ.




\subsection{×ÜÏßÎÊÌâ}

PnP ´òËãÔÚÈÎºÎ×ÜÏßÉÏÔËÐÐÈç ISA,PCI. ISA ÊÇ IBM PC ÉÏµÄ¾É×ÜÏß½á¹¹, PCI ÊÇ Intel
´´ÔìµÄÐÂµÄ¿ìËÙµÄ×ÜÏß½á¹¹. ×îÖÕ, ISA ×ÜÏß½«ÏûÍö. PCI
×ÜÏß½á¹¹ÔÚ×ÜÏßÉÏ±£ÁôÁËÐí¶àµØÖ·ÓÃÓÚ PnP ÅäÖÃ. Linux Ê¹ÓÃÕâÐ©µØÖ·À´ÕÒ³öÄãÓÐÊ²÷á
PnP PCI Éè±¸²¢°ÑËüÃÇµÄÐÅÏ¢·ÅÔÚ /proc/pci 'ÎÄ¼þ'ÖÐ. (¹ØÓÚPCI×ÜÏßÉÏµÄ·Ç PnP Éè±¸,
ÎÒ²»Ã÷°×).

¶ÔÓÚ ISA ×ÜÏß, ÓÉÓÚËü²»ÊÇÎª PnP Éè¼ÆµÄ, Éè¼Æ ISA Ê±Ã»ÓÐÈÎºÎ PnP ¸ÅÄî,
ËùÒÔËüÉÏÃæÃ»ÓÐÓÃÓÚ PnP µÄ I/O µØÖ·. ½á¹û, ÔÚ ISA ÉÏÊµÏÖ PnP Ïàµ±¸´ÔÓ,ËüÐèÒª PnP
Éè±¸±»Ö¸¶¨Ò»¸öÁÙÊ±µÄ'handle'(¾ä±ú)ÓÃÓÚ PnP ÅäÖÃ. ·ÖÅäÕâÐ© 'handles' Ò²½Ð×ö 'isolation'.
Çë¿´¸½Â¼ÖÐ¹Øì¶ \ref{isolation_} {(Isolation)} µÄ¸´ÔÓÃèÊö.




\subsection{ÉèÖÃ PnP BIOS \label{conf_pnp_bios}}

µ±¿ª»úÊ±, BIOS ±È²Ù×÷ÏµÍ³ÏÈÐÐµ÷ÈëÔËÐÐ. ÐÂµÄ BIOS Ö§³Ö PnP, Ëü½«ÉèÖÃ²¿·Ö»òËùÓÐµÄ
PnP Éè±¸. ¶ÔÓÚ´ó¶àÊý PnP BIOS Ã»ÓÐ°ì·¨ÒÖÖÆ PnP ¹¦ÄÜ, Äã²»µÃ²»Ê¹ÓÃËü.
Õâ¶ùµÄÒ»Ð©Ñ¡Ïî,ÔÚÄãµÄ BIOS ²Ëµ¥ÖÐÒ²ÐíÒ²ÓÐ:

\begin{itemize}
\item  \ref{bios_pnp_os} {(ÄãÓÐÒ»¸ö PnP ²Ù×÷ÏµÍ³Âð?)}
\item  \ref{bios_resources} {(ÈçºÎ·ÖÅä×ÊÔ´? )}
\item  \ref{bios_reset} {(ÖØÖÃÅäÖÃ? )}
\end{itemize}





\subsubsection{ÄãÓÐÒ»¸ö PnP ²Ù×÷ÏµÍ³Âð? \label{bios_pnp_os}}

¼ÙÈçÄãËµ'ÊÇ', PnP BIOS ½«ÓÃ PnP ÉèÖÃÓ²ÅÌ, µÈ. µ«ÈÃ²Ù×÷ÏµÍ³Íê³É×îÖÕÅäÖÃÈÎÎñ. BIOS
Ò²ÐíÔÚ ISA ×ÜÏßÉÏ×ö \ref{isolation_} {(Isolation)},
È»ááÈÃ²Ù×÷ÏµÍ³À´Íê³ÉÕâÐ©Éè±¸µÄÅäÖÃ.
¼ÙÈçÄãµÄ²Ù×÷ÏµÍ³²»×öÕâÐ©ÅäÖÃ¹¤×÷(Ò»Ð© Linux µÄ²¹¶¡°æ±¾), ÓÉÓÚ BIOS Ò²Ðí»á°ÑÕâÐ©
ISA Éè±¸ÖÃÎª½ûÖ¹×´Ì¬(??), Äã´ó¸Å²»»áËµ'ÊÇ'.

¼ÙÈçÄãËµÃ»ÓÐ, BIOS »á×Ô¼º×öÅäÖÃ¹¤×÷. ³ýÄãÔö¼ÓÐÂµÄ PnP Éè±¸Íâ,
Ëü½«Ê¹ÓÃËüÏÈÇ°´æ´¢ÔÚ·Ç»Ó·¢´æ´¢Æ÷ÖÐµÄÅäÖÃ. ¼ÙÈçÊ¹ÓÃµÄÊÇ Linux,
ÅäÖÃ²»»áÓÐÊ²÷á±ä»¯. ¼ÙÈçÊ¹ÓÃµÄÊÇ Windows 95/98 (ËûÃÇÊÇ PnP µÄ),
ËüÃÇ¿ÉÄÜ»áÉèÖÃÅäÖÃ²»Í¬ÓÚÄãÔÚ Linux ÏÂµÄÅäÖÃ. Í¨³£, Äã¿ÉÒÔÔÚ Linux Æô¶¯Ê±ÔËÐÐ
isapnp ¹¤¾ß°Ñ ISA Éè±¸ÉèÖÃÎªÄãÏëÒªµÄÅäÖÃ. µ«Õâ¶Ô PCI ¿¨Ã»ÓÐ°ïÖú, ²»¹ýÄãÄÜÓÃ¿´
/proc/pci ÎÄ¼þµÄ·½·¨À´¼ì²éËüÃÇÊÇ±»ÈçºÎÅäÖÃµÄ. È»ááÄãÓ¦È·±£ Linux
ÖÐÇý¶¯³ÌÐòÊ¹ÓÃµÄÅäÖÃÎÄ¼þ("setserial", lilo.conf , µÈ)Óë´ËÏà·û.
¿´ \ref{bios_conf} {(BIOS ÅäÖÃ PnP)} µÃµ½¸ü¶àµÄÐÅÏ¢.




\subsubsection{ÈçºÎ·ÖÅä×ÊÔ´? \label{bios_resources}}

ÕâÈ¡¾öÓÚÄã¾ö¶¨ÈçºÎ·ÖÅä IRQ ºÍ DMA. ÉèÎª "auto"(×Ô¶¯), BIOS ½«·ÖÅä×ÊÔ´.
Èç¹ûÉèÎª "manual"(ÊÖ¹¤), Äã¿ÉÒÔ½øÈëÁíÒ»¸ö²Ëµ¥²¢ÄÜÎª "legacy" (non-pnp)¿¨Ô¤Áô×ÊÔ´.
ÏÖÔÚ BIOS Ò²Ðí»ò²»»áÖªµÀÄãµÄ legacy ¿¨. ¼ÙÈçÖªµÀ¿¨µÄ»°, »áÊÔÍ¼Ê¹ÓÃ "auto".
Èç¹û²»ÖªµÀµÄ»°, ÐèÒªÊÖ¹¤Îª legacy ¿¨Ô¤ÁôÐèÒªµÄ IRQ, ÈÃ BIOS PnP
ÅäÖÃÊ±²»Ê¹ÓÃÕâÐ©×ÊÔ´. ¼ÙÈçÄãÔÚ Windows ÏÂÔËÐÐ ICU ¸æËß BIOS ¹ØÓÚÄãµÄ legacy
¿¨µÄÇé¿ö, BIOS ²Å»áÖªµÀÄãµÄ legacy ¿¨µÄÇé¿ö. BIOS
»á°ÑÕâÐ©ÐÅÏ¢´æÔÚËüµÄ·Ç»Ó·¢´æ´¢Æ÷ÖÐ.




\subsubsection{ÖØÖÃÅäÖÃ? \label{bios_reset}}

Õâ»á²Á³ýµô BIOS ´æ´¢ÔÚ·Ç»Ó·¢´æÖüÆ÷ÖÐµÄ PnP Éè±¸ºÍÉÏÃæ½²µÄ legacy ¿¨µÄÅäÖÃÐÅÏ¢.
³ý·ÇÄãÈ·ÐÅÕâÐ©Êý¾ÝÓÐÎóÐèÒªÖØÐ´, ·ñÔòÃ»ÓÐ±ØÒªÕâÑù×ö.
Ö»ÓÐÄãµÄ»úÆ÷²»ÄÜÆô¶¯Ê±²ÅÐèÒªÕâÑù×ö. ¼ÙÈçÄãµÄ BIOS ¶ªÊ§ÁË legacy Éè±¸µÄÐÅÏ¢,
ÄãÐèÒªÔÚ Windows ÏÂÔËÐÐ ICA À´ÖØ½¨ÕâÐ©ÐÅÏ¢.




\section{ÈçºÎ¶Ô¸¶ PnP ¿¨}


\subsection{½éÉÜ}

½ñÌì, ´ó²¿·ÖÐÂµÄÄÚÖÃ²å¿¨ÊÇ PnP µÄ. ÆäÖÐµÄÒ»Ð©¿¨ÓÐÌøÏß(»òÀàËÆµÄ)¿ÉÒÔ°Ñ¿¨ÉèÖÃÎª·Ç
PnP. ÒòÎªÐí¶à Linux (ºÍ Dos/Windows)³ÌÐò¿ÉÒÔ´¦Àí PnP, ×îºÃ±£Áô¿¨µÄ PnP ¹¦ÄÜ.
¼ÙÈçÄã°ÑÄÚºËÉý¼¶ÎªÖ§³Ö PnP,
Ëü²»½ö»áÅäÖÃÓ²¼þ¶øÇÒ»á°ÑÓ²¼þÅäÖÃÐÅÏ¢Ìá¹©¸øÇý¶¯³ÌÐò, ÕâÑùÄã¾Í²»ÐèÒªÅäÖÃËüÃÇÁË.
ÀýÈç, ¶ÔÓÚ´®¿ÚÄã¾Í²»±ØÊ¹ÓÃ "setserial" ÁË.

¼ÙÈçÄãÓÐÒ»¿é PnP ¿¨, Äã»áÓÐÏÂÃæÒ»¸ö»ò¶à¸öÑ¡ÏîÀ´ÅäÖÃËü:

\begin{itemize}
\item  \ref{disable_pnp} {(½ûÓÃ PnP)}
ÓÃÌøÏßµÄ·½·¨(µ«Ðí¶à¿¨²»ÄÜ)»òÌØÊâµÄÈí¼þ. 
\item   \ref{bios_conf} {(BIOS ÅäÖÃ PnP)} (½öÓÃÓÚÄãÓÐÒ»¸ö PnP BIOS)
\item  \ref{isapnp_} {(Isapnp)}
Ò»¸öÓÃÓÚÅäÖÃ ISA ×ÜÏßÉÏ PnP Éè±¸µÄÈí¼þ(µ«²»ÄÜÓÃÓÚ PCI ×ÜÏßÉè±¸)
\item  \ref{patch_kernel} {(ÐÞ²¹ Kernel)} °Ñ Linux ×ª±äÎªÒ»¸ö PnP µÄ²Ù×÷ÏµÍ³ 
\end{itemize}





\subsection{½ûÓÃ PnP ? \label{disable_pnp}}

Ðí¶à¿¨µÄ PnP ¹¦ÄÜÎÞ·¨ÒÖÖÆµô. ¼´Ê¹ÄãÓÐ»ú»áÕâÑù×ö,
ÓÉÓÚÏÂÃæµÄÔ­ÒòÄãÒ²Ðí²»»áÕâÑù×ö.

\begin{enumerate}
\item  ¼ÙÈçÔÚÍ¬Ì¨»úÆ÷ÉÏÓÐ MS Windows, ÄãÒ²ÐíÏ£ÍûÔÚ MS Windows ÏÂ¿ÉÒÔÓÃ PnP À´×ö²»Í¬µÄÅäÖÃ.
\item  IRQ µÈ×ÊÔ´ÓÐÏÞ, ³ý·ÇÊ¹ÓÃ PnP, ·ñÔòºÜÄÑÅäÖÃ. 
\item  ¼ÙÈçÐèÒªÊ¹ÓÃ Dos/Windows ÏÂµÄÈí¼þÉèÖÃÎª·Ç PnP ·½Ê½,
¿ÉÓÐÒ»ÌìÄã²»ÄÜÊ¹ÓÃ Dos/Windows ÁË, Òò´ËºÜÄÑÔÙ¸Ä±äÅäÖÃ. 
\item  ÄãÓÐ(»ò½«ÓÐ)ÆäËü PnP ÉèÅäÐèÒªÅäÖÃ, ËùÒÔÄãÒªÎÞÂÛÈçºÎ¶¼ÐèÒª PnP ¹¦ÄÜ. 
\end{enumerate}

Éè±¸Ò»µ©±»ÉèÖÃÎª·Ç PnP ÅäÖÃ·½Ê½, ËüÃÇ½«²»ÄÜ±» PnP Èí¼þ»ò BIOS
ÅäÖÃ. (³ý·ÇÒÆÈ¥ÌøÏß»òÊ¹ÓÃÅäÖÃÈí¼þ´ò¿ª PnP ¹¦ÄÜ)




\subsection{BIOS ÅäÖÃ PnP \label{bios_conf}}

ÏëÕâÑù×ö, ÄãµÄ BIOS ±ØÐëÖ§³Ö PnP. µÃµ½¹ØÓÚÄãµÄ BIOS ¸ü¶àµÄÐÅÏ¢, ¿´ÓÐ¹ØµÄ Web
Õ¾µã. Ò»Ð© BIOS Ö»ÓÐ×îÉÙµÄ PnP ¹¦ÄÜ, Ëü»áÊÔÍ¼°ÑÀ§ÄÑµÄÅäÖÃ¹¤×÷½»¸ø Windows
¹¤¾ß(ÔÚ Linux ÏÂ²»¿ÉÄÜ). ÔÚÕâÖÖÇé¿öÏÂÈç¹û BIOS Î¬»¤Ò»¸öÅäÖÃÊý¾Ý¿âµÄ»°,
ÄãÒ²ÐèÒªÓÃ DOS/Windows ÏÂµÄ ICU À´ÉèÖÃÕâÊý¾Ý¿â.

Ê×ÏÈÉèÖÃÄãµÄ BIOS Îª ""Not a PnP Operating System"(Ã»ÓÐ PnP µÄ²Ù×÷ÏµÍ³).
¿´ \ref{conf_pnp_bios} {(ÅäÖÃ PnP BIOS)}.
Õâ»áÊ¹ BIOS Íê³ÉÈ«²¿ÅäÖÃ¹¤×÷, ¶ø²»ÊÇ°ÑÊ£âÅµÄ½»¸ø²Ù×÷ÏµÍ³.

BIOS µÄ·Ç»Ó·¢Êý¾Ý¿â½Ð ESCD (Extended System Configuration Data).
Ëü²»½ö´æ´¢ PnP Éè±¸µÄÅäÖÃ²¢ÇÒ´æ´¢·Ç PnP Éè±¸µÄÐÅÏ¢ÓÃÓÚ±Ü¿ª³åÍ».
µ±Äã°²×°ÐÂµÄ·Ç PnP Éè±¸Ó¦ÔÚ°²×°Ç°ÓÃICU(Intel Configuration
Utility)¸æËß ESCD ¹ØÓÚÉè±¸µÄÐÅÏ¢.
ÄãÒ²ÐèÒªÔËÐÐ ICU ¸æËß ESCD ¹ØÓÚÒÑ¾­´æÔÚ»úÆ÷ÖÐµÄ·Ç PnP Éè±¸µÄÐÅÏ¢(³ý·ÇÓÐÈËÒÑ¾­×ö¹ýÁË).

ESCD Í¨³£±£´æÔÚÐ¾Æ¬ÖÐ, µ«ÓÐÊ±»á±£´æÔÚÓ²ÅÌÉÏ?? (ÒëÕßÏë: COMPAQ
µÄÅäÖÃÐÅÏ¢ÓÐÐ©ÊÇ·ñ±£´æÔÚÓ²ÅÌÉÏ) Ê¹ÓÃ Linux ²Ù×÷ÏµÍ³µÄ»úÆ÷µÄ BIOS
Ã¿´ÎÆô¶¯Ê±ÊÇÕâÑùÅäÖÃ. ÄãÒ²ÐíÏë¼ÍÂ¼ ICU (ºÍ BIOS)ÊÇÈçºÎÅäÖÃµÄ(»ò´òÓ¡³öÀ´). È»¶ø,
¼ÙÈçÄãÔö¼ÓÒ»¸öÐÂµÄ·Ç PnP Éè±¸¾ÍÐèÒªÔÙ´ÎÔËÐÐ ICU.
¼ÙÈçËüÊÇ PnP µÄ, BIOS »á×Ô¶¯ÅäÖÃËü, ²¢¾¡Á¿²»¸Ä±ä»úÆ÷ÖÐÒÑ¾­´æÔÚµÄÉè±¸µÄÅäÖÃ.
µ«ÎªÁË¸øÐÂÉè±¸·ÖÅäËüÐèÇóµÄ×ÊÔ´, ÓÐÊ±²»µÃ²»¸Ä±äÒÑÓÐÉè±¸µÄÅäÖÃ. ¼ÙÈçÕâ·¢ÉúÁË,
ÄãÐèÒªÕÒµ½Ê²÷á¸Ä±äÁË(¿´ /proc/pci ºÍÊ¹ÓÃ "pnpdump"ÃüÁî)²¢ÇÒ×ö³öÏàÓ¦¸Ä±ä.

×¢Òâ:
ÔÚ Dos/Windows ÏÂÅäÖÃÐÅÏ¢»¹»á·ÅÔÚÓ²ÅÌÉÏµÄWindowsÎÄ¼þÖÐ,
ÕâÑù²Ù×÷ÏµÍ³ÖªµÀÃ¿¸öÉè±¸µÄÇé¿ö. ¶ÔÓÚ×Ô¶¯¼ì²âÉè±¸µÄ Linux ²»»á·¢ÉúÕâÖÖÊÂÇé.




\subsection{Isapnp \label{isapnp_}}

½öÓÃÓÚ ISA ×ÜÏßÉÏµÄ PnP Éè±¸. ÔÚÆô¶¯Ê±ÔËÐÐ´Ë³ÌÐò½«°´ÕÕÄãÔÚ /etc/isapnp.conf
µÄÉè¶¨À´ÅäÖÃÕâÐ©Éè±¸.ÄãÐèÒª isapnptools °ü, °üº¬ÔÚÐí¶à·¢ÐÐ°æ±¾ÖÐ. ÊäÈë "locate
pnp" À´²éÕÒÄãÊÇ·ñÓµÓÐ isapnp. ¼ÙÈçÄãµÄ Linux ×Ô¶¯°²×°ÁË isatools,
isapnp Ò²ÐíÔÚÆô¶¯Ê±ÒÑ¾­ÔËÐÐ. ¶ÔÓÚÕâÖÖÇé¿ö, ÄãÐèÒª×öµÄ¾ÍÊÇ±à¼­ /etc/isapnp.conf
(ÓÃ {\ttfamily man isapnp.conf} µÃµ½ÓÐ¹ØÐÅÏ¢). ÒòÎªÄãÍ¨¹ý±à¼­ÅäÖÃÎÄ¼þÀ´¾ö¶¨ÈçºÎÉèÖÃÉè±¸,
ÕâÑù×öÓÐµãÏóÊÖ¹¤ÅäÖÃ PnP. ¼ÙÈçÕâÑùÊ¹ÓÃ "isapnp" ²¢ÇÒÓÐÒ»¸ö PnP BIOS,
Äã½«¸æËß BIOS ÄãÓÐÒ»¸ö PnP µÄ²Ù×÷ÏµÍ³Âð?? (·­ÒëÕßÈÏÎª: Èç¹ûÄãµÄ Linux ÄÚºË²»Ö§³Ö
PnP, »Ø´ðÃ»ÓÐ PnP ²Ù×÷ÏµÍ³, ÈÃ BIOS Íê³ÉËùÓÐµÄ PnP ÉèÖÃ¹¤×÷,
µ«Äã²»ÒªÊÔÍ¼È¥ÐÞ¸ÄÉè±¸µÄ×ÊÔ´, ÐÞ¸Ä×Ô¼ºµÄÅäÖÃÎÄ¼þ¼´¿É.)

¼ÙÈçÄãÔø¾­ÔËÐÐ isapnp ÅäÖÃ ISA-PnP
Éè±¸,µ«Ã¿´ÎÆô¶¯Ê±ÔËÐÐisapnpÊ§°Ü, ÄÇ÷á¼ÙÈçÄãÔÚÍ¬Ì¨»úÆ÷ÉÏÓÐ Windows 95/98
µÄ»°¿ÉÄÜ»á·¢Éú: µ±Ê¹ÓÃ Windows 95/98 Ê±, Windows Ò²Ðí»áÒÔ²»Í¬µÄ·½Ê½ÅäÖÃÄãµÄ
PnP¿¨, µ±Äã·µ»ØÊ¹ÓÃ Linux Ê±, ¿¨¾Í²»»áÕý³£¹¤×÷. 




\subsection{ÐÞ²¹ºËÐÄÈÃ Linux Ö§³Ö PnP \label{patch_kernel}}

ÓÐÒ»¸ö¾Þ´óµÄ²¹¶¡À´×öÕâÐ©. ÐÂµÄºËÐÄÊÇÎÈ¶¨µÄ²¢ÇÒ°üº¬ÎÄµµ: serial.txt
ËµÃ÷ÈçºÎ´¦Àí´®ÐÐ¿Ú. ËüÔÚ /proc Ä¿Â¼ÖÐÌá¹©"ÎÄ¼þ",
ËùÒÔÄã¿ÉÒÔÖªµÀÕâÐ©ÊÇÈçºÎ½øÐÐµÄ²¢ÄÜÓÃ echo ÃüÁîÀ´ÉèÖÃÅäÖÃ.
Ò»¸öÎÊÌâÊÇÐí¶àÇý¶¯³ÌÐò²»ÖªµÀÕâÐ©, Äã»¹ÐèÒªÊ¹ÓÃ´«Í³µÄÅäÖÃÎÄ¼þ, µÈ. ÈçºÎÅäÖÃ,
Çë¿´ \nameurl{http://lucifer.hemmet.s-hem.chalmers.se/~dwh}{}




\subsection{PnP Èí¼þºÍÎÄµµ}

\begin{itemize}
\item  ¿´ \nameurl{http://www.redhat.com/linux-info/pnp/}{} ¹ØÓÚ PnP µÄÈí¼þºÍÎÄµµ.
\item  ¿´ \nameurl{http://www.microsoft.com/hwdev/respec/pnpspecs.htm}{} ¹ØÓÚ PnP µÄÌØÐÔ.
\end{itemize}





\section{¸½Â¼}


\subsection{µØÖ· \label{addresses_}}

ÓÐÈýÀàµØÖ·: Ö÷ÄÚ´æµØÖ·, I/O µØÖ·ºÍÅäÖÃµØÖ·(½öÏÞÓÚ PCI ×ÜÏß).
"µØÖ·"ÔÚ±¾ÎÄµµÖÐÓÐÊ±±íÊ¾Ò»¸öÁ¬ÐøµÄµØÖ··¶Î§. ÒòÎªµØÖ·ÊÇÒÔ×Ö½Ú·½Ê½¸ø³öµÄ,
Ò»¸öµ¥Ò»µØÖ·Ö»°üº¬Ò»¸ö×Ö½Ú, µ« I/O(ºÍÖ÷ÄÚ´æ)µØÖ·°üº¬µÄ±ÈÕâ¶à.
µ±·ÖÅä¸øÉè±¸µÄµØÖ·½Ï¶àÊ±, ³£ÓÃÒ»¸öµØÖ·À´±íÊ¾I/OÉè±¸µÄÈ«²¿Á¬ÐøµØÖ··¶Î§. Èç:
¶ÔÓÚ´®ÐÐ¿Ú(Ò»¸ö I/O Éè±¸)Ö»¸ø³öËüÕ¼ÓÃµÄ°Ë¸öµØÖ·µÄÆðÊ¼µØÖ·,
ÒòÎª´ó¼Ò¶¼ÖªµÀ´ËÉè±¸ÓÃ°Ë¸ö×Ö½ÚµÄµØÖ·. ÆðÊ¼µØÖ·½Ð"»ù±¾µØÖ·". (·­ÒëÕß:
ÉÏÃæ·­ÒëµÄ¶«Î÷ÎÒ»ØÍ·¿´¿´¶¼²»Ê®·ÖÃ÷ÁË, ¸ø´ó¼Ò¾Ù¸öÀý×Ó°É.
ÎÒÃÇËµÄ³¸ö´®¿ÚµÄµØÖ·Îª 3f8, ÆäÊµÊÇËµËüµÄµØÖ·ÊÇ´Ó 3f8 ¿ªÊ¼µÄ°Ë¸öµØÖ·,
ÒòÎªÄ¬ÈÏµÄÉè±¸µØÖ·¡õÎ§ÊÇ°Ë¸öµØÖ·.)

·ÃÎÊI/OºÍ(Ö÷ÄÚ´æ)µØÖ·¿Õ¼äÊ¹ÓÃµÄÊÇÏàÍ¬µÄÎïÀíµØÖ·×ÜÏß(ÔÚ PC »úÖÐ, ËüÃÇµÄµØÖ·×ÜÏßÔÚÓ²¼þÉÏÊÇ¹²ÏíµÄ).
ÄÇ÷áÉè±¸ÈçºÎÖªµÀµØÖ·×ÜÏßÉÏµÄÊý¾Ý±íÊ¾µÄÊÇ I/O µØÖ·»¹ÊÇÄÚ´æµØÖ·ÄØ? ÆäÊµ,
ÔÚ×ÜÏßÉÏÓÐËÄ¸ö×¨ÓÃÁ¬ÏßÀ´Çø·ÖµØÖ·Êý¾ÝµÄº¬Òå. ¼ÙÈçÕâËÄ¸öÁ¬ÏßÖÐµÄÄ³¸öÆð×÷ÓÃ,
¾Í±íÊ¾ CPU Ïë·ÃÎÊ I/O µØÖ·, ÄÇ÷áÄÚ´æ¾Í»áºöÂÔ×ÜÏßÉÏµÄµØÖ·ÐÅÏ¢.
ÆäËüÈý¸öÁ¬ÏßÀàËÆÓÃ·¨. 

Í¨³£, ´ó¶àÊý I/O Éè±¸½öÊ¹ÓÃ I/O ´æ´¢Æ÷Óë CPU Í¨ÐÅ. ÀýÈç, ´®ÐÐ¿Ú¾ÍÊÇÕâÑù.
Éè±¸Çý¶¯³ÌÐò´Ó I/O µØÖ·ÖÐ¶ÁÐ´Êý¾Ý²¢ÇÒÍ¨³£Çé¿öÏÂ°ÑÊý¾Ý·Åµ½Ö÷ÄÚ´æ.
¿ìÒ»µãµÄ·½·¨ÊÇÉè±¸°ÑÊý¾ÝÖ±½ÓËÍµ½Ö÷ÄÚ´æ.
ÕâÑù×öµÄÒ»ÖÖ·½·¨ÊÇÊ¹ÓÃ \ref{dma_} {(DMA Í¨µÀ)}.
ÁíÒ»ÖÖ·½·¨ÊÇÔÚÖ÷ÄÚ´æÖÐ·ÖÅäÒ»¶¨¿Õ¼ä¸øÉè±¸.
ÕâÖÖ·½·¨²»Ðè½èÖú DMA ±ã¿ÉÒÔÖ±½Ó¶ÁÐ´Ö÷ÄÚ´æ. ÕâÑùµÄÉè±¸Í¨³£ÓÐ
I/O µØÖ·ºÍÖ÷ÄÚ´æµØÖ·.




\subsection{ÖÐ¶Ï -- ÏêÊö \label{interrupt_detail}}

ÖÐ¶ÏÓÃ¼ä½ÓµÄ·½Ê½´«ËÍÐÅÏ¢.
ÖÐ¶ÏÐÅºÅ(ÏßÂ·ÉÏµÄÒ»¸öµçÆ½)¸æËßÖÐ¶Ï¿ØÖÆÆ÷Ò»¸öÌØ¶¨µÄÉè±¸ÓÐ»°ÒªËµ.
ÖÐ¶Ï¿ØÖÆÆ÷ÔÙÍ¨Öª CPU. CPU »áÆô¶¯"ÖÐ¶Ï·þÎñÀý³Ì"À´´¦Àí.
"Àý³Ì"»áÊÔÍ¼ÕÒ³ö·¢ÉúÊ²÷áÁËÊÂÇé²¢´¦ÀíÏóÐèÒª´«ÊäµÈÎÊÌâ.
"Àý³Ì"ÄÜÈÝÒ×µÄÕÒ³ö·¢ÉúÊ²÷áÁËÊÂÇé, ÒòÎªÇý¶¯³ÌÐòÖªµÀÉè±¸µÄ¼Ä´æÆ÷µØÖ·.
ÕâÐ©¼Ä´æÆ÷°üº¬¹ØÓÚÉè±¸µÄÐÅÏ¢. Èí¼þ¶ÁÕâÐ©¼Ä´æÆ÷ÖÐµÄÄÚÈÝ²¢·ÖÎöËüÃÇ,
ÕÒ³ö·¢ÉúÁËÊ²÷á, ²¢²ÉÈ¡ÊÊµ±µÄÐÐ¶¯.




\subsection{Isolation \label{isolation_}}

½öÓÃÓÚ ISA ×ÜÏß. Isolation ÊÇ¸ø ISA ×ÜÏßÉÏµÄ PnP Éè±¸·ÖÅä¾ä±ú(id ºÅ)µÄ¸´ÔÓµÄ·½·¨.
¾¡¹ÜÓÐ¸üÓÐÐ§µÄ·½·¨(Ò²¸ü¸´ÔÓ)À´×öÕâ¼þÊÂ, µ«ÓÐÐ©ÈËÈÏÎª¼òµ¥Ò»µãºÃ.
Ö»ÓÐÒ»¸ö¿ÉÒÔÐ´ËùÓÐ PnP Éè±¸µÄÐ´µØÖ·,
ËùÒÔÐ´Õâ¸öµØÖ·¾Í¿ÉÒÔ¸æËßËùÓÐÕýÔÚÕìÌýµÄPnPÉè±¸.
Õâ¸öÐ´µØÖ·ÓÃÓÚÏò¸÷¸ö PnP Éè±¸ËÍÒ»¸öÎ¨Ò»µÄ¾ä±ú.
·ÖÅä¾ä±úÒªÇó¾ä±úËÍµ½¹«ÓÃµØÖ·Ê±Ö»ÓÐÒ»¸öÉè±¸ÔÚÕìÌý. isolation ÓÐÐ©ÏñÒ»¸ö"ÓÎÏ·".
ÓÃÒ»¸ö¹«ÓÃ×ÜÏßÁ¬ÏßÁ¬½ÓËùÓÐ PnP Éè±¸ºÍ isolation ³ÌÐò. 

"ÓÎÏ·"µÄÊ×´ÎÑ­»·, ËùÓÐµÄ PnP Éè±¸¼àÌý×ÜÏßµÄÍ¬Ê±²¢Ïò×ÜÏßÉÏ·¢ËÍÊý¾ÝÎ»Á÷.
Êý¾ÝÎ»²»ÊÇ1¾ÍÊÇ0. Ã¿¸ö PnP Éè±¸·¢ËÍ×Ô¼ºµÄ±àºÅ, ´Ó¸ßÎ»¿ªÊ¼, Ò»Î»½ÓÒ»Î».
¼ÙÈçÒ»¸öÉè±¸·¢ËÍÒ»¸ö1, 1»á±»ÆäËüËùÓÐµÄÉè±¸Ìýµ½.
¼ÙÈçËùÓÐµÄÉè±¸·¢ËÍ 0 ÄÇ÷á×ÜÏßÉÏ¾ÍÊ²÷áÒ²Ìý²»µ½. ÔÚÊ×´ÎÑ­»·µÄ×îáá,
³ýÁË×î¸ß±àºÅµÄÉè±¸ÍâÆäËüÉè±¸¶¼±»ÅÅ³ýµôÁË.(ËùÓÐµÄ±àºÅ³¤¶È¶¼Ò»Ñù.)

Ê×ÏÈ¿¼ÂÇµÄÊÇ×î¸ßÎ». ¼ÙÈçÒ»¸ö PnP Éè±¸·¢ËÍ 0, ¿É¼àÌýµ½µÄÊÇ 1, ¾Í±íÊ¾ÓÐ¸ü¸ß±àºÅµÄ
PnP Éè±¸´æÔÚ,
Ëü½«ÁÙÊ±ÍË³öÑ­»·²»ÔÙÕìÌýÖ±µ½´ËÑ­»·½áÊø(µ±×î´ó±àºÅÉè±¸±»¸³ÓèÒ»¸ö¾ä±úÊ±).
ÏÖÔÚ±£ÁôÏÂÀ´µÄÉè±¸ÓÐÏàÍ¬µÄÇ°µ¼Î»(Ò»¸ö 1),
ÎÒÃÇÔÚÎ´À´µÄ´¦ÀíÖÐ°ÑÇ°µ¼Î»È¥µôÖ»¿¼ÂÇÊ£âÅµÄ²¿·Ö.
ÖØÐÂ¿ªÊ¼Ñ­»·Ö±µ½È«²¿±àºÅ(ËùÓÐÉè±¸)¶¼±»´¦Àí(¶¼ÊÇ 0 µÄÇé¿ö¿´ÏÂÃæ).

¼ÙÈçÇ°µ¼Î»¶¼ÊÇ 0 »á·¢ÉúÊ²÷á? ËùÓÐµÄÉè±¸ÁôÔÚÓÎÏ·ÖÐ. 0 »á±»Ïó 1 Ò»ÑùÆÁ±Îµô,
¿ªÊ¼ÏÂÒ»ÂÖÑ­»·.

ÔÚÑ­»·½áÊøÊ±Ö»ÓÐ×î¸ß±àºÅµÄ PnP Éè±¸»á±£ÁôÏÂÀ´. Ëü»áµÃµ½Ò»¸ö¾ä±ú²¢ÍË³öÓÎÏ·.
ÉÏ´ÎÑ­»·ÖÐ±»ÌÔÌ­³ö¾ÖµÄÉè±¸»áÔÙ´Î½øÈëÓÎÏ·¿ªÊ¼Ò»¸öÐÂµÄÑ­»·.
Ö±µ½ËùÓÐÉè±¸¶¼ÓÐÒ»¸ö¾ä±ú. ÕâÑù×öÊÇºÜ¼òµ¥µÄ.

Éè±¸ÓÐÁË¾ä±ú, ¾ÍÓÐÁËÏò PnP Éè±¸·¢ËÍºÍ¶ÁÈ¡ÅäÖÃÐÅÏ¢µÄµØÖ·.
ÐèÒª×¢ÒâµÄÊÇÕâÐ©¾ä±úÖ»ÓÃÓÚÅäÖÃ PnP Éè±¸²»ÄÜÓÃÓÚÕý³£µÄÍ¨ÐÅ. µ±»úÆ÷Æô¶¯áá,
ËùÓÐµÄ¾ä±ú¶¼»á¶ªÊ§, ËùÒÔÃ¿´ÎÄãÆô¶¯»úÆ÷ BIOS ¶¼»á×öÒ»´ÎÕâÑùµÄ¹¤×÷.



\end{document}
