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