【发布时间】:2018-10-20 08:14:07
【问题描述】:
我为嵌入式 Linux 内核金鱼 3.4 编写了一个驱动程序。现在我想从我在\dev 目录中编写的设备驱动程序测试我的ioctl 系统调用。在网上很多教程都建议编写一个简单的用户空间程序 c 来测试。但是,我不知道如何在像金鱼这样的嵌入式环境中做到这一点。它是安卓手机的模拟器。
static int goldfish_accel_ioctl(struct file* fp, unsigned int cmd, unsigned long arg){
switch(cmd){
case TEST:
printk(KERN_ALERT"Hello world ioctl!");
}
}
我在dev\ 目录中注册了一个特殊文件,名为accelrometer
希望我的描述有意义。
【问题讨论】:
标签: android-emulator linux-device-driver embedded-linux ioctl