2015年7月23日

今天用 Buildroot 编译文件系统烧写到开发板启动提示下面的错误
can't open /dev/ttyS0: No such file or directory
can't open /dev/ttyS0: No such file or directory
can't open /dev/ttyS0: No such file or directory
can't open /dev/ttyS0: No such file or directory
can't open /dev/ttyS0: No such file or directory
can't open /dev/null: No such file or directory
can't open /dev/null: No such file or directory
can't open /dev/null: No such file or directory
can't open /dev/null: No such file or directory
can't open /dev/null: No such file or directory

后面发现是内核没有选上 CONFIG_DEVTMPFS_MOUNT 的原因,配置上之后重新编译内核烧写到开发板就可以避免这个问题了

posted @ 2015-07-23 18:31 墨…… 阅读(1968) | 评论 (0)编辑 收藏


2013年7月11日

   有时候编译 Emacs 时不想发图形界面,因为用不到,可以用以下命令来进行编译:
       
make -DWITHOUT_X11 install clean

or

make WITHOUT_X11=set install clean

posted @ 2013-07-11 17:22 墨…… 阅读(431) | 评论 (0)编辑 收藏


2013年5月14日

在查阅Linux源码时,总是为函数或变量的查找跟踪而烦恼,有了这篇文章之后,再也不用烦恼了:
http://lifegoo.pluskid.org/wiki/EmacsCscope.html

posted @ 2013-05-14 17:41 墨…… 阅读(379) | 评论 (0)编辑 收藏


2013年4月10日

