mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-11-10 01:33:11 +01:00
Extend kernelPackages using kernelPackagesExtensions by adding a simple "hello world" kernel module. Ensure it is loaded and the "Hello world!" printk appears in dmesg.
19 lines
267 B
C
19 lines
267 B
C
// SPDX-License-Identifier: MIT
|
|
#include <linux/module.h>
|
|
#include <linux/printk.h>
|
|
|
|
static int hello(void)
|
|
{
|
|
pr_info("Hello world!");
|
|
return 0;
|
|
}
|
|
module_init(hello);
|
|
|
|
static void goodbye(void)
|
|
{
|
|
pr_info("Goodbye");
|
|
}
|
|
module_exit(goodbye);
|
|
|
|
MODULE_LICENSE("MIT");
|