README revision 1.14
1	$NetBSD: README,v 1.14 2020/04/04 21:15:04 kamil Exp $
2
3                           Kernel Developer's Manual
4
5DESCRIPTION
6     The kernel example dynamic modules.
7
8     This directory contains the following example modules:
9     * current_time    - prints current date and time in GMT/UTC
10     * executor        - basic implementation of callout and RUN_ONCE
11     * fopsmapper      - basic implementation of mmap with fileops fo_mmap
12     * hello           - the simplest `hello world' module
13     * luahello        - the simplest `hello world' Lua module
14     * luareadhappy    - demonstrates calling Lua code from C
15     * mapper          - basic implementation of mmap
16     * panic_string    - shows how panic is being called through a device
17     * ping            - basic ioctl(9)
18     * ping_block      - basic ioctl(9) with a block device
19     * properties      - handle incoming properties during the module load
20     * readhappy       - basic implementation of read(9) with happy numbers
21     * readhappy_mpsafe- demonstrates how to make a module MPSAFE
22     * sysctl          - demonstrates adding a sysctl handle dynamically
23
24     To build the examples you need a local copy of NetBSD sources. You also
25     need the comp set with toolchain. To build the module just enter a
26     directory with example modules and use make(1):
27
28         # make
29
30     To load, unload, and stat the module use modload(8), modunload(8) and
31     modstat(8).
32
33     The S parameter in the Makefile files points to src/sys and it can be
34     overloaded in this way:
35
36         # make S=/data/netbsd/src/sys
37
38     The code of a module does not need to be in src/sys unless it uses
39     the autoconf(9) framework.
40
41     A cross-build of a module for a target platform is possible with the
42     build.sh framework. You need to generate the toolchain and set
43     appropriately PATH to point bin/ in the TOOLDIR path. An example command
44     to cross-build a module with the amd64 toolchain is as follows:
45
46        # nbmake-amd64 S=/data/netbsd/src/sys
47
48
49     The example modules should not be used on a production machine.
50
51     All modules that create a cdevsw (or bdevsw) should be verified that
52     the major number(s) should not conflict with a real device.
53
54SEE ALSO
55     modctl(2), module(7), modload(8), modstat(8), modunload(8), module(9),
56     intro(9lua)
57
58HISTORY
59     An example of handling incoming properties first appeared in NetBSD 5.0
60     and was written by Julio Merino with further modifications by Martin
61     Husemann, Adam Hamsik, John Nemeth and Mindaugas Rasiukevicius.
62
63     This document and additional modules (hello, readhappy, properties,
64     ping, luahello and luareadhappy) first appeared in NetBSD 8.0; they were
65     written by Kamil Rytarowski.
66
67     The readhappy_mpsafe, executor and sysctls modules first appeared in NetBSD
68     9.0 and were authored by Siddharth Muralee.
69
70     The panic_string module first appeared in NetBSD 9.0 and was authored by
71     Harry Pantazis.
72
73     The mapper module first appeared in NetBSD 9.0 and was authored by
74     Akul Pillai.
75     
76     The ping_block module first appeared in NetBSD 10.0 and was authored by
77     Nisarg Joshi.
78
79     The fopsmapper module first appeared in NetBSD 10.0 and was authored by
80     Aditya Vardhan Padala.
81
82     The current_time module first appeared in NetBSD 10.0 and was authored by
83     Apurva Nandan.
84
85AUTHORS
86     This document was written by Kamil Rytarowski.
87