How to build a module with source codes in separate directories.

If you want to use separate directories for source files and target modules, you can use below scheme. mod_main.c #include #include MODULE_LICENSE("GPL"); static int __init mod_entry(void) { return 0; } static void __exit mod_exit(void) { return; } module_init(mod_entry); module_exit(mod_exit); sub_mod.c #include #include int sub_func(int i) { printk("Hello %d", i); return 0; } EXPORT_SYMBOL(sub_func); Makefile … Continue reading How to build a module with source codes in separate directories.

module taint

static char *module_flags(struct module *mod, char *buf) { int bx = 0; if (mod->taints || mod->state == MODULE_STATE_GOING || mod->state == MODULE_STATE_COMING) { buf[bx++] = '('; if (mod->taints & (1 <taints & (1 <taints & (1 <state == MODULE_STATE_GOING) buf[bx++] = '-'; /* Show a + for module-is-being-loaded */ if (mod->state == MODULE_STATE_COMING) buf[bx++] = … Continue reading module taint

playing morse signals in Linux box

Recently, someone asked me about what TSC (Time Stamp Counter) and it reminds me one of my old day code. morse playing module!. Here's the code. It unfortunately has old style code and I don't have enough time to change it. /* morse_io.c */ #include #include #include #include #include #include #include MODULE_LICENSE("GPL"); #define CLK_FREQ (1193180L) … Continue reading playing morse signals in Linux box

simple explanation about ‘lsmod’ output

When you execute 'lsmod' command, you would see something like this. [root@localhost ~]# lsmod Module Size Used by ipheth 5105 0 cpufreq_stats 3117 0 fuse 51432 3 ebtable_nat 1431 0 ebtables 12142 1 ebtable_nat bridge 57131 0 stp 1438 1 bridge ... It shows very simple and clear information but I couldn't understand what 'Size' … Continue reading simple explanation about ‘lsmod’ output

Linux Wireless Configuration Module – cfg80211

If you travel frequently and have to access wireless internet in that country, you'd be better to check this article. Sometimes, in foreign country, you would face with unaccessible wireless AP. One of the possible reason is that you use the different country code which is described in IEEE 802.11 regulatory domain code? from the … Continue reading Linux Wireless Configuration Module – cfg80211