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

1.69      nia         1: <!DOCTYPE html>
1.79      martin      2: <html lang="en">
1.1       dsieger     3: <head>
1.83      maya        4: <meta 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.84      leot       84: <li><a href="//cvsweb.NetBSD.org/">
1.61      maya       85:            CVSWeb</a></li>
1.37      maya       86: <li><a href="//nxr.NetBSD.org/">
1.17      jym        87:            Cross-reference</a></li>
1.37      maya       88: <li><a href="//releng.NetBSD.org/">
1.17      jym        89:            Release engineering</a></li>
1.37      maya       90: <li><a href="//wiki.NetBSD.org/projects/">
1.17      jym        91:            Projects list</a></li>
                     92: </ul>
                     93: </li>
                     94: </ul>
1.3       dsieger    95: </div>
1.49      maya       96: <div id="content"><div id="mainContent" class="fullWidth"><div class="rowOfBoxes">
1.3       dsieger    97: <h1>NetBSD Documentation: Kernel Programming FAQ</h1>
1.80      andvar     98: <h3 class="title">Misc</h3>
1.1       dsieger    99: <ul>
                    100: <li><a href="#knf">What is KNF</a></li>
                    101: <li><a href="#packed-attribute">Using the `packed' attribute</a></li>
                    102: <li><a href="#printf">Using printf() for debugging</a></li>
                    103: <li><a href="#forcing-ddb">Forcing code to enter DDB</a></li>
                    104: <li><a href="#adding_a_new_driver">Adding a new driver to the kernel</a></li>
                    105: <li><a href="#autoconf">How does all this autoconf stuff work?</a></li>
                    106: <li><a href="#adding_a_system_call">Adding a system call</a></li>
                    107: <li><a href="#adding_a_sysctl">Adding a sysctl</a></li>
                    108: <li><a href="#mmap_in_pseudo-device">How to implement mmap(2) in a pseudo-device</a></li>
                    109: <li><a href="#accessing_a_kernel_structure_from_userland">Accessing a kernel structure from userland</a></li>
                    110: <li><a href="#sample_driver">Is there a simple PCI driver I can use as an example?</a></li>
                    111: <li><a href="#other-related-links">Other related links</a></li>
                    112: </ul>
                    113: <hr>
                    114: <h3 class="title">Misc</h3>
1.80      andvar    115:        <h4 class="title" id="knf">What is KNF</h4>
1.1       dsieger   116: 
                    117:        <p>KNF stands for "Kernel Normal Form" - it's a C coding
                    118:          style documented in
                    119:          <code class="filename">/usr/share/misc/style</code>, which is
1.84      leot      120:          included in the source tree as <a href="//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>
1.1       dsieger   121:       
1.80      andvar    122:        <h4 class="title" id="packed-attribute">Using the `packed' attribute</h4>
1.1       dsieger   123:        
                    124:        <p>Always use the <code class="code">`packed'</code> attribute in
                    125:          structures which describe wire protocol data formats.</p>
                    126:       
1.80      andvar    127:        <h4 class="title" id="printf">Using <code class="code">printf()</code> for debugging</h4>
1.1       dsieger   128: 
                    129:        <p>Probably the simplest way of generating debugging
                    130:          information from a kernel driver is to use
                    131:          <code class="code">printf()</code>. The kernel printf will send output to
                    132:          the console, so beware of generating too much output and
                    133:          making the system unusable.</p>
                    134:       
1.80      andvar    135:        <h4 class="title" id="forcing-ddb">Forcing code to enter DDB</h4>
1.1       dsieger   136: 
                    137:        <p>Ensure your kernel config file contains
                    138:          '<code class="code">options DDB</code>', the file has
                    139:          '<code class="code">#include "opt_ddb.h"</code>', then use
                    140:          '<code class="code">Debugger()</code>'.</p>
                    141:       
1.80      andvar    142:        <h4 class="title" id="adding_a_new_driver">Adding a new driver to the kernel</h4>
1.1       dsieger   143: 
                    144:        <p>Every driver needs at least:
                    145:          </p>
1.23      tron      146: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.15      spz       147: <li class="listitem">
1.1       dsieger   148: <code class="code"><span class="emphasis"><em>xxx</em></span>probe()</code> (
                    149:              during which NetBSD will attempt to determine if the
                    150:              device is present)</li>
1.15      spz       151: <li class="listitem">
1.1       dsieger   152: <code class="code"><span class="emphasis"><em>xxx</em></span>attach()</code>
                    153:              routine which will configure and attach the
                    154:              device.</li>
                    155: </ul></div>
                    156: <p>
                    157:        </p>
                    158: 
1.82      yurix     159:        <p>Once probe and attach routines have been written, register them using
1.86      martin    160:          CFATTACH_DECL_NEW. See <a href="//man.NetBSD.org/NetBSD-11.0/driver.9">driver(9)</a> for more details.
1.82      yurix     161:        </p>
1.1       dsieger   162:        
                    163:        <p>There are two tables:
                    164:          </p>
1.23      tron      165: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.15      spz       166: <li class="listitem">
1.1       dsieger   167: <code class="code">cdevsw</code> for character devices.</li>
1.15      spz       168: <li class="listitem">
1.1       dsieger   169: <code class="code">bdevsw</code> for block devices (for those
                    170:              that also perform "block" I/O and use a strategy
                    171:              routine).</li>
                    172: </ul></div>
                    173: 
                    174:        <p>Most entries will be of the form
                    175:          <code class="code">cdev_<span class="emphasis"><em>xxx</em></span>_init()</code>, which
                    176:          is a macro handling prototyping of the standard Unix
                    177:          device switch routines.</p>
                    178: 
                    179:        <p>The probe/attach routines are called at boot time.  The
                    180:          <code class="code">open()</code>, <code class="code">close()</code>,
                    181:          <code class="code">read()</code>, and <code class="code">write()</code> routines are
                    182:          called when you open up the device special file who's major
                    183:          number corresponds to the index into that table.  For
                    184:          example, if you open up a device who's major number is 18,
                    185:          the "open" routine for device number 18 in
                    186:          <code class="code">cdevsw[]/bdevsw</code> will be called.</p>
                    187: 
                    188:        <p>Most drivers are split between bus specific attach code, and
                    189:          a machine independent core. As an example, the driver for
                    190:          the PCI lance ethernet chip has entries in the following files:
                    191: 
                    192:          </p>
1.23      tron      193: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.15      spz       194: <li class="listitem">
1.84      leot      195: <a href="//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>
1.1       dsieger   196:              - attach information (look for 'le at pci').</li>
1.15      spz       197: <li class="listitem">
1.84      leot      198: <a href="//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> 
1.1       dsieger   199:              - PCI bus attach code for the driver.</li>
                    200: </ul></div>
                    201: <p>
                    202:        </p>
                    203:        
                    204:        <p>
                    205:          </p>
1.23      tron      206: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.15      spz       207: <li class="listitem">
1.84      leot      208: <a href="//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>
1.1       dsieger   209:              - MI core attach information (look for 'le:').</li>
1.15      spz       210: <li class="listitem">
1.84      leot      211: <a href="//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>
1.1       dsieger   212:              - MI driver 24bit access code.</li>
1.15      spz       213: <li class="listitem">
1.84      leot      214: <a href="//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>
1.1       dsieger   215:              - MI driver 32bit access code.</li>
1.15      spz       216: <li class="listitem">
1.84      leot      217: <a href="//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>
1.1       dsieger   218:              - MI core driver code.</li>
                    219: </ul></div>
                    220: <p>
                    221:        </p>
                    222: 
1.12      hubertf   223:        <p>See also <a class="ulink" href="#autoconf" target="_top">the autoconf explanation</a>.</p>
1.1       dsieger   224:       
1.80      andvar    225:        <h4 class="title" id="autoconf">How does all this autoconf stuff work?</h4>
1.1       dsieger   226:        
                    227:        <p>The autoconf machinery is quite simple once you figure
                    228:          out the way it works. If you want to ignore the exact
                    229:          details of how the device probe tree is built and walked
                    230:            on runtime, the bits needed for each individual
1.79      martin    231:          <span class="quote">“<span class="quote">leaf</span>”</span> driver are like this:
1.1       dsieger   232:          
                    233:          </p>
1.15      spz       234: <div class="orderedlist"><ol class="orderedlist" type="1">
                    235: <li class="listitem">each driver specifies a structure holding
1.1       dsieger   236:              three things - size of its private structure, probe
                    237:              function and attach function; this is compiled in and
                    238:              used in runtime - example:
                    239:              <pre class="programlisting">
                    240: struct cfattach foo_baz_ca = {
                    241:     sizeof(struct foo_baz_softc), foo_baz_match, foo_baz_attach
                    242: };</pre>
                    243: </li>
1.15      spz       244: <li class="listitem">on kernel startup, once the time comes to
1.1       dsieger   245:              attach the device, autoconf code calls device's
                    246:              probe routine and passes it pointer to parent
                    247:              (<code class="code">struct device *parent</code>), pointer
                    248:              to attach tag structure (<code class="code">void *aux</code>),
                    249:              and appropriate   autoconf node (<code class="code">struct cfdata
                    250:                *cf</code>). The driver is expected to find out if
                    251:              it's where it's supposed to be (commonly, the location
                    252:              and configuration information is passed by the attach
                    253:              tag). If yes, the probe routine should return 1. If
                    254:              device is not there, probe routine has to return 0.
                    255:              <span class="bold"><strong>NO STATE SHOULD BE KEPT</strong></span>
                    256:              in either case.</li>
1.15      spz       257: <li class="listitem">if probe returned success, autoconf allocates
1.1       dsieger   258:              chunk of memory sized as specified in device's *_ca
                    259:              and calls its attach routine, passing it pointer to
                    260:              parent (<code class="code">struct device *parent</code>), 
                    261:              pointer to the freshly allocated memory
                    262:              (<code class="code">struct device *self</code>) and the attach tag
                    263:              (<code class="code">void *aux</code>). Driver is expected to find
                    264:              out exact ports and memory, allocate resources and
                    265:              initialize its internal structure
                    266:              accordingly. Preferably, all driver instance specific
                    267:              information should be kept in the allocated
                    268:              memory.</li>
                    269: </ol></div>
                    270: <p>
                    271:        </p>
                    272:        
                    273:        <p>Example: Let's have a PCI ethernet device 'baz',
                    274:          kernel config chunk looks like this:
                    275:          </p>
                    276: <pre class="programlisting">
                    277: pci*    at mainbus?
                    278: baz*    at pci? dev ? function ?</pre>
                    279: <p>
                    280: 
                    281:          At runtime, autoconf iterates over all physical devices
                    282:          present on machine's PCI bus. For each physical device, it
                    283:          iterates over all devices registered in kernel to be on
                    284:          pci bus, and calls drivers' probe routine. If any probe
                    285:          routine claims the device by returning 1, autoconf stops
                    286:          iterating and does the job described under 3). Once the
                    287:          attach function returns, autoconf continues with next
                    288:          physical device.</p>
                    289:        
1.12      hubertf   290:        <p>See also <a class="ulink" href="#adding_a_new_driver" target="_top">Adding a new driver</a>.</p>
1.1       dsieger   291:       
1.80      andvar    292:        <h4 class="title" id="adding_a_system_call">Adding a system call</h4>
1.1       dsieger   293:        
                    294:        <p>Add an entry in <code class="code">syscalls.master</code>, and add
                    295:          the syscall stub to the appropriate place in 
1.84      leot      296:          <code class="code"><a href="//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   297:        <p>See the <a class="ulink" href="../internals/en/chap-processes.html#syscall_howto" target="_top">
                    298:             HOWTO</a> and related documentation in the <a class="ulink" href="../internals/en/" target="_top">
1.1       dsieger   299:            NetBSD Internals Guide</a> for more information.
                    300:        </p>
                    301:       
1.80      andvar    302:        <h4 class="title" id="adding_a_sysctl">Adding a sysctl</h4>
1.1       dsieger   303:        
1.85      riastrad  304:        <p>See a <a class="ulink" href="//mail-index.NetBSD.org/tech-kern/2001/06/24/0000.html" target="_top">posting</a>
                    305:          answering this question on  <a class="ulink" href="//mail-index.NetBSD.org/tech-kern/" target="_top">tech-kern</a>.</p>
1.1       dsieger   306:        
                    307:        <p>Note that NetBSD 1.6 and up has a special
1.79      martin    308:          <span class="quote">“<span class="quote">vendor</span>”</span> sysctl category that is reserved for vendor
1.86      martin    309:          specific entries. See <a href="//man.NetBSD.org/NetBSD-11.0/sysctl.8">sysctl(8)</a> for more
1.1       dsieger   310:          information.</p>
                    311:       
1.86      martin    312:        <h4 class="title" id="mmap_in_pseudo-device">How to implement <a href="//man.NetBSD.org/NetBSD-11.0/mmap.2">mmap(2)</a> in a pseudo-device</h4>
1.1       dsieger   313:        
                    314:        <p>Your device is most likely a character device, so
                    315:          you will be using the device pager (the VM system hides
                    316:          all of this from you, don't worry).</p>
                    317:        
                    318:        <p>The first thing you need to do is pick some
                    319:          arbitrary offsets for your mmap interface.  Something
                    320:          like "mmap offset 0-M gives object A, N-O gives object
                    321:          B", etc.</p>
                    322:        
                    323:        <p>After that, your mmap routine would look something
                    324:          like this:
                    325:          </p>
                    326: <pre class="programlisting">
                    327: int
                    328: foommap(dev_t dev, int off, int prot)
                    329: {
                    330: 
                    331:         if (off &amp; PAGE_MASK)
                    332:                 panic("foommap");
                    333: 
                    334:         if ((u_int)off &gt;= FOO_REGION1_MMAP_OFFSET &amp;&amp;
                    335:             (u_int)off &lt; (FOO_REGION1_MMAP_OFFSET + FOO_REGION1_SIZE))
                    336:                 return (atop(FOO_REGION1_ADDR + ((u_int)off -
                    337:                     FOO_REGION1_MMAP_OFFSET)));
                    338: 
                    339:         if ((u_int)off &gt;= FOO_REGION2_MMAP_OFFSET &amp;&amp;
                    340:             (u_int)off &lt; (FOO_REGION2_MMAP_OFFSET + FOO_REGION2_SIZE))
                    341:                 return (atop(FOO_REGION1_ADDR + ((u_int)off -
                    342:                     FOO_REGION2_MMAP_OFFSET)));
                    343: 
                    344:         /* Page not found. */
                    345:         return (-1);
                    346: }</pre>
                    347: 
                    348:          <p>Now, this is slightly more complicated by the fact
                    349:            that you are going to be mmap'ing what are simply
                    350:            kernel memory objects (it is a pseudo-device after
                    351:            all).</p>
                    352:          
                    353:          <p>In order to make this work, you're going to want
                    354:            to make sure you allocate the memory objects to be
                    355:            mmap'd on page-aligned boundaries.  If you are
                    356:            allocating something &gt;= <code class="code">PAGE_SIZE</code> in
                    357:            size, this is guaranteed. Otherwise, you are going to
                    358:            have to use <code class="code">uvm_km_alloc()</code>, and round
                    359:            your allocation size up to page size.</p>
                    360:          
                    361:          <p>Then it would look a bit more like this:
                    362:            </p>
                    363: <pre class="programlisting">
                    364: int
                    365: foommap(dev_t dev, int off, int prot)
                    366: {
                    367:         paddr_t pa;
                    368: 
                    369:         if (off &amp; PAGE_MASK)
                    370:                 panic("foommap: offset not page aligned");
                    371: 
                    372:         if ((u_int)off &gt;= FOO_REGION1_MMAP_OFFSET &amp;&amp;
                    373:             (u_int)off &lt; (FOO_REGION1_MMAP_OFFSET + FOO_REGION1_SIZE)) {
                    374:                 if ((vaddr_t)foo_object1 &amp; PAGE_MASK)
                    375:                         panic("foommap: foo_object1 not page aligned");
                    376:                 if (pmap_extract(pmap_kernel(), foo_object1 +
                    377:                     (u_int)off - FOO_REGION1_MMAP_OFFSET, &amp;pa) == FALSE)
                    378:                         panic("foommap: foo_object1 page not mapped");
                    379:                 return (atop(pa));
                    380:         }
                    381: 
                    382:         if ((u_int)off &gt;= FOO_REGION2_MMAP_OFFSET &amp;&amp;
                    383:             (u_int)off &lt; (FOO_REGION2_MMAP_OFFSET + FOO_REGION2_SIZE)) {
                    384:                 if ((vaddr_t)foo_object2 &amp; PAGE_MASK)
                    385:                         panic("foommap: foo_object2 not page aligned");
                    386:                 if (pmap_extract(pmap_kernel(), foo_object2 +
                    387:                     (u_int)off - FOO_REGION2_MMAP_OFFSET, &amp;pa) == FALSE)
                    388:                         panic("foommap: foo_object2 page not mapped");
                    389:                 return (atop(pa));
                    390:         }
                    391: 
                    392:         /* Page not found. */
                    393:         return (-1);
                    394: }</pre>
                    395:       
1.80      andvar    396:        <h4 class="title" id="accessing_a_kernel_structure_from_userland">Accessing a kernel structure from userland</h4>
1.1       dsieger   397:        
                    398:        <p>The canonical example for this is:  <code class="code">
1.84      leot      399:            <a href="//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>
1.1       dsieger   400:          , which reads disk statistics.</p>
                    401:       
1.80      andvar    402:        <h4 class="title" id="sample_driver">Is there a simple PCI driver I can use as an example?</h4>
1.1       dsieger   403:        <p>You can look at
                    404:          <code class="filename">sys/dev/pci/puc.c</code>, which is one of
                    405:          the simplest drivers. PUCs are devices with one or more
                    406:          serial or parallel ports on it, usually using standard
                    407:          chips (e.g. 16550 UART for serial). This driver just
                    408:          locates the I/O addresses of the registers of the serial or
                    409:          parallel controller and passes it to the serial or
                    410:          parallel driver.</p> 
                    411:       
1.80      andvar    412:        <h4 class="title" id="other-related-links">Other related links</h4>
1.1       dsieger   413:        
1.23      tron      414: <div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; ">
1.15      spz       415: <li class="listitem">
1.86      martin    416: <a href="//man.NetBSD.org/NetBSD-11.0/driver.9">driver(9)</a> - NetBSD autoconfiguration
1.1       dsieger   417:            interface utilised by device drivers</li>
1.15      spz       418: <li class="listitem">
1.86      martin    419: <a href="//man.NetBSD.org/NetBSD-11.0/autoconf.9">autoconf(9)</a> - General description on the
1.1       dsieger   420:            NetBSD autoconfiguration framework</li>
1.15      spz       421: <li class="listitem">
1.86      martin    422: <a href="//man.NetBSD.org/NetBSD-11.0/config.9">config(9)</a> - The autoconfiguration
1.1       dsieger   423:            framework ``device definition'' language</li>
1.15      spz       424: <li class="listitem">
1.86      martin    425: <a href="//man.NetBSD.org/NetBSD-11.0/bus_dma.9">bus_dma(9)</a> - NetBSD's bus and machine
1.12      hubertf   426:            independent DMA framework, described in its own <a class="ulink" href="bus_dma.pdf" target="_top">paper</a> (64k, PDF)</li>
1.15      spz       427: <li class="listitem">
1.86      martin    428: <a href="//man.NetBSD.org/NetBSD-11.0/bus_space.9">bus_space(9)</a> - NetBSD's bus space
1.1       dsieger   429:            manipulation interface</li>
1.15      spz       430: <li class="listitem">
1.12      hubertf   431: <a class="ulink" href="scsidma.html" target="_top">How SCSI DMA
1.1       dsieger   432:              works</a> - by Tohru Nishimura</li>
1.15      spz       433: <li class="listitem">
1.12      hubertf   434: <a class="ulink" href="lazyfpu.html" target="_top">How lazy FPU context
1.1       dsieger   435:              switch works</a> - by Tohru Nishimura</li>
1.15      spz       436: <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>
                    437: <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   438: </ul></div>
1.79      martin    439:       <hr>Back to  <em><a href="./">NetBSD Documentation: Kernel</a></em>
1.3       dsieger   440: </div></div></div>
                    441: <div class="navfoot"></div>
1.80      andvar    442: <div id="footer"><div id="footerContent">
                    443: <span class="footfeed"><a href="//www.NetBSD.org/cgi-bin/feedback.cgi">
1.3       dsieger   444:          Contact</a> |
1.9       kano      445:       </span><span class="footcopy"><a href="../../about/disclaimer.html">
1.3       dsieger   446:       Disclaimer</a> |
                    447: 
1.81      leot      448:       <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    449:        Foundation, Inc.</span>
                    450: </div></div>
1.1       dsieger   451: </div></body>
                    452: </html>

CVSweb <webmaster@jp.NetBSD.org>