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