linux 嵌入式驱动程序测试实例
2014-04-26 23:44
267 查看
#include
#include
#include
#include
#include
#include
#include
int main() {
int fd,i,nwrite,nread;
char *buf = "hello/n";
char read_buf[6] = {0};
fd = open("/dev/fs",O_RDWR);
if( fd <= 0 )
{ perror("open");
exit(1); }
else printf("open ok!");
nwrite = write(fd,buf,strlen(buf));
if( nwrite < 0 )
{ perror("write");
exit(1); }
nread = read(fd,read_buf,6);
if( nread < 0 ) { perror("read");
exit(1); }
else printf("read is %s/n",read_buf); close(fd); exit(0); } //查看结果 // /var/log/messages
#include
#include
#include
#include
#include
#include
int main() {
int fd,i,nwrite,nread;
char *buf = "hello/n";
char read_buf[6] = {0};
fd = open("/dev/fs",O_RDWR);
if( fd <= 0 )
{ perror("open");
exit(1); }
else printf("open ok!");
nwrite = write(fd,buf,strlen(buf));
if( nwrite < 0 )
{ perror("write");
exit(1); }
nread = read(fd,read_buf,6);
if( nread < 0 ) { perror("read");
exit(1); }
else printf("read is %s/n",read_buf); close(fd); exit(0); } //查看结果 // /var/log/messages
相关文章推荐
- linux 嵌入式驱动程序测试实例
- linux 嵌入式驱动程序实例
- 嵌入式Linux设备驱动开发之:按键驱动程序实例
- 基于嵌入式Linux的千兆以太网卡驱动程序设计及测试
- 基于嵌入式Linux的千兆以太网卡驱动程序设计及测试
- 如何编写Linux设备驱动程序以及测试详细流程(附实例)
- linux 嵌入式驱动程序实例
- 嵌入式Linux之我行——S3C2440上LCD驱动(FrameBuffer)实例开发讲解(二)
- 在Ubuntu上为Android系统内置C可执行程序测试Linux内核驱动程序
- mini2440:最简单的嵌入式Linux驱动程序模块
- 嵌入式linux的NFS开发环境的建立及配置实例
- 小白日记18:kali渗透测试之缓冲区溢出实例(二)--Linux,穿越火线1.9.0
- 嵌入式Linux之我行——S3C2440上MMC/SD卡驱动实例开发讲解(一)
- 在Ubuntu上为Android系统内置C可执行程序测试Linux内核驱动程序
- 嵌入式Linux操作系统的驱动程序开发要点
- 嵌入式Linux驱动学习笔记(一)------第一个LED驱动程序
- 嵌入式Linux驱动程序开发要点
- 嵌入式linux之字符驱动程序的另一种写法
- 编写嵌入式Linux应用层驱动程序
- mini2440:最简单的嵌入式Linux驱动程序模块