摘要: 在工作和学习的时候总是离不开音乐,可偏偏linux下的音乐播放界面中文显示总是有问题,今天google了一下,果然有很多的解决方案,用一个叫做mid3iconv的工具,以GBK编码的方式转换一下音乐文件的名字即可,非常简单。cd Musicmid4iconv -e GBK *.mp3 */*.mp3再导入到rhythmbox后汉字显示就没问题了。 阅读全文
posted @ 2012-01-15 15:24 renwei 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 转自:http://linux-tutorial.info/modules.php?name=MContent&pageid=94做了少许加粗和删减,需要完整版的请看原文。Major and Minor NumbersOne of the basic features of the Linux kernel is that it abstracts the handling of devices. All hardware devices look like regular files; they can be opened, closed, read and written usin 阅读全文
posted @ 2011-11-20 16:50 renwei 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 怎样写出一个可以处理想printf一样能够处理可变长参数的函数呢。看printf的定义:int printf(char *fmt, ...);C语言标准库中头文件stdarg.h索引的接口包含了一组能够遍历变长参数列表的宏。主要包含下面几个:1、va_list 用来声明一个表示参数表中各个参数的变量。2、va_start 初始化一个指针来指向变长参数列表的头一个变量(注意,...只能出现在参数表的最后)3、va_arg每次调用时都会返回当前指针指向的变量,并将指针挪至下一个位置,参数的类型需要在这个调用的第二个参数来指定,va_arg也是根据这个参数来判断偏移的距离。4、va_end需要在函数 阅读全文
posted @ 2011-11-06 14:22 renwei 阅读(2577) 评论(0) 推荐(0) 编辑
摘要: This is the classic method of exporting a symbol: dynamically loaded modules will be able to use the symbol as normal.我们可以使用EXPORT_SYMBOL把要在kernel module之间共享的函数或者声明标记为共享,模块间就可以这些函数和变量了。1// file A in module A2 3 void func()4 5 {6 7 ...8 9 }EXPORT_SYMBOL(func)//file B in module B#include <linux/mod 阅读全文
posted @ 2011-07-24 23:09 renwei 阅读(669) 评论(0) 推荐(0) 编辑