其他分享
首页 > 其他分享> > 闫刚 ygOS设备管理

闫刚 ygOS设备管理

作者:互联网

文章目录

资源

device_manage.md
https://github.com/yangang123/ygOS
闫刚 ygOS设备管理

设备注册方法

int register_driver(const char*path, const struct file_operations *fops, void *priv)          

举例子

//注册驱动节点
register_driver("/dev/ramlog", &g_ramlogops, (void*)0);

//通过VFS读取文件
echo("log", "/dev/ramlog");
cat("/dev/ramlog");

标签:const,void,dev,ygOS,ramlog,闫刚,设备
来源: https://blog.csdn.net/yangang185/article/details/100548126