Annotation of htdocs/docs/kernel/programming.html, revision 1.82

1.69      nia         1: <!DOCTYPE html>
1.79      martin      2: <html lang="en">
1.1       dsieger     3: <head>
1.79      martin      4: <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
1.1       dsieger     5: <meta name="generator" content="Website XSL Stylesheet V2.6.0">
                      6: <link rel="home" href="../../." title="Welcome to The NetBSD Project: Of course it runs NetBSD.">
                      7: <link rel="up" href="../../docs/kernel/." title="NetBSD Documentation: Kernel">
                      8: <link rel="previous" href="../../docs/kernel/pseudo/." title="NetBSD Documentation: Writing a pseudo device">
                      9: <link rel="next" href="../../docs/kernel/uvm.html" title="NetBSD Documentation: UVM, the new Virtual Memory system">
                     10: <link rel="first" href="../../docs/kernel/lazyfpu.html" title="NetBSD Documentation: How lazy FPU context switch works">
                     11: <link rel="last" href="../../docs/kernel/elf-notes.html" title="NetBSD Documentation: Vendor-specific ELF Note Elements">
1.10      dsieger    12: <link rel="stylesheet" href="../../global.css" type="text/css">
1.58      maya       13: <link rel="stylesheet" href="../../donations/thermo/fundraiser.css" type="text/css">
1.1       dsieger    14: 
                     15:     
                     16:     
                     17:     <title>NetBSD Documentation: Kernel Programming FAQ</title>
1.78      andvar     18:   <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
                     19: </head>
1.80      andvar     20: <body class="website"><div class="webpage" id="docs-kernel-programming">
                     21: <div id="top"><a href="#mainContent" id="skiplink" tabindex="1">Skip to main content.</a></div>
1.59      maya       22: <input id="hamburger" type="checkbox"><label class="menuicon" for="hamburger"><span></span><span></span><span></span></label><div id="navBar" role="navigation">
1.34      maya       23: <div id="centralHeader"><div id="logo">
1.60      maya       24: <a href="../../"><img id="projectLogo" alt="" height="120" src="../../images/NetBSD-smaller-tb.png"></a><a href="/"><div id="fundraiser">
1.58      maya       25: <br><div id="fundraiser-amount"><div id="fundraiser-raised"></div></div>
                     26: </div></a>
1.34      maya       27: </div></div>
1.6       dsieger    28: <span class="doNotDisplay">
                     29:          Navigation:
1.17      jym        30:        </span><ul>
                     31: <li>
                     32: <a href="../../">
1.61      maya       33:          Home</a><ul>
1.17      jym        34: <li><a href="../../changes/">
                     35:            Recent changes</a></li>
1.37      maya       36: <li><a href="//blog.NetBSD.org/">
1.17      jym        37:            NetBSD blog</a></li>
1.56      maya       38: <li><a href="../../gallery/presentations/">
                     39:            Presentations</a></li>
1.17      jym        40: </ul>
                     41: </li>
                     42: <li>
                     43: <a href="../../about/">
                     44:          About</a><ul>
1.45      maya       45: <li><a href="../../people/developers.html">
1.61      maya       46:            Developers</a></li>
1.17      jym        47: <li><a href="../../gallery/">
1.53      leot       48:            Gallery</a></li>
1.61      maya       49: <li><a href="//wiki.NetBSD.org/ports/">
                     50:            Ports</a></li>
1.68      nia        51: <li><a href="//www.pkgsrc.org/">
1.61      maya       52:            Packages</a></li>
1.17      jym        53: </ul>
                     54: </li>
                     55: <li>
                     56: <a href="../../docs/">
                     57:          Documentation</a><ul>
                     58: <li><a href="../../docs/misc/index.html">
                     59:            FAQ &amp; HOWTOs</a></li>
                     60: <li><a href="../../docs/guide/en/">
                     61:            The Guide</a></li>
1.65      nia        62: <li><a href="//man.NetBSD.org/">
1.17      jym        63:            Manual pages</a></li>
1.37      maya       64: <li><a href="//wiki.NetBSD.org/">
1.17      jym        65:            Wiki</a></li>
                     66: </ul>
                     67: </li>
                     68: <li>
                     69: <a href="../../support/">
                     70:          Support</a><ul>
