file
kill
list
next
step
run
quit
watch
print
break
shell
gcc -g xxx xxx.c
./xxx
gdb xxx
file xxx
run
list
break number
run
watch string2[size-1]
next
step
1 udp
socket(...);
bind(...);
while(1)
{
recvfrom(...);
process(...);
sendto(...);
}
2 tcp
socket(...);
bind(...);
listen(...);
while(1)
{
accept(...);
while(1)
{
read(...);
process(...);
write(...);
}
close(...);
}
Step1:install toolchain
拷贝解压文件
#cp RT288x_SDK/toolchain/buildroot-gcc342.tar.bz2 /opt
#tar jxvf buildroot-gcc342.tar.bz2
新建文件
#mkdir /opt/buildroot-gdb
#mkdir /opt/buildroot-gdb/bin
Step2:install LZMA Utility
解压文件
#tar xvf RT288x_SDK/toolchain/lzma-4.32.7.tar.gz
#cd RT288x_SD...
fd = open("/dev/gpio", O_RDONLY);
if (ioctl(fd, RALINK_GPIO_SET_DIR_IN, RALINK_GPIO(0)) < 0) // 这里能看到对gpio号0设置输入模式
3. 使能gpio的中断功能;
if (ioctl(fd, RALINK_GPIO_ENABLE_INTP) < 0)
4. 注册进程的进程号到相应的gpio号,用来接收相应引脚发生中断时,接收来自中断处理程序发个应用进程一个信号。
info.pid = getpid();
info.irq = 0;
...
#include <fcntl.h>;
#include <unistd.h>;
#include <sys/types.h>;
#include <sys/stat.h>;
int open(const char *pathname,int flags);
int open(const char *pathname,int flags,mode_t mode);
int close(int fd);
#include <unistd.h>;
ssize_t read(int fd, void *buffer,size_t count);
ssize_t wr...
#include <unistd.h>;
int execl(const char *path,const char *arg,...);
int execlp(const char *file,const char *arg,...);
int execle(const char *path,const char *arg,...);
int execv(const char *path,char *const argv[]);
int execvp(const char *file,char *const argv[]):
#include <unistd.h>...
#include <unistd.h>
pid_t getpid(void);
pid_t fork();
int pipe(int fides[2]);
int sigemptyset(sigset_t *set);
int sigfillset(sigset_t *set);
int sigaddset(sigset_t *set,int signo);
int sigdelset(sigset_t *set,int signo);
int sigismember(sigset_t *set,...
cp -a $(rootfs_dir)/* $(target_out_romfs)
cp -f $(target_out_kernel)/fs/ext2/ext2.ko $(target_out_romfs)/lib/modules
cp -f $(target_out_kernel)/fs/mbcacke.ko $(target_out_romfs?lic/modules
cp -f $(target_out_user)/bin/* $(target_out_romfs)/usr/bin
vi...
su
apt-get install eclipse-cdt
apt-get install genromfs
apt-get install libncurses5-dev
apt-get install git
apt-get install mc
mc
uclinux
ctrl+O
.ACTIVE.sh
ctrl+O
make
#include
int main()
{
pr...