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