mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-09 11:16:47 +00:00
doc: devfs文档
This commit is contained in:
parent
ed594f1054
commit
2d1af61813
24
docs/kernel/filesystem/devfs/index.md
Normal file
24
docs/kernel/filesystem/devfs/index.md
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# devFS 设备文件系统
|
||||||
|
|
||||||
|
  devfs是一种基于内存的伪文件系统,设备可注册到devfs中。对上层模块及应用程序而言,每个设备都是可操作的文件。
|
||||||
|
|
||||||
|
## 原理
|
||||||
|
|
||||||
|
  由于每个设备被抽象为文件,因此对于驱动程序而言,只需实现文件的操作接口,上层的应用程序以及其他系统组件即可操作文件操作接口来控制硬件设备。
|
||||||
|
|
||||||
|
## 目录结构
|
||||||
|
|
||||||
|
  按照设备的主类型的不同,将多种设备放置在devfs的不同文件夹下.请注意,同一设备可以出现在不同的文件夹下。
|
||||||
|
|
||||||
|
- `char` 字符设备
|
||||||
|
- `block` 块设备
|
||||||
|
- `usb` usb设备
|
||||||
|
- stdio等设备放置在devfs的根目录下
|
||||||
|
|
||||||
|
## 设备注册
|
||||||
|
|
||||||
|
  驱动程序可使用`devfs_register_device()`函数将设备注册到devfs之中。
|
||||||
|
|
||||||
|
## 设备卸载
|
||||||
|
|
||||||
|
  【尚未实现】
|
@ -10,3 +10,4 @@ DragonOS的文件系统模块由VFS(虚拟文件系统)及具体的文件系
|
|||||||
vfs/index
|
vfs/index
|
||||||
fat32/index
|
fat32/index
|
||||||
rootfs/index
|
rootfs/index
|
||||||
|
devfs/index
|
||||||
|
Loading…
x
Reference in New Issue
Block a user