- 博客(12)
- 资源 (6)
- 收藏
- 关注
原创 网上的一个block device driver for 2.6.31的例子,我改了一下可以在2.3.36上用
<br />这个是网上的一个例子,很不错<br />http://blog.superpat.com/2010/05/04/a-simple-block-driver-for-linux-kernel-2-6-31/<br /> <br />/*<br /> * A sample, extra-simple block driver. Updated for kernel 2.6.31.<br /> *<br /> * (C) 2003 Eklektix, Inc.<br /> * (C)
2010-12-31 11:03:00 2653
原创 通过/proc/partitions 查看分区信息
<br />文件/proc/partitions 可以查看分区信息。<br />$cat /proc/partitions <br />major minor #blocks name<br /><br /> 8 0 488386584 sda<br /> 8 16 488386584 sdb<br /> 8 32 488386584 sdc<br /> 8 48 488386584 sdd<br /><br /> <br /> <b
2010-12-30 11:37:00 27461 3
原创 block device driver from ldd3
放到2.6.36上编译不过了,做了适当的改动。/* * Sample disk driver, from the beginning. *///#include #include #include #include #include #include /* printk() */#include /* kmalloc() */#include /* everything... */#include /* error
2010-12-23 16:06:00 1433
原创 kernel的链表api
/* * ===================================================================================== * * Filename: list.c * * Description: * * Version: 1.0 * Created:
2010-12-13 14:47:00 956
原创 数据结构对齐, #pragma pack 和 __attribute__((packed))
<br />gcc中定义了两个修改数据结构对齐方式的语句<br />1. #pragma pack()<br />2. __attribute__((packed))<br /> <br />#include <stdio.h><br />#include <stdlib.h><br />#include <string.h><br /><br />// calculate the offset of t in S<br />#define offsetof(S,t) (size_t
2010-12-13 13:39:00 4197
转载 C的0长数组
<br />http://hi.baidu.com/bmrs/blog/item/83561e00605c13db267fb555.html<br /> <br />#include <stdio.h><br />#include <stdlib.h><br />#include <string.h><br /><br />char buf[128];<br />struct Test{<br /> int len;<br /> char content[0];<br /
2010-12-13 11:55:00 1228
原创 通过/proc/ioports开查看端口的使用(/proc/iomem)
$cat /proc/ioports 0000-0cf7 : PCI Bus 0000:00 0000-001f : dma1 0020-0021 : pic1 0040-0043 : timer0 0050-0053 : timer1 0060-0060 : keyboard 0064-0064 : keyboard 0070-0071 : rtc0
2010-12-12 21:14:00 7751 2
原创 使用 .gitignore来忽略某些文件
具体使用请看 man gitignore一般某个项目dev过程中都会产生一些中间文件,这些文件是我们不想要追踪的。git中可以使用.gitignore文件来忽略这些文件。在需要的目录下面 添加 .gitignore文件文件中每一行表示需要忽略的文件的正则表达式。$cat .gitignore #ignore .metadata.metadata.gitignore当前的目录情况$ls -altotal 24drwxr-xr-x 4 root root 4096 2010-12-11 1
2010-12-11 12:50:00 66098 3
原创 /proc/interrupts 和 /proc/stat 查看中断的情况
<br />在/proc文件系统下,又两个文件提供了中断的信息。<br /> <br />/proc/interrupts文件中列出当前系统使用的中断的情况,所以某个中断处理没有安装,是不会显示的。哪怕之前安装过,被卸载了。 <br />从左到右分别是, <br />irq的序号, 在各自cpu上发生中断的次数,可编程中断控制器,设备名称(request_irq的dev_name字段)<br />$cat /proc/interrupts <br /> CPU0 CP
2010-12-09 10:06:00 36225
原创 some OSGi materials
<br />OSGi实战 资料下载<br />http://ajava.org/book/other/688.html<br /> <br />国外的一个例子 没跑起来<br />http://www.vogella.de/articles/OSGi/article.html#osgi_installation
2010-12-08 10:39:00 1087
原创 2.6.36 Workqueue API usage
<br />在新版的linux中,workqueue的api做了一定的修改。<br />下面是个简单的例子,是基于ldd3的 jiq.c代码。<br /> <br />其中网上另一个人给的一个用法是,将jiq_print_wq的输入参数作为一个全局的变量,而不是通过container_of来算出来的。<br />我觉得这样写代码比较清楚点。<br /> <br />//#include <linux/config.h><br />#include <linux/module.h><br />#inc
2010-12-02 11:07:00 984
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人