标签:应用层 copy 3.0 之间 int 区分 ESS \n 方式
如果app只使用了write(fd, "hellowrite", 10);没有read的话,./app没有反应
error:如果该写了驱动,则应该重新安装驱动
#lsmod
Module Size Used by Not tainted
module_test 1087 0
# cat /proc/devices
# lsmod
# insmod module_test.ko
#mknod /dev/test c 250 0
#ls /dev/test -l
#./app
[ 143.016905] test_chrdev_open
open /dev/test su[ 143.175274] test_chrdev_write
[ 143.179043] test_chrdev_release
ccess.
j--->
[ 143.016905] test_chrdev_open ----------------->test_chrdev_open --------->test_chrdev_open 1. fd = open(FILE, O_RDWR);
open /dev/test success. -------------------->main 2.printf("open %s success.\n", FILE);
[ 143.175274] test_chrdev_write ----------------->test_chrdev_write --------->test_chrdev_write 3.write(fd, "hellowrite", 10);
[ 143.179043] test_chrdev_release ----------------->test_chrdev_release --------->test_chrdev_release 4.close(fd);
#./app
[ 566.922098] test_chrdev_open ----------------->test_chrdev_open --------->test_chrdev_open 1. fd = open(FILE, O_RDWR);
[ 566.923665] test_chrdev_write ----------------->test_chrdev_write --------->test_chrdev_write 3.write(fd, "hellowrite", 10);
[ 566.926485] test_chrdev_read ----------------->test_chrdev_read --------->test_chrdev_read 4.read(fd, buffer, 10);
[ 566.929342] test_chrdev_release ----------------->test_chrdev_release --------->test_chrdev_release 5.close(fd);
open /dev/test success. -------------------->main 2.printf("open %s success.\n", FILE);
标签:应用层 copy 3.0 之间 int 区分 ESS \n 方式
原文地址:https://www.cnblogs.com/Ocean-Star/p/9250363.html