mirror of
https://github.com/gatieme/LDD-LinuxDeviceDrivers.git
synced 2026-09-10 12:35:59 +08:00
20 lines
335 B
C
20 lines
335 B
C
#include <linux/init.h>
|
|
#include <linux/module.h>
|
|
#include <linux/sched.h>
|
|
|
|
MODULE_LICENSE("Dual BSD/GPL");
|
|
|
|
static int __init hello_init(void)
|
|
{
|
|
printk(KERN_ALERT "Hello, world\n");
|
|
return 0;
|
|
}
|
|
|
|
static void __exit hello_exit(void)
|
|
{
|
|
printk(KERN_ALERT "Goodbye, cruel world\n");
|
|
}
|
|
|
|
module_init(hello_init);
|
|
module_exit(hello_exit);
|