NetBSD/sys/modules/examples
nikita f0dad708b3 Resolve conflicts for lua 5.4.4 import.
Adjust various files for lua 5.4.4.
2023-04-16 20:46:16 +00:00
..
current_time Switch to type generic PRIu macros 2020-04-04 23:22:12 +00:00
ddbping ddbping - restore the original narration of the example, NFCI 2023-02-01 10:22:20 +00:00
executor
fopsmapper Fix CVS Id 2020-04-01 13:07:32 +00:00
hello
luahello Resolve conflicts for lua 5.4.4 import. 2023-04-16 20:46:16 +00:00
luareadhappy
mapper Fix fallout from previous uvm.h cleanup. 2020-09-06 02:18:53 +00:00
panic_string fix various typos, mainly in comments, but also in man pages and log messages. 2021-10-21 13:21:53 +00:00
ping remove debugging stuff accidentally committed. 2020-04-30 10:55:32 +00:00
ping_block Use ENOTTY as error for an unrecognized ioctl() code, rather than 2020-02-05 14:10:46 +00:00
pollpal driver(9): devsw_detach never fails. Make it return void. 2022-03-28 12:33:20 +00:00
properties
readhappy
readhappy_mpsafe
sysctl Add some \n's to the end of some printf()s. 2021-03-23 13:19:09 +00:00
Makefile Add ddbping example module to SUBDIR list. 2021-08-08 20:55:33 +00:00
Makefile.inc
README New kernel example module written by Ayushi Sharma 2020-04-30 00:48:10 +00:00

README

	$NetBSD: README,v 1.15 2020/04/30 00:48:10 christos Exp $

                           Kernel Developer's Manual

DESCRIPTION
     The kernel example dynamic modules.

     This directory contains the following example modules:
     * current_time    - prints current date and time in GMT/UTC
     * executor        - basic implementation of callout and RUN_ONCE
     * fopsmapper      - basic implementation of mmap with fileops fo_mmap
     * hello           - the simplest `hello world' module
     * luahello        - the simplest `hello world' Lua module
     * luareadhappy    - demonstrates calling Lua code from C
     * mapper          - basic implementation of mmap
     * panic_string    - shows how panic is being called through a device
     * ping            - basic ioctl(9)
     * ping_block      - basic ioctl(9) with a block device
     * properties      - handle incoming properties during the module load
     * pollpal         - implementation of basic poll(9) using palindrome
     * readhappy       - basic implementation of read(9) with happy numbers
     * readhappy_mpsafe- demonstrates how to make a module MPSAFE
     * sysctl          - demonstrates adding a sysctl handle dynamically

     To build the examples you need a local copy of NetBSD sources. You also
     need the comp set with toolchain. To build the module just enter a
     directory with example modules and use make(1):

         # make

     To load, unload, and stat the module use modload(8), modunload(8) and
     modstat(8).

     The S parameter in the Makefile files points to src/sys and it can be
     overloaded in this way:

         # make S=/data/netbsd/src/sys

     The code of a module does not need to be in src/sys unless it uses
     the autoconf(9) framework.

     A cross-build of a module for a target platform is possible with the
     build.sh framework. You need to generate the toolchain and set
     appropriately PATH to point bin/ in the TOOLDIR path. An example command
     to cross-build a module with the amd64 toolchain is as follows:

        # nbmake-amd64 S=/data/netbsd/src/sys


     The example modules should not be used on a production machine.

     All modules that create a cdevsw (or bdevsw) should be verified that
     the major number(s) should not conflict with a real device.

SEE ALSO
     modctl(2), module(7), modload(8), modstat(8), modunload(8), module(9),
     intro(9lua)

HISTORY
     An example of handling incoming properties first appeared in NetBSD 5.0
     and was written by Julio Merino with further modifications by Martin
     Husemann, Adam Hamsik, John Nemeth and Mindaugas Rasiukevicius.

     This document and additional modules (hello, readhappy, properties,
     ping, luahello and luareadhappy) first appeared in NetBSD 8.0; they were
     written by Kamil Rytarowski.

     The readhappy_mpsafe, executor and sysctls modules first appeared in NetBSD
     9.0 and were authored by Siddharth Muralee.

     The panic_string module first appeared in NetBSD 9.0 and was authored by
     Harry Pantazis.

     The mapper module first appeared in NetBSD 9.0 and was authored by
     Akul Pillai.
     
     The ping_block module first appeared in NetBSD 10.0 and was authored by
     Nisarg Joshi.

     The fopsmapper module first appeared in NetBSD 10.0 and was authored by
     Aditya Vardhan Padala.

     The current_time module first appeared in NetBSD 10.0 and was authored by
     Apurva Nandan.

     The pollpall module first appeared in NetBSD 10.0 and was authored by
     Ayushi Sharma.

AUTHORS
     This document was written by Kamil Rytarowski.