这几天一直在调试atmel at91sam9x25的串口,用着用着总会导致Oops,Oops内容如下:
[ 1023.510000] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[ 1023.520000] pgd = c0004000
[ 1023.520000] [00000000] *pgd=00000000
[ 1023.520000] Internal error: Oops: 17 [#1]
[ 1023.520000] last sysfs file: /sys/devices/virtual/misc/at91flash/dev
[ 1023.520000] Modules linked in: at91flash at91gpio at91mc323 ds18b20 at91adc
[ 1023.520000] CPU: 0    Tainted: G        W    (2.6.39 #35)
[ 1023.520000] PC is at atmel_tasklet_func+0x104/0x690
[ 1023.520000] LR is at atmel_tasklet_func+0x10/0x690
[ 1023.520000] pc : [<c01a33ac>]    lr : [<c01a32b8>]    psr: 20000013
[ 1023.520000] sp : c7825f58  ip : 60000093  fp : 00000000
[ 1023.520000] r10: 00000006  r9 : 00000000  r8 : 0000000a
[ 1023.520000] r7 : 00000000  r6 : c7824000  r5 : c78a2484  r4 : c03c0cb8
[ 1023.520000] r3 : 0000004c  r2 : 0000004c  r1 : 60000013  r0 : 00000001
[ 1023.520000] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
[ 1023.520000] Control: 0005317f  Table: 27b40000  DAC: 00000017
[ 1023.520000] Process ksoftirqd/0 (pid: 3, stack limit = 0xc7824270)
[ 1023.520000] Stack: (0xc7825f58 to 0xc7826000)
[ 1023.520000] 5f40:                                                       00000001 c7824000
[ 1023.520000] 5f60: 00000100 0000000a 00000000 00000006 c7825f8c 00000000 00000001 c7824000
[ 1023.520000] 5f80: 00000100 0000000a 00000006 c0045cf8 c03b995c c00461d8 c7aa6ae0 00000000
[ 1023.520000] 5fa0: 60000093 00000000 c7824000 c0046274 00000013 00000000 00000000 c00462e0
[ 1023.520000] 5fc0: 00000000 c7819f70 00000000 c00570e0 00000000 00000000 00000000 00000000
[ 1023.520000] 5fe0: c7825fe0 c7825fe0 c7819f70 c0057060 c0030b14 c0030b14 ffffffff ffffffff
[ 1023.520000] [<c01a33ac>] (atmel_tasklet_func+0x104/0x690) from [<c0045cf8>] (tasklet_action+0x84/0xe
[ 1023.520000] [<c0045cf8>] (tasklet_action+0x84/0xe from [<c00461d8>] (__do_softirq+0x88/0x124)
[ 1023.520000] [<c00461d8>] (__do_softirq+0x88/0x124) from [<c00462e0>] (run_ksoftirqd+0x6c/0x12
[ 1023.520000] [<c00462e0>] (run_ksoftirqd+0x6c/0x12 from [<c00570e0>] (kthread+0x80/0x8
[ 1023.520000] [<c00570e0>] (kthread+0x80/0x8 from [<c0030b14>] (kernel_thread_exit+0x0/0x
[ 1023.520000] Code: 1a000002 e59f057c e59f157c ebfa3d49 (e5973000) 
[ 1023.710000] ---[ end trace 786b41cd25d3b661 ]---
[ 1023.710000] Kernel panic - not syncing: Fatal exception in interrupt
[ 1023.720000] [<c0034b10>] (unwind_backtrace+0x0/0xe0) from [<c02a8af8>] (panic+0x50/0x170)
[ 1023.720000] [<c02a8af8>] (panic+0x50/0x170) from [<c0032e00>] (die+0x184/0x1c4)
[ 1023.730000] [<c0032e00>] (die+0x184/0x1c4) from [<c0035aa8>] (__do_kernel_fault+0x64/0x84)
[ 1023.740000] [<c0035aa8>] (__do_kernel_fault+0x64/0x84) from [<c0035c7c>] (do_page_fault+0x1b4/0x1c
[ 1023.750000] [<c0035c7c>] (do_page_fault+0x1b4/0x1c from [<c002a240>] (do_DataAbort+0x30/0x9
[ 1023.760000] [<c002a240>] (do_DataAbort+0x30/0x98) from [<c002f86c>] (__dabt_svc+0x4c/0x60)
[ 1023.770000] Exception stack(0xc7825f10 to 0xc7825f58)
[ 1023.770000] 5f00:                                     00000001 60000013 0000004c 0000004c
[ 1023.780000] 5f20: c03c0cb8 c78a2484 c7824000 00000000 0000000a 00000000 00000006 00000000
[ 1023.790000] 5f40: 60000093 c7825f58 c01a32b8 c01a33ac 20000013 ffffffff
[ 1023.790000] [<c002f86c>] (__dabt_svc+0x4c/0x60) from [<c01a33ac>] (atmel_tasklet_func+0x104/0x690)
[ 1023.800000] [<c01a33ac>] (atmel_tasklet_func+0x104/0x690) from [<c0045cf8>] (tasklet_action+0x84/0xe8)
[ 1023.810000] [<c0045cf8>] (tasklet_action+0x84/0xe8) from [<c00461d8>] (__do_softirq+0x88/0x124)
[ 1023.820000] [<c00461d8>] (__do_softirq+0x88/0x124) from [<c00462e0>] (run_ksoftirqd+0x6c/0x128)
[ 1023.830000] [<c00462e0>] (run_ksoftirqd+0x6c/0x128) from [<c00570e0>] (kthread+0x80/0x88)
[ 1023.840000] [<c00570e0>] (kthread+0x80/0x88) from [<c0030b14>] (kernel_thread_exit+0x0/0x8)
注意上述红色的地方。
下面就来显示如何定位出出错代码行:
1.首先,编译时打开complie with debug info选项,步则如下
make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- menuconfig
oops1.jpg 
进入 Kernel hacking
oops2.jpg 
选择 Compile the kernel with debug info
然后,保存,退出。
接着 make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
编译, 等编译完成。
2.利用arm-none-linux-gnueabi-gdb 调试,如下:
arm-none-linux-gnueabi-gdb vmlinux
oops3.jpg 
对应着Oops 消息里面的这一行
[ 1023.520000] LR is at atmel_tasklet_func+0x10/0x690
在gdb下键入命令 : l *at atmel_tasklet_func+0x10
oops4.jpg 
这样就找到了出错的代码行。在这里鄙视一下atmel提供的内核,竟然还有bug,fuck it!
从这里可以看出是由于串口的dma导致Oops的,于是我去掉了串口的dma传输。方法如下:
oops5.jpg 
去掉之后还没有发现上述的Oops出现。

以上来自: 
http://bbs.chinaunix.net/thread-3744197-1-1.html

用以上的方法也能解决 Oops,但我发现我的情况是有的串口收发都可以使用 DMA,而有的就不行,于是我一个一个串口的测试,修改源码,将不能使用DMA的串口的DMA功能关闭掉,而不是将所有串口的 DMA 功能都关闭。


posted @ 2013-04-10 15:16 墨…… 阅读(945) | 评论 (0)编辑 收藏


2013年4月2日

编译 scull

   出现以下错误
 Fix it to use ccflags-y.  Stop.
   将 Makefile 中的 CFLAGS 改为 ccflags-y, 重新 make,又出现错误
main.c:15:26: fatal error: linux/config.h: No such file or directory
   将 main.c 中的 #include <linux/config.h> 删除或注释掉,重新 make,继续编译会遇到如下问题
main.c:634:2: error: unknown field 'ioctl' specified in initializer
   是因为内核中的 file_operations 结构发生了改变,将 main.c 中 scull_fops 声明处的 .ioctl 改为 .unlocked_ioctl  即可,继续编译还会遇到如下问题
main.c:652:3: error: implicit declaration of function ‘init_MUTEX’ [-Werror=implicit-function-declaration]
   可在 main.c 的开始处添加以下代码解决问题
#include <linux/semaphore.h>
#define init_MUTEX(a) sema_init(a,1)
#define init_MUTEX_LOCKED(a) sema_init(a,0)
   到这时还没完,我开始有点烦燥了...继续前进时还出现以下错误
pipe.c: In function ‘scull_p_read’:
pipe.c:131:7: error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)
pipe.c:131:7: note: each undeclared identifier is reported only once for each function it appears in
pipe.c:131:3: error: implicit declaration of function ‘signal_pending’ [-Werror=implicit-function-declaration]
pipe.c:131:3: error: implicit declaration of function ‘schedule’ [-Werror=implicit-function-declaration]
   该问题可向 pipe.c 和 access.c 中添加 #include <linux/sched.h> 来解决,但后面还会遇到这样的问题
access.c:101:34: error: ‘SPIN_LOCK_UNLOCKED’ undeclared here (not in a function)
   在access.c文件中用 static DEFINE_SPINLOCK(scull_w_lock);  来代替 static spinlock_t scull_w_lock = SPIN_LOCK_UNLOCKED;
   继续进行,遭遇下面问题
access.c:111:29: error: ‘struct task_struct’ has no member named ‘uid’
access.c:112:29: error: ‘struct task_struct’ has no member named ‘euid’
access.c:119:26: error: ‘struct task_struct’ has no member named ‘uid’
   把 access.c 文件中的 
current->uid 
current->euid
   全部修对应地改为
current->cred->uid
current->cred->euid
   继续重新 make,终于可以生成 scull.ko 了,OMG......

   还要注意的是,上面的错误可能不止发生在一个地方,编译时需要注意看清错误提示,如果有跟上面一样的错误发生,只需参照上面的方法来修改即可。
   驱动不会在虚拟终端上输出,所以如果在终端上没看到驱动的输出,可以看看是不是输出到日志中了:
/var/log/syslog


Contact us

posted @ 2013-04-02 15:36 墨…… 阅读(861) | 评论 (0)编辑 收藏


2012年5月1日

一:查询出所有表的键


SELECT * FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE TABLE_NAME='you tableName'


二:查询出所有的外键


select * from 
(
   
SELECT * FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE 
   
WHERE TABLE_NAME='Data_Product'
) tableTemp
where  CONSTRAINT_NAME like 'FK%'

另外表的类型有  'C', 'F', 'PK', 'UQ', 'D'  可以按键需要来修改
转载自http://www.diybl.com/course/7_databases/mysql/Mysqljs/20090415/165077.html

posted @ 2012-05-01 16:37 墨…… 阅读(1273) | 评论 (0)编辑 收藏


2012年4月15日

    MFC 的 cdatetimectrl 的控件有时在刚开始的时候显示时间默认为 1970
    问题有可能在于给 cdatetimectrl 控件关联了一个 CTIME 变量,该变量在构造函数里初始化为 0,就会导致该控件初始显示为 1970 或 08:00:00
    解决方法是将构造函数里的初始化删掉,控件就会显示当前打开的时间

posted @ 2012-04-15 16:32 墨…… 阅读(567) | 评论 (0)编辑 收藏


2012年3月9日

在一个项目的调试过程中,出现错误

debug assertion failed, file:dlgdata.cpp,line"43

经网上查找,项目查证:

问题原因:没有找到这个相应控件类型 !
       一般有三种情况:一是控件ID不存在,二是控件未创建,三是控件的类型不对 
看看DoDataExchange函数 

        我遇到这种情况原因是控件ID不对。。

转载自:http://www.cnblogs.com/wenbin/archive/2009/05/07/1452188.html

posted @ 2012-03-09 15:58 墨…… 阅读(1620) | 评论 (0)编辑 收藏


仅列出标题  

posts - 8, comments - 0, trackbacks - 0, articles - 0

Copyright © 墨……