2022-09-16 13:52:11 +08:00

25 lines
879 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# devFS 设备文件系统
  devfs是一种基于内存的伪文件系统设备可注册到devfs中。对上层模块及应用程序而言每个设备都是可操作的文件。
## 原理
  由于每个设备被抽象为文件,因此对于驱动程序而言,只需实现文件的操作接口,上层的应用程序以及其他系统组件即可操作文件操作接口来控制硬件设备。
## 目录结构
  按照设备的主类型的不同将多种设备放置在devfs的不同文件夹下.请注意,同一设备可以出现在不同的文件夹下。
- `char` 字符设备
- `block` 块设备
- `usb` usb设备
- stdio等设备放置在devfs的根目录下
## 设备注册
  驱动程序可使用`devfs_register_device()`函数将设备注册到devfs之中。
## 设备卸载
  【尚未实现】