Commit Graph

39 Commits

Author SHA1 Message Date
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
uwe 9e9fc3f711 ddbping - restore the original narration of the example, NFCI
Adjust previous change so that it only replaces my home-grown define
for the end marker with the new official DDB_END_CMD marker that it
introduced.  Undo the rest of that last change.

As the author of this example I'm pretty sure what example I wanted to
set and this narration order is an important part of it.
2023-02-01 10:22:20 +00:00
riastradh e7bed28911 driver(9): devsw_detach never fails. Make it return void.
Prune a whole lotta dead branches as a result of this.  (Some logic
calling this is also wrong for other reasons; devsw_detach is final
-- you should never have any reason to decide to roll it back.  To be
cleaned up in subsequent commits...)

XXX kernel ABI change to devsw_detach signature requires bump
2022-03-28 12:33:20 +00:00
andvar 6f8dc1509f fix various typos, mainly in comments, but also in man pages and log messages. 2021-10-21 13:21:53 +00:00
uwe 3934175656 Add ddbping example module to SUBDIR list. 2021-08-08 20:55:33 +00:00
simonb 9303afaaec Add some \n's to the end of some printf()s. 2021-03-23 13:19:09 +00:00
mrg 110ac605f8 introduce DDB_END_CMD and replace more than 20 copies of the same
list of NULLs and 0.  idea from rillig@.

all touched ports built, several booted.
2021-02-23 07:13:51 +00:00
riastradh 0b8d836aa7 Fix fallout from previous uvm.h cleanup.
- pmap(9) needs uvm/uvm_extern.h.

- x86/pmap.h is not usable on its own; it is only usable if included
  via uvm/uvm_extern.h (-> uvm/uvm_pmap.h -> machine/pmap.h).

- Make nvmm.h and nvmm_internal.h standalone.
2020-09-06 02:18:53 +00:00
riastradh 9fc453562f Round of uvm.h cleanup.
The poorly named uvm.h is generally supposed to be for uvm-internal
users only.

- Narrow it to files that actually need it -- mostly files that need
  to query whether curlwp is the pagedaemon, which should maybe be
  exposed by an external header.

- Use uvm_extern.h where feasible and uvm_*.h for things not exposed
  by it.  We should split up uvm_extern.h but this will serve for now
  to reduce the uvm.h dependencies.

- Use uvm_stat.h and #ifdef UVMHIST uvm.h for files that use
  UVMHIST(ubchist), since ubchist is declared in uvm.h but the
  reference evaporates if UVMHIST is not defined, so we reduce header
  file dependencies.

- Make uvm_device.h and uvm_swap.h independently includable while
  here.

ok chs@
2020-09-05 16:30:10 +00:00
uwe 57ff52fa43 Example of a kernel module that registers DDB commands. 2020-06-01 03:37:40 +00:00
christos 226be24a67 s/&&/&/ and also return POLLRDNORM (pointed out by joerg@) 2020-05-01 21:42:34 +00:00
christos 7fa5b1d2e9 remove debugging stuff accidentally committed. 2020-04-30 10:55:32 +00:00
mrg 0a33e04ee4 include sys/lwp.h and fix the build. 2020-04-30 07:07:22 +00:00
christos b902ab58a2 New kernel example module written by Ayushi Sharma 2020-04-30 00:48:10 +00:00
kamil e6494e6f4f Switch to type generic PRIu macros
Fixes build on i386.
2020-04-04 23:22:12 +00:00
kamil 068c592bb4 Add new example kernel module: current_time
Submitted by Apurva Nandan.
2020-04-04 21:15:04 +00:00
kamil 85335799e7 Fix CVS Id 2020-04-01 13:07:32 +00:00
kamil c4f12fb2cb Avoid comparison between signed and unsigned integer
Cast PAGE_SIZE to size_t.
2020-04-01 11:45:53 +00:00
kamil 2c306a0e81 Import a new example kernel module fopsmapper
fopsmapper - basic implementation of mmap with fileops fo_mmap

Submitted by Aditya Vardhan Padala.
2020-04-01 01:57:20 +00:00
pgoyette 987836cb65 Improve wording 2020-02-07 19:22:21 +00:00
kamil 920eeb12bb Document what does ping_block. 2020-02-06 22:52:25 +00:00
pgoyette 5448349461 Use ENOTTY as error for an unrecognized ioctl() code, rather than
"magic number" 1.


