小弟我写了一个很简单的字符驱动,在用open系统调用打开设设备文件时出错

我写了一个很简单的字符驱动,在用open系统调用打开设设备文件时出错
驱动安装#insmod uart.ko   //字装之后在/proc/devices下面能看到252 uart 字符设备。

用#mknod /dev/uart c 252 0 在/dev/下面创建了设备节点。

我的程序就出错在open系统调用:fd = open("/dev/uart",O_RDONLY);   //我试过把这行给注释掉,这样就没有错了;我不能理解:为什么我创建了设备节点却还是在open时出错了,请高手们指点下!


下面是在运行应用程序后打印出的oops消息:
[root@FriendlyARM app]# ./hello                                                 
open start!Unable to handle kernel NULL pointer dereference at virtual address 1
pgd = cd610000                                                                  
[00000001] *pgd=5d60c831, *pte=00000000, *ppte=00000000                         
Internal error: Oops: 17 [#1] PREEMPT                                           
last sysfs file: /sys/block/mmcblk0/dev                                         
Modules linked in: uart fa_cpu_pfn(P)                                           
CPU: 0    Tainted: P             (2.6.38-FriendlyARM #13)                       
PC is at chrdev_open+0xe0/0x190                                                 
LR is at chrdev_open+0xc8/0x190                                                 
pc : [<c01e4e88>]    lr : [<c01e4e70>]    psr: 20000013                         
sp : ccfcbe58  ip : 22222222  fp : cd575000