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;
-
usb_ap:.$(USB_AP_OBJS)
-
. $(CC) $(CFLAGS) $(WFLAGS) -g -o usb_ap $(USB_AP_OBJS) $(WTOS_LIBS) -lrt
-
. 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中得代码。
具体步骤:
-
a) WTOS load the kernel image
-
b) Ctrl insert make globe variant "gdb_yes" change to 1; enter these words following
-
ml gdb_yes
-
1
-
.
-
c
-
c) run "app_name" from "Exec" at TC side;
-
d) gdb "app_name" from terminal;
-
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"
阅读(1370) | 评论(0) | 转发(0) |