-
Notifications
You must be signed in to change notification settings - Fork 2
/
log200705.txt
337 lines (286 loc) · 13.5 KB
/
log200705.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
10:18 2004-05-05
查看tar包中文件
tar -tvf filename.tar
如果是tar.gz文件:
tar -zxvf filename.tar.gz
如果是tar.bz文件, -jxvf
13:23 2007-5-8
字符串操作函数, 搜索字符
STRCHR(3) Linux Programmer’s Manual STRCHR(3)
NAME strchr, strrchr, strchrnul - locate character in string
SYNOPSIS
#include <string.h>
char *strchr(const char *s, int c);
char *strrchr(const char *s, int c);
#define _GNU_SOURCE
#include <string.h> char *strchrnul(const char *s, int c);
The strchr() function returns a pointer to the first occurrence of the
character c in the string s.
The strrchr() function returns a pointer to the last occurrence of the
character c in the string s.
20:38 2007-05-08
操作系统, Minix
http://www.minix3.org/
MINIX 3 is a new open-source operating system designed to be highly reliable, flexible, and secure. It is loosely based somewhat on previous versions of MINIX, but is fundamentally different in many key ways. MINIX 1 and 2 were intended as teaching tools; MINIX 3 adds the new goal of being usable as a serious system on resource-limited and embedded computers and for applications requiring high reliability
16:04 2007-05-09
Linux, 内核调试, printk
KERN_DEBUG等8个级别的调试信息位于
include/linux/kernel.h
11:43 2007-05-10
获得毫秒精度的时间:
1, c语言如何取道系统本地时间的毫秒值呢?
http://topic.csdn.net/t/20060804/17/4927833.html#
方法1:gettimeofday
main()
{
struct timeval tpstart,tpend;
long iTimeInterval;
gettimeofday(&tpstart,NULL);
/* to do what you want*/
gettimeofday(&tpend,NULL);
iTimeInterval=1000000 * (tpend.tv_sec - tpstart.tv_sec);
iTimeInterval += tpend.tv_usec - tpstart.tv_usec;
/*iTimeInterval 就是微妙级的时间跨度*/
}
其中struct timeval的结构是
long tv_sec; /* seconds since Jan. 1, 1970 */
long tv_usec; /* and microseconds */
bamvor:
gettimeofday manul
CONFORMING TO
SVr4, 4.3BSD. POSIX.1-2001 describes gettimeofday() but not settimeof-
day().***
方法2:<time.h>
里面有一个函数叫做clock()
返回一个time_t的东西
然后差值就是算法统计时间,毫秒的
18:11 2007-05-14
回学校后,去图书馆查ioctl用法。
18:48 2007-05-14
今晚安排, 待做
1, 学习ioctl使用(5-15完成);
2, "21:05 2007-05-13"
待做。修改test_tos_mac.c:Ctrl+c退出当前运行的函数,而不是test_tos_mac本身。参Unix/Linux编程实践教程。
3, (15:09 2007-5-16)在test_tos_mac.c中加入从命令行解析arg的函数,如果参数都是从main中调用,如果每次需要测试的工作多就很不方便。改为默认情况下,调用函数时,都会获得需要的参数。输入help,可以显示包括参数含义的函数帮助。
4, (12:53 2007-05-17)vi中输入"FIXME"和"TODO"会有加亮,查用途和原因。
10:23 2007-05-15
Linux, vi
自vi手册
|usr_10.txt| Making big changes
1, 宏macro(|10.1| Record and playback commands)
Take a look at how to use these commands in practice. You have a list of
filenames that look like this:
stdio.h ~
fcntl.h ~
unistd.h ~
stdlib.h ~
And what you want is the following:
#include "stdio.h" ~
#include "fcntl.h" ~
#include "unistd.h" ~
#include "stdlib.h" ~
You start by moving to the first character of the first line. Next you
execute the following commands:
qa Start recording a macro in register a.
^ Move to the beginning of the line.
i#include "<Esc> Insert the string #include " at the beginning
of the line.
$ Move to the end of the line.
a"<Esc> Append the character double quotation mark (")
to the end of the line.
j Go to the next line.
q Stop recording the macro.
Now that you have done the work once, you can repeat the change by typing the
command "@a" three times.
The "@a" command can be preceded by a count, which will cause the macro to
be executed that number of times. In this case you would type: >
3@a
2, 查找和替换
10.2* Substitution *find-replace
The "%" before the command specifies the command works on all lines. Without
a range, ":s" only works on the current line. More about ranges in the next
section |10.3|.
10:47 2007-05-15
c语言基本功, switch-case, sizeof
1, 连switch-case是判断整数都忘了。
测试程序见test/switch_test.c
2, 在switch_test.c的switch_test函数中,sizeof测试传入数组的大小(sizeof(data), size(data[0]))都是四(整数在内存中占四字节),data定义处测试结果就正确。不明白为什么,待查。
16:30 2007-05-15
待做
看c语言书。参考东南大学的ppt的建议。
看完原来那本。
14:02 2007-05-16
(13:06 2009-2-5)
Linux, errno(错误号)分析
errno是错误号,用于调用者判断错误类型。
linux2.6.14(plat: intel mote2)源码下的:
1, linux/errno.h
包含asm/errno.h
有下列errno,都是500以上的。
/* Should never be seen by user programs */
/* Defined for the NFSv3 protocol */
2, asm/errno.h包含asm-generic/errno.h,本身无errno
3, asm-generic/errno.h包含asm-generic/errno-base.h;errno从35开始到131
4, asm-generic/errno-base.h,errno从1到34,最基本的errno,例如:
#define EPERM 1 /* Operation not permitted */
#define ENOENT 2 /* No such file or directory */
以上是2.6内核情况。2.4内核(mizi Linux2.4.18)中:
asm-arm/errno.h包含从1到124的错误号。
5, 用户空间查看errno
(0), include<errno.h>, 如果出错(-1), 查看errno即可. 如果没有出错, errno无意义, 是原来某个错误的错误号.
(1), perror用于显示错误信息。一般用法是perror(出错函数名)。
(2), strerror(errno): 用于把errno对于的信息转为字符串.
6, (12:50 2013-09-05)
kernel 3.11:
从"2"开始有变化。增加了"include/uapi"目录.
errno from 1 to 133: include/uapi/asm-generic/errno-base.h, include/uapi/asm-generic/errno.h
15:04 2007-05-16
法电实习, Imote2, 频点, Linux程序调试
test_tos_mac.c ch_test()
1, 编译无法通过,提示TOSMAC_IOSETCHAN和TOSMAC_IOSGTCHAN,为了测试把需要的TOSMAC_IOCTL_MAGIC,TOSMAC_IOSETCHAN和TOSMAC_IOSGTCHAN直接放在ch_test函数前,并且在ch_test后用"#undef"取消定义。编译通过后,修改了"linux/tosmac.h"文件使其与驱动中ioctl幻数和cmd定义一致。
2, 频点测试总是有问题,下午查错误代号:
开始是9,结合程序发现ch_test中重复定义了tosmac_dev,所以全局变量tosmac_dev在该函数中没有起作用。
#define EBADF 9 /* Bad file number */
后来设置频点返回值是0,说明函数返回正确,但是get频点的错误值是29:
#define ESPIPE 29 /* Illegal seek */
后来发现它的返回值也是正确的频点值,说明函数正常返回,errno与这个函数无关。
17:26 2007-05-16
修改多线程程序,运行出现:Killed
用gdb调试,运行到466行出错:
466 if ( pthread_create(&th_write,NULL, th_CC2420_write,
下面是gdbserver的log
[root@Imote2-2 nfs]#./gdbserver hostPC:2345 test_tos_mac_0516-3_mtt
Process test_tos_mac_0516-3_mtt created; pid = 1534
Listening on port 2345
Remote debugging from host 192.168.99.100
CC2420(TOSMAC) driver test:
insert module tos_mac first (modprobe tos_mac)
no correct parameters.
input two integer as args:
5000 200
0: time_accuracy_test using gettimeofday
1: imote2_time_sync
2: bacic send test
3: bacic recv test
4: poll recv test
5: write_poll_read_test, write period is 1s
6: multithread test
7: duplex tramsmition test
8: channel test
9: poll, write. test CC2420_state between poll and write
10: poll_read_write_0514
Select function to test
6
Child terminated with signal = 9
Child terminated with signal = 0x9 (SIGKILL)
GDBserver exiting
发现是把数值赋给了指针,所以出错。
把
if ( pthread_create(&th_write,NULL, th_CC2420_write,
(void*)&write_circle_time ) ) {
改为
if ( pthread_create(&th_write,NULL, th_CC2420_write,
(void*)&write_circle_time ) ) {
修改后,无此错误。
21:35 2007-05-17
Ctrl+c
Unix书p168.
10:06 2007-05-18
网址, 博客, Linux, 常用
http://www.linuxdiyf.com/blog/index.php/41903/action_spacelist_type_blog.html
23:29 2007-5-20
软件工程, 文档
http://www.coofile.com/
在这里下载了软件开发规范大全,用户名bamv26
其它相关:
http://data.csai.cn/
希赛网IT资料下载
11:23 2007-05-21
待做
1, 改写简历。今晚打印。明天moto实习宣讲带三份简历;看上次记录的moto linux的博客;
2, 周二晚上继续看tomson等公司。
13:54 2007-05-23
c语言技巧, mask, 可用于MSP430 单片机开发板
判断status寄存器中CC2420_XOSC16M_STABLE位是否是1:
1, MCU中mask常用的方法是
#define CC2420_XOSC16M_STABLE 0x40
status & CC2420_XOSC16M_STABLE
2, CC2420的方法是
status & (1 << CC2420_XOSC16M_STABLE )
CC2420_XOSC16M_STABLE是固定的,在头文件中用define定义,用枚举无法保证数值固定。
后者结构更清楚,但是由于需要移位所以开销也大,对于低性能的MCU来说不划算。但如果把1 << CC2420_XOSC16M_STABLE改为用宏定义定义,用于MCU还是很不错的,尝试,待做。
17:35 2007-05-23
法电实习, 重要
zjh: open source. deny Huang(黄shi yun)。做嵌入式Linux开发,据说是法电中很有实力的>一组。
14:55 2007-05-24
LEON, Linux
Help Please,Grmon error inside.
Posted by: "peter03030303" peter03030303@yahoo.com peter03030303
自LEON maillist,也是Linux启动的问题。供下阶段继续尝试LEON Linux做参考。
15:53 2007-05-24
关注, 待做
http://forum.eetchina.com/FORUM_POST_1200033118_0.HTM?click_from=1000012208,8883567706,2007-05-24,EECOL,FORUM
小弟想研究一下利用FPGA做FSK解码,那位高手能给概述一下具体的过程。不胜感激!
发布时间: 2007-5-24 下午2:10
提问者: 刘工
等级: 遁门入道
积分: 256分
按照数字锁相环DPPL,但前端一定要有滤波特性好的带通滤波器。
0:03 2007-5-25
待做
ftp://gaisler.com/gaisler.com/linux/snapgear/
http://www.gaisler.com/cms/index.php?option=com_content&task=view&id=160&Itemid=108
6:12 2007-5-25
法电实习
工作效率,即使两个事情一起做效率也很低。从上午9:30到公司,下载完6个板子的bootloader给张宇和范佳璐。到了中午1点。
10:21 2007-5-27
网址, 博客, 龙芯
http://www.ednchina.com/blog/chwb/20370/message.aspx
原来龙芯,国产的吗?
http://www.ednchina.com/blog/riple/
原来龙芯,国产的。
16:18 2007-5-27
CPU源代码分析
16:20 2007-5-27
待做
1, 6-1或6-9例会介绍法电实习内容和体会。wsn,软件工程,组内分工。带两个节点到实验室,给大家演示。5-30前准备好ppt初稿,5-30中午前问王伟是否主持6-1例会。
2, 拓展验室服务器应用范围:使用sudo给一般用户分配root权限。这样就可以使用例如交叉编译。在本机试验成功后找候哥。
22:42 2007-5-27
MSP430单片机开发板
应甘军宁要求整理了2006年兼职做的单片机通过usb接口与PC通信的文档资料(不包括代码)。保存于"MCU单片机\51单片机\c8051_PTT电话项目\项目总结\单片机USB接口方案"
17:58 2007-05-29
Linux命令, 删除修改网关(gateway), route
[bamv26@localhost ~]$ sudo /sbin/route del default
Password:
[bamv26@localhost ~]$ /sbin/route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.17.0.0 * 255.255.255.0 U 0 0 0 eth0
[bamv26@localhost ~]$ sudo /sbin/route add default gw 172.17.0.6
[bamv26@localhost ~]$ /sbin/route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.17.0.0 * 255.255.255.0 U 0 0 0 eth0
default 172.17.0.6 0.0.0.0 UG 0 0 0 eth0
18:19 2007-05-29
1, 测试pause函数
是否是收到信号处理函数返回后开始执行。
2, Linux如何处理不同信号的优先级。
17:11 2007-5-30
待做
1, 学习fifo或队列队列的使用,希望每天能读200行以上,或写50-100行以上;
2, 查汉王笔试中不会的题目。
16:44 2007-5-31
模拟电路, 三极管, 表贴元件(SMT), 如果确定三极管的三个电极?
自: http://forum.eetchina.com/FORUM_POST_1200033727_0.HTM?click_from=1000012208,8883567706,2007-05-31,EECOL,FORUM
提问者: 959595救我呦!!!
拿到一个贴片NPN三极管,不用万用表,怎么确定e、b、c?
提问者: szxhb
首先把贴片的三极管方直,2脚的朝自己,中间一脚朝上面,从左向右,左边脚是B,右面脚是E,上面一脚是C.
提问者: SMS
楼上的说得很正确,我用的9014就是这样.
21:18 2007-5-31
网址, 嵌入式, arm, IDE, 开发工具
http://www.realview.com.cn/
Embedded development tools, Realview tools by ARM.
ARM处理器开发工具,参"ARM与英蓓特发布中国版RealView微处理器MDK=+keil_支持Cortex-M3.txt"