ok kamil@
2020-02-05 14:10:46 +00:00
kamil 9ecc7056f0 Import new example kernel module ping_block
Subbmitted by Nisarg Joshi.
2020-02-05 13:23:42 +00:00
kamil 67a548a800 Align major numbers in example modules with sys/conf/majors
Patch submitted by: Aditya Vardhan Padala (silv3r)
2020-01-30 07:58:33 +00:00
ad 8faaa814a5 Use MPSAFE callouts. 2019-12-14 15:36:08 +00:00
rin 2bc4fb1fcb Bump default value of WARNS for modules from 3 to 5, and
explicitly set WARNS for modules that fail with WARNS=5.

Also, turn on -Wno-missing-noreturn for clang for some files.

At the moment, among ~ 360 modules,
- 2 (lua and zfs) need WARNS=0
- 1 (solaris) needs WARNS=1
- 136 need WARNS=3 (mostly due to sign-compare)
- 4 need WARNS=4
- others can be compiled with WARNS=5

Discussed on tech-kern.
2019-02-17 04:05:41 +00:00
kamil 1514387ab8 Add a new example kernel module: mapper
Basic implementation of mmap.

Submitted by Akul Pillai.
2019-01-17 20:47:42 +00:00
kamil 926e9b7f23 Introduce new example kernel module: panic_string
The panic_string module accepts input from a device file over the write(2)
system call.

It prints panic(9) message passed from user space, e.g.:

   echo "Hello world" > /dev/panic

If a string is empty or contain only whitespaces it's ignored and panic(9)
is not triggered. If a non printable character is passed within the input
buffer, the rest of the string is ignored.

This module performs the sync(8) operation before panic(9) to flush cache.

Submitted by Harry Pantazis.
Simplified and cleaned up by myself.
2018-05-29 16:53:56 +00:00
kamil 6a0b9e974e Add new example loadable kernel module: readhappy_mpsafe
readhappy_mpsafe - demonstrates how to make a module MPSAFE

This module contains an additional helper program test_readhappy.c,
that is designed to exercise the kernel module with multiple threads.

Submitted by <Siddharth Muralee>
2018-04-20 00:06:45 +00:00
kamil bfd0ff91ec Add a new example kernel module
executor - basic implementation of callout and RUN_ONCE

While there, perform a small cleanup in README.

Patch by <Siddharth Muralee>
Polishing by myself.
2018-04-13 20:30:09 +00:00
kamil e5c3c7a7c4 Add new example kernel module: sysctl
sysctl - demonstrates adding a sysctl handle dynamically.

Patch by <Siddharth Muralee>
Polishing by myself.
2018-04-13 01:20:27 +00:00
sevan 3906dcf33e Add luareadhappy to the list. 2017-04-23 23:39:42 +00:00
kamil 0c8a82569b Build without installation example lua kernel module: luareadhappy 2017-04-15 18:22:35 +00:00
kamil 502c2ed2ba Add new example kernel module in Lua luareadhappy
This example presents a C module with its device (/dev entry) and its
content generator with algorithm defined in Lua state. The Lua state can
be changed dynamically from userland, without interruption of read(2) over
the device.

This is an example how to call Lua code from C.
2017-04-15 04:27:30 +00:00
pgoyette 754633894c Even though this isn't a man page, it looks like one. So sort the
SEE ALSO section accordingly.
2015-05-15 06:21:12 +00:00
pgoyette 1afdfaef97 Fix up another internal reference to renamed module, and adjust some
English grammar.
2015-05-13 22:41:48 +00:00
pgoyette ad0c284179 Fix instructions to match reality. (I renamed the example from the
original submitter, but didn't catch all internal references.)
2015-05-13 22:37:53 +00:00
joerg c3d5222ef6 Fix RCS ID. 2015-05-13 12:13:38 +00:00
pgoyette 14e2571904 A set of more comprehensive example kernel modules to replace our
previous single example.

These examples were provided by Kamil Rytarowski.

XXX These modules are built as part of a system build, but they
XXX are NOT installed in $DESTDIR.
2015-05-13 07:07:36 +00:00