Home | History | Annotate | Line # | Download | only in examples
README revision 1.2
      1 	$NetBSD: README,v 1.2 2015/05/13 22:41:48 pgoyette Exp $
      2 
      3                            Kernel Developer's Manual
      4 
      5 DESCRIPTION
      6      The kernel example dynamic modules.
      7 
      8      This directory contains the following example modules:
      9      * hello           - the simplest `hello world' module
     10      * properties      - handle incoming properties during the module load
     11      * readhappy       - basic implementation of read(9) with happy numbers
     12      * ping            - basic ioctl(9)
     13      * luahello        - the simplest `hello world' Lua module
     14 
     15      To build the examples you need a local copy of NetBSD sources. You also
     16      need the comp set with toolchain. To build the module just enter a
     17      directory with example modules and use make(1):
     18 
     19          # make
     20 
     21      To load, unload, and stat the module use modload(8), modunload(8) and
     22      modstat(8).
     23 
     24      The S parameter in the Makefile files points to src/sys and it can be
     25      overloaded in this way:
     26 
     27          # make S=/data/netbsd/src/sys
     28 
     29      The code of a module does not need to be in src/sys unless you use
     30      the autoconf(9) framework.
     31 
     32      A cross-built of a module for a target platform is possible with the
     33      build.sh framework. You need to generate the toolchain and set
     34      appropriately PATH to point bin/ in the TOOLDIR path. An example command
     35      to cross-build a module with the amd64 toolchain is as follows:
     36 
     37         # nbmake-amd64 S=/data/netbsd/src/sys
     38 
     39 
     40      The example modules should not be used on a production machine.
     41 
     42      All modules that create a cdevsw should be verified that the major number
     43      should not conflict with a real device.
     44 
     45 SEE ALSO
     46      lua(9lua), modctl(2), modload(8), module(7), module(9), modstat(8),
     47      modunload(8)
     48 
     49 HISTORY
     50      An example of handling incoming properties first appeared in NetBSD 5.0
     51      and was written by Julio Merino with further modifications by Martin
     52      Husemann, Adam Hamsik, John Nemeth and Mindaugas Rasiukevicius.
     53 
     54      This document and additional modules (hello, readhappy, properties,
     55      ping, and luahello) first appeared in NetBSD 8.0; they were written
     56      by Kamil Rytarowski.
     57 
     58 AUTHORS
     59      This document was written by Kamil Rytarowski.
     60