hello.c
来自「ldd1的源代码」· C语言 代码 · 共 26 行
C
26 行
/* * * Tested with 2.0, 2.2, 2.4 on x86 - * Tested with 2.0 on SPARC * Tested with 2.0 on Alpha * Tested with 2.2 on ARM * Tested with 2.2 on PowerPC * Tested with 2.2 on SPARC64 */ #define MODULE#include <linux/module.h>/* * These lines, although not shown in the book, * are needed to make hello.c run properly even when * your kernel has version support enabled */ #include <linux/config.h> #ifdef CONFIG_MODVERSIONS # define MODVERSIONS # include <linux/modversions.h> #endif int init_module(void) { printk("<1>Hello, world\n"); return 0; }void cleanup_module(void) { printk("<1>Goodbye cruel world\n"); }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?