Chinaunix首页 | 论坛 | 博客
  • 博客访问: 939080
  • 博文数量: 173
  • 博客积分: 3436
  • 博客等级: 中校
  • 技术积分: 1886
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-07 09:29
文章分类

全部博文(173)

文章存档

2016年(6)

2015年(10)

2014年(14)

2013年(8)

2012年(36)

2011年(63)

2010年(19)

2009年(17)

分类: BSD

2012-06-10 09:33:47

WTOS develop enviroment:
ubuntu 12.04, i386, GCC 4.6.3,
apt-get install mingw32
apt-get install vsftpd

#define FREE_MAGIC.     0xfedccdef
4.补齐一个数
 num += ((-num) & (USB_HOST_ALIGN - 1));
USB_HOST_ALIGN 是2的n次幂(8),如果num 不是8字节对齐的,则会使num8字节对齐。
 
3. struct thread
 
sigset_t t_sigset_blocked; //被阻止的信号,(即便pending中被置位,也不会去处理);
sigset_t t_sigset_pending;//待处理的信号,如果相应位被置位,并且没有被block,则会触发相应的动作;
sigaction_t *t_sigactions;
 
2. 应用程序gdb
1)makefile g;

  1. usb_ap:.$(USB_AP_OBJS)
  2. . $(CC) $(CFLAGS) $(WFLAGS) -g -o usb_ap $(USB_AP_OBJS) $(WTOS_LIBS) -lrt
  3. . cp $@ $(FTP)

2) 在编译目录下:输入gdb
file usb_ap;
target remote 10.151.120.153:8081;
 
add-symbol-file ~/wtos2/WTOS-main-check/WTOS-main/c10wnosdb/wnos.sym 0x100000 //添加kernel的sym文件
这样就可以同时gdb应用程序和kernel中得代码。
具体步骤:

点击(此处)折叠或打开

  1. a) WTOS load the kernel image
  2. b) Ctrl insert make globe variant "gdb_yes" change to 1; enter these words following
  3. ml gdb_yes
  4. 1
  5. .
  6. c
  7. c) run "app_name" from "Exec" at TC side;
  8. d) gdb "app_name" from terminal;
  9. f) set breaks and successfully debug the software
note:
add following sentence to ~/.gdbinit file
"
add-symbol-file ~/wtos2/WTOS-main/WTOS-main/c10wnosdb/wnos.sym 0x100000
target remote 10.151.120.153:8081
"
 
replace fprintf to printf in app, for it will fail in gdb debug process.
 
3)编译可以运行app的kernel
make.def中添加:
LINUX_API.     = yes
WIN32_API       = yes
ICA13           = yes
 
CONFIG_VMEM.   = yes
CONFIG_IPV6.   = yes
wnos.ini中添加:
LoadModule = $PF_wnos.symtab
LoadModule = "run -bg"
LoadModule = "exec -bg"
 
阅读(1315) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~