1.62      leot       71: <li><a href="/community/">
1.61      maya       72:            Community</a></li>
1.62      leot       73: <li><a href="/mailinglists/">
                     74:            Mailing lists</a></li>
1.17      jym        75: <li><a href="../../support/send-pr.html">
1.61      maya       76:            Bug reports</a></li>
1.17      jym        77: <li><a href="../../support/security/">
                     78:            Security</a></li>
                     79: </ul>
                     80: </li>
                     81: <li>
                     82: <a href="../../developers/">
                     83:          Developers</a><ul>
1.40      maya       84: <li><a href="http://cvsweb.NetBSD.org/">
1.61      maya       85:            CVSWeb</a></li>
                     86: <li><a href="//anonhg.NetBSD.org/">
                     87:            Mercurial</a></li>
1.37      maya       88: <li><a href="//nxr.NetBSD.org/">
1.17      jym        89:            Cross-reference</a></li>
1.37      maya       90: <li><a href="//releng.NetBSD.org/">
1.17      jym        91:            Release engineering</a></li>
1.37      maya       92: <li><a href="//wiki.NetBSD.org/projects/">
1.17      jym        93:            Projects list</a></li>
                     94: </ul>
                     95: </li>
                     96: </ul>
1.3       dsieger    97: </div>
1.49      maya       98: <div id="content"><div id="mainContent" class="fullWidth"><div class="rowOfBoxes">
1.3       dsieger    99: <h1>NetBSD Documentation: Kernel Programming FAQ</h1>
1.80      andvar    100: <h3 class="title">Misc</h3>
1.1       dsieger   101: <ul>
                    102: <li><a href="#knf">What is KNF</a></li>
                    103: <li><a href="#packed-attribute">Using the `packed' attribute</a></li>
                    104: <li><a href="#printf">Using printf() for debugging</a></li>
                    105: <li><a href="#forcing-ddb">Forcing code to enter DDB</a></li>
                    106: <li><a href="#adding_a_new_driver">Adding a new driver to the kernel</a></li>
                    107: <li><a href="#autoconf">How does all this autoconf stuff work?</a></li>
                    108: <li><a href="#adding_a_system_call">Adding a system call</a></li>
                    109: <li><a href="#adding_a_sysctl">Adding a sysctl</a></li>
                    110: <li><a href="#mmap_in_pseudo-device">How to implement mmap(2) in a pseudo-device</a></li>
                    111: <li><a href="#accessing_a_kernel_structure_from_userland">Accessing a kernel structure from userland</a></li>
                    112: <li><a href="#sample_driver">Is there a simple PCI driver I can use as an example?</a></li>
                    113: <li><a href="#other-related-links">Other related links</a></li>
                    114: </ul>
                    115: <hr>
                    116: <h3 class="title">Misc</h3>
1.80      andvar    117:        <h4 class="title" id="knf">What is KNF</h4>
1.1       dsieger   118: 
                    119:        <p>KNF stands for "Kernel Normal Form" - it's a C coding
                    120:          style documented in
                    121:          <code class="filename">/usr/share/misc/style</code>, which is
                    122:          included in the source tree as <a href="http://cvsweb.NetBSD.org/bsdweb.cgi/src/share/misc/style?rev=HEAD&amp;content-type=text/x-cvsweb-markup" target="_top"><code class="filename">src/share/misc/style</code></a>.</p>
                    123:       
1.80      andvar    124:        <h4 class="title" id="packed-attribute">Using the `packed' attribute</h4>
1.1       dsieger   125:        
                    126:        <p>Always use the <code class="code">`packed'</code> attribute in
                    127:          structures which describe wire protocol data formats.</p>
                    128:       
1.80      andvar    129:        <h4 class="title" id="printf">Using <code class="code">printf()</code> for debugging</h4>
1.1       dsieger   130: 
                    131:        <p>Probably the simplest way of generating debugging
                    132:          information from a kernel driver is to use
                    133:          <code class="code">printf()</code>. The kernel printf will send output to
                    134:          the console, so beware of generating too much output and
                    135:          making the system unusable.</p>
                    136:       
1.80      andvar    137:        <h4 class="title" id="forcing-ddb">Forcing code to enter DDB</h4>
1.1       dsieger   138: 
                    139:        <p>Ensure your kernel config file contains
                    140:          '<code class="code">options DDB</code>', the file has
                    141:          '<code class="code">#include "opt_ddb.h"</code>', then use
                    142:          '<code class="code">Debugger()</code>'.</p>
                    143:       
1.80      andvar    144:        <h4 class="title" id="adding_a_new_driver">Adding a new driver to the kernel</h4>
1.1       dsieger   145: 
                    146:        <p>Every driver needs at least:
                    147:          </p>
1.23      tron      148: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.15      spz       149: <li class="listitem">
1.1       dsieger   150: <code class="code"><span class="emphasis"><em>xxx</em></span>probe()</code> (
                    151:              during which NetBSD will attempt to determine if the
                    152:              device is present)</li>
1.15      spz       153: <li class="listitem">
1.1       dsieger   154: <code class="code"><span class="emphasis"><em>xxx</em></span>attach()</code>
                    155:              routine which will configure and attach the
                    156:              device.</li>
                    157: </ul></div>
                    158: <p>
                    159:        </p>
                    160: 
1.82    ! yurix     161:        <p>Once probe and attach routines have been written, register them using
        !           162:          CFATTACH_DECL_NEW. See <a href="//man.NetBSD.org/NetBSD-10.1/driver.9">driver(9)</a> for more details.
        !           163:        </p>
1.1       dsieger   164:        
                    165:        <p>There are two tables:
                    166:          </p>
1.23      tron      167: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.15      spz       168: <li class="listitem">
1.1       dsieger   169: <code class="code">cdevsw</code> for character devices.</li>
1.15      spz       170: <li class="listitem">
1.1       dsieger   171: <code class="code">bdevsw</code> for block devices (for those
                    172:              that also perform "block" I/O and use a strategy
                    173:              routine).</li>
                    174: </ul></div>
                    175: 
                    176:        <p>Most entries will be of the form
                    177:          <code class="code">cdev_<span class="emphasis"><em>xxx</em></span>_init()</code>, which
                    178:          is a macro handling prototyping of the standard Unix
                    179:          device switch routines.</p>
                    180: 
                    181:        <p>The probe/attach routines are called at boot time.  The
                    182:          <code class="code">open()</code>, <code class="code">close()</code>,
                    183:          <code class="code">read()</code>, and <code class="code">write()</code> routines are
                    184:          called when you open up the device special file who's major
                    185:          number corresponds to the index into that table.  For
                    186:          example, if you open up a device who's major number is 18,
                    187:          the "open" routine for device number 18 in
                    188:          <code class="code">cdevsw[]/bdevsw</code> will be called.</p>
                    189: 
                    190:        <p>Most drivers are split between bus specific attach code, and
                    191:          a machine independent core. As an example, the driver for
                    192:          the PCI lance ethernet chip has entries in the following files:
                    193: 
                    194:          </p>
1.23      tron      195: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.15      spz       196: <li class="listitem">
1.1       dsieger   197: <a href="http://cvsweb.NetBSD.org/bsdweb.cgi/src/sys/dev/pci/files.pci?rev=HEAD&amp;content-type=text/x-cvsweb-markup" target="_top"><code class="filename">src/sys/dev/pci/files.pci</code></a>
                    198:              - attach information (look for 'le at pci').</li>
1.15      spz       199: <li class="listitem">
1.1       dsieger   200: <a href="http://cvsweb.NetBSD.org/bsdweb.cgi/src/sys/dev/pci/if_le_pci.c?rev=HEAD&amp;content-type=text/x-cvsweb-markup" target="_top"><code class="filename">src/sys/dev/pci/if_le_pci.c</code></a> 
                    201:              - PCI bus attach code for the driver.</li>
                    202: </ul></div>
                    203: <p>
                    204:        </p>
                    205:        
                    206:        <p>
                    207:          </p>
1.23      tron      208: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.15      spz       209: <li class="listitem">
1.1       dsieger   210: <a href="http://cvsweb.NetBSD.org/bsdweb.cgi/src/sys/conf/files?rev=HEAD&amp;content-type=text/x-cvsweb-markup" target="_top"><code class="filename">src/sys/conf/files</code></a>
                    211:              - MI core attach information (look for 'le:').</li>
1.15      spz       212: <li class="listitem">
1.1       dsieger   213: <a href="http://cvsweb.NetBSD.org/bsdweb.cgi/src/sys/dev/ic/am7990.c?rev=HEAD&amp;content-type=text/x-cvsweb-markup" target="_top"><code class="filename">src/sys/dev/ic/am7990.c</code></a>
                    214:              - MI driver 24bit access code.</li>
1.15      spz       215: <li class="listitem">
1.1       dsieger   216: <a href="http://cvsweb.NetBSD.org/bsdweb.cgi/src/sys/dev/ic/am79900.c?rev=HEAD&amp;content-type=text/x-cvsweb-markup" target="_top"><code class="filename">src/sys/dev/ic/am79900.c</code></a>
                    217:              - MI driver 32bit access code.</li>
1.15      spz       218: <li class="listitem">
1.1       dsieger   219: <a href="http://cvsweb.NetBSD.org/bsdweb.cgi/src/sys/dev/ic/lance.c?rev=HEAD&amp;content-type=text/x-cvsweb-markup" target="_top"><code class="filename">src/sys/dev/ic/lance.c</code></a>
                    220:              - MI core driver code.</li>
                    221: </ul></div>
                    222: <p>
                    223:        </p>
                    224: 
1.12      hubertf   225:        <p>See also <a class="ulink" href="#autoconf" target="_top">the autoconf explanation</a>.</p>
1.1       dsieger   226:       
1.80      andvar    227:        <h4 class="title" id="autoconf">How does all this autoconf stuff work?</h4>
1.1       dsieger   228:        
                    229:        <p>The autoconf machinery is quite simple once you figure
                    230:          out the way it works. If you want to ignore the exact
                    231:          details of how the device probe tree is built and walked
                    232:            on runtime, the bits needed for each individual
1.79      martin    233:          <span class="quote">“<span class="quote">leaf</span>”</span> driver are like this:
1.1       dsieger   234:          
                    235:          </p>
1.15      spz       236: <div class="orderedlist"><ol class="orderedlist" type="1">
                    237: <li class="listitem">each driver specifies a structure holding
1.1       dsieger   238:              three things - size of its private structure, probe
                    239:              function and attach function; this is compiled in and
                    240:              used in runtime - example:
                    241:              <pre class="programlisting">
                    242: struct cfattach foo_baz_ca = {
                    243:     sizeof(struct foo_baz_softc), foo_baz_match, foo_baz_attach
                    244: };</pre>
                    245: </li>
1.15      spz       246: <li class="listitem">on kernel startup, once the time comes to
1.1       dsieger   247:              attach the device, autoconf code calls device's
                    248:              probe routine and passes it pointer to parent
                    249:              (<code class="code">struct device *parent</code>), pointer
                    250:              to attach tag structure (<code class="code">void *aux</code>),
                    251:              and appropriate   autoconf node (<code class="code">struct cfdata
                    252:                *cf</code>). The driver is expected to find out if
                    253:              it's where it's supposed to be (commonly, the location
                    254:              and configuration information is passed by the attach
                    255:              tag). If yes, the probe routine should return 1. If
                    256:              device is not there, probe routine has to return 0.
                    257:              <span class="bold"><strong>NO STATE SHOULD BE KEPT</strong></span>
                    258:              in either case.</li>
1.15      spz       259: <li class="listitem">if probe returned success, autoconf allocates
1.1       dsieger   260:              chunk of memory sized as specified in device's *_ca
                    261:              and calls its attach routine, passing it pointer to
                    262:              parent (<code class="code">struct device *parent</code>), 
                    263:              pointer to the freshly allocated memory
                    264:              (<code class="code">struct device *self</code>) and the attach tag
                    265:              (<code class="code">void *aux</code>). Driver is expected to find
                    266:              out exact ports and memory, allocate resources and
                    267:              initialize its internal structure
                    268:              accordingly. Preferably, all driver instance specific
                    269:              information should be kept in the allocated
                    270:              memory.</li>
                    271: </ol></div>
                    272: <p>
                    273:        </p>
                    274:        
                    275:        <p>Example: Let's have a PCI ethernet device 'baz',
                    276:          kernel config chunk looks like this:
                    277:          </p>
                    278: <pre class="programlisting">
                    279: pci*    at mainbus?
                    280: baz*    at pci? dev ? function ?</pre>
                    281: <p>
                    282: 
                    283:          At runtime, autoconf iterates over all physical devices
                    284:          present on machine's PCI bus. For each physical device, it
                    285:          iterates over all devices registered in kernel to be on
                    286:          pci bus, and calls drivers' probe routine. If any probe
                    287:          routine claims the device by returning 1, autoconf stops
                    288:          iterating and does the job described under 3). Once the
                    289:          attach function returns, autoconf continues with next
                    290:          physical device.</p>
                    291:        
1.12      hubertf   292:        <p>See also <a class="ulink" href="#adding_a_new_driver" target="_top">Adding a new driver</a>.</p>
1.1       dsieger   293:       
1.80      andvar    294:        <h4 class="title" id="adding_a_system_call">Adding a system call</h4>
1.1       dsieger   295:        
                    296:        <p>Add an entry in <code class="code">syscalls.master</code>, and add
                    297:          the syscall stub to the appropriate place in 
                    298:          <code class="code"><a href="http://cvsweb.NetBSD.org/bsdweb.cgi/src/lib/libc/sys/Makefile.inc?rev=HEAD&amp;content-type=text/x-cvsweb-markup" target="_top"><code class="filename">src/lib/libc/sys/Makefile.inc</code></a></code>.</p>
1.12      hubertf   299:        <p>See the <a class="ulink" href="../internals/en/chap-processes.html#syscall_howto" target="_top">
                    300:             HOWTO</a> and related documentation in the <a class="ulink" href="../internals/en/" target="_top">
1.1       dsieger   301:            NetBSD Internals Guide</a> for more information.
                    302:        </p>
                    303:       
1.80      andvar    304:        <h4 class="title" id="adding_a_sysctl">Adding a sysctl</h4>
1.1       dsieger   305:        
1.12      hubertf   306:        <p>See a <a class="ulink" href="http://mail-index.NetBSD.org/tech-kern/2001/06/24/0000.html" target="_top">posting</a>
                    307:          answering this question on  <a class="ulink" href="http://mail-index.NetBSD.org/tech-kern/" target="_top">tech-kern</a>.</p>
1.1       dsieger   308:        
                    309:        <p>Note that NetBSD 1.6 and up has a special
1.79      martin    310:          <span class="quote">“<span class="quote">vendor</span>”</span> sysctl category that is reserved for vendor
1.76      martin    311:          specific entries. See <a href="//man.NetBSD.org/NetBSD-10.1/sysctl.8">sysctl(8)</a> for more
1.1       dsieger   312:          information.</p>
                    313:       
1.80      andvar    314:        <h4 class="title" id="mmap_in_pseudo-device">How to implement <a href="//man.NetBSD.org/NetBSD-10.1/mmap.2">mmap(2)</a> in a pseudo-device</h4>
1.1       dsieger   315:        
                    316:        <p>Your device is most likely a character device, so
                    317:          you will be using the device pager (the VM system hides
                    318:          all of this from you, don't worry).</p>
                    319:        
                    320:        <p>The first thing you need to do is pick some
                    321:          arbitrary offsets for your mmap interface.  Something
                    322:          like "mmap offset 0-M gives object A, N-O gives object
                    323:          B", etc.</p>
                    324:        
                    325:        <p>After that, your mmap routine would look something
                    326:          like this:
                    327:          </p>
                    328: <pre class="programlisting">
                    329: int
                    330: foommap(dev_t dev, int off, int prot)
                    331: {
                    332: 
                    333:         if (off &amp; PAGE_MASK)
                    334:                 panic("foommap");
                    335: 
                    336:         if ((u_int)off &gt;= FOO_REGION1_MMAP_OFFSET &amp;&amp;
                    337:             (u_int)off &lt; (FOO_REGION1_MMAP_OFFSET + FOO_REGION1_SIZE))
                    338:                 return (atop(FOO_REGION1_ADDR + ((u_int)off -
                    339:                     FOO_REGION1_MMAP_OFFSET)));
                    340: 
                    341:         if ((u_int)off &gt;= FOO_REGION2_MMAP_OFFSET &amp;&amp;
                    342:             (u_int)off &lt; (FOO_REGION2_MMAP_OFFSET + FOO_REGION2_SIZE))
                    343:                 return (atop(FOO_REGION1_ADDR + ((u_int)off -
                    344:                     FOO_REGION2_MMAP_OFFSET)));
                    345: 
                    346:         /* Page not found. */
                    347:         return (-1);
                    348: }</pre>
                    349: 
                    350:          <p>Now, this is slightly more complicated by the fact
                    351:            that you are going to be mmap'ing what are simply
                    352:            kernel memory objects (it is a pseudo-device after
                    353:            all).</p>
                    354:          
                    355:          <p>In order to make this work, you're going to want
                    356:            to make sure you allocate the memory objects to be
                    357:            mmap'd on page-aligned boundaries.  If you are
                    358:            allocating something &gt;= <code class="code">PAGE_SIZE</code> in
                    359:            size, this is guaranteed. Otherwise, you are going to
                    360:            have to use <code class="code">uvm_km_alloc()</code>, and round
                    361:            your allocation size up to page size.</p>
                    362:          
                    363:          <p>Then it would look a bit more like this:
                    364:            </p>
                    365: <pre class="programlisting">
                    366: int
                    367: foommap(dev_t dev, int off, int prot)
                    368: {
                    369:         paddr_t pa;
                    370: 
                    371:         if (off &amp; PAGE_MASK)
                    372:                 panic("foommap: offset not page aligned");
                    373: 
                    374:         if ((u_int)off &gt;= FOO_REGION1_MMAP_OFFSET &amp;&amp;
                    375:             (u_int)off &lt; (FOO_REGION1_MMAP_OFFSET + FOO_REGION1_SIZE)) {
                    376:                 if ((vaddr_t)foo_object1 &amp; PAGE_MASK)
                    377:                         panic("foommap: foo_object1 not page aligned");
                    378:                 if (pmap_extract(pmap_kernel(), foo_object1 +
                    379:                     (u_int)off - FOO_REGION1_MMAP_OFFSET, &amp;pa) == FALSE)
                    380:                         panic("foommap: foo_object1 page not mapped");
                    381:                 return (atop(pa));
                    382:         }
                    383: 
                    384:         if ((u_int)off &gt;= FOO_REGION2_MMAP_OFFSET &amp;&amp;
                    385:             (u_int)off &lt; (FOO_REGION2_MMAP_OFFSET + FOO_REGION2_SIZE)) {
                    386:                 if ((vaddr_t)foo_object2 &amp; PAGE_MASK)
                    387:                         panic("foommap: foo_object2 not page aligned");
                    388:                 if (pmap_extract(pmap_kernel(), foo_object2 +
                    389:                     (u_int)off - FOO_REGION2_MMAP_OFFSET, &amp;pa) == FALSE)
                    390:                         panic("foommap: foo_object2 page not mapped");
                    391:                 return (atop(pa));
                    392:         }
                    393: 
                    394:         /* Page not found. */
                    395:         return (-1);
                    396: }</pre>
                    397:       
1.80      andvar    398:        <h4 class="title" id="accessing_a_kernel_structure_from_userland">Accessing a kernel structure from userland</h4>
1.1       dsieger   399:        
                    400:        <p>The canonical example for this is:  <code class="code">
                    401:            <a href="http://cvsweb.NetBSD.org/bsdweb.cgi/src/usr.bin/vmstat/dkstats.c?rev=HEAD&amp;content-type=text/x-cvsweb-markup" target="_top"><code class="filename">src/usr.bin/vmstat/dkstats.c</code></a></code>
                    402:          , which reads disk statistics.</p>
                    403:       
1.80      andvar    404:        <h4 class="title" id="sample_driver">Is there a simple PCI driver I can use as an example?</h4>
1.1       dsieger   405:        <p>You can look at
                    406:          <code class="filename">sys/dev/pci/puc.c</code>, which is one of
                    407:          the simplest drivers. PUCs are devices with one or more
                    408:          serial or parallel ports on it, usually using standard
                    409:          chips (e.g. 16550 UART for serial). This driver just
                    410:          locates the I/O addresses of the registers of the serial or
                    411:          parallel controller and passes it to the serial or
                    412:          parallel driver.</p> 
                    413:       
1.80      andvar    414:        <h4 class="title" id="other-related-links">Other related links</h4>
1.1       dsieger   415:        
1.23      tron      416: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.15      spz       417: <li class="listitem">
1.76      martin    418: <a href="//man.NetBSD.org/NetBSD-10.1/driver.9">driver(9)</a> - NetBSD autoconfiguration
1.1       dsieger   419:            interface utilised by device drivers</li>
1.15      spz       420: <li class="listitem">
1.76      martin    421: <a href="//man.NetBSD.org/NetBSD-10.1/autoconf.9">autoconf(9)</a> - General description on the
1.1       dsieger   422:            NetBSD autoconfiguration framework</li>
1.15      spz       423: <li class="listitem">
1.76      martin    424: <a href="//man.NetBSD.org/NetBSD-10.1/config.9">config(9)</a> - The autoconfiguration
1.1       dsieger   425:            framework ``device definition'' language</li>
1.15      spz       426: <li class="listitem">
1.76      martin    427: <a href="//man.NetBSD.org/NetBSD-10.1/bus_dma.9">bus_dma(9)</a> - NetBSD's bus and machine
1.12      hubertf   428:            independent DMA framework, described in its own <a class="ulink" href="bus_dma.pdf" target="_top">paper</a> (64k, PDF)</li>
1.15      spz       429: <li class="listitem">
1.76      martin    430: <a href="//man.NetBSD.org/NetBSD-10.1/bus_space.9">bus_space(9)</a> - NetBSD's bus space
1.1       dsieger   431:            manipulation interface</li>
1.15      spz       432: <li class="listitem">
1.12      hubertf   433: <a class="ulink" href="scsidma.html" target="_top">How SCSI DMA
1.1       dsieger   434:              works</a> - by Tohru Nishimura</li>
1.15      spz       435: <li class="listitem">
1.12      hubertf   436: <a class="ulink" href="lazyfpu.html" target="_top">How lazy FPU context
1.1       dsieger   437:              switch works</a> - by Tohru Nishimura</li>
1.15      spz       438: <li class="listitem"><a class="ulink" href="converting-ethernet-drivers.html" target="_top">Converting ancient BSD Ethernet drivers to NetBSD-1.2D and later</a></li>
                    439: <li class="listitem"><a class="ulink" href="porting-freebsd-net.html" target="_top">Notes on porting FreeBSD network drivers to NetBSD</a></li>
1.1       dsieger   440: </ul></div>
1.79      martin    441:       <hr>Back to  <em><a href="./">NetBSD Documentation: Kernel</a></em>
1.3       dsieger   442: </div></div></div>
                    443: <div class="navfoot"></div>
1.80      andvar    444: <div id="footer"><div id="footerContent">
                    445: <span class="footfeed"><a href="//www.NetBSD.org/cgi-bin/feedback.cgi">
1.3       dsieger   446:          Contact</a> |
1.9       kano      447:       </span><span class="footcopy"><a href="../../about/disclaimer.html">
1.3       dsieger   448:       Disclaimer</a> |
                    449: 
1.81      leot      450:       <span class="copyright">Copyright © 1994-2026 The NetBSD Foundation, Inc. </span>ALL RIGHTS RESERVED.<br>NetBSD<sup>®</sup> is a registered trademark of The NetBSD
1.80      andvar    451:        Foundation, Inc.</span>
                    452: </div></div>
1.1       dsieger   453: </div></body>
                    454: </html>

CVSweb <webmaster@jp.NetBSD.org>