linux - USB_MASS_STORAGE 和 USB_FILE_STORAGE 之间有什么区别以及如何最好地使用它?

标签 linux linux-kernel filesystems kernel embedded-linux

在 Linux 内核 3.4 中,USB_MASS_STORAGE 和 USB_FILE_STORAGE 有什么区别?

我想要一个运行内核 3.4 的嵌入式设备,以便在连接到 PC 时显示一个挂载点。这个挂载点应该在 PC 上可写,然后在嵌入式设备上从内存中读取。也就是说,嵌入式设备本地存储应该在内存中(比如ramfs)。我该怎么做?

最佳答案

如 Linux 内核 3.18 所述,CONFIG_USB_MASS_STORAGEUSB_FILE_STORAGE 的替代品:

The Mass Storage Gadget acts as a USB Mass Storage disk drive. As its storage repository it can use a regular file or a block device (in much the same way as the "loop" device driver), specified as a module parameter or sysfs option. This driver is a replacement for now removed File-backed Storage Gadget (g_file_storage).

到目前为止,我可以使用 CONFIG_USB_MASS_STORAGE 成功地将 /dev/mmcblk0p1 (am335x SoC) 暴露给 Windows:

modprobe g_mass_storage file=/dev/mmcblk0p1

关于linux - USB_MASS_STORAGE 和 USB_FILE_STORAGE 之间有什么区别以及如何最好地使用它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28031879/

相关文章:

linux - ASoC 驱动程序 : Which files are platform, 机器和编解码器驱动程序?

data-structures - Inode号的数据结构是什么样的?

linux - NGINX:允许多个端口可用于 https + 将所有 http 重定向到 https

linux - 临时文件中的 rpmbuild 错误

c - 哪个 Linux 内核函数创建了 'process 0' ?

linux-kernel - 设备树覆盖 : fragment numbers

c++ - 带有 Boost.Filesystem 的 InDesign 插件没有出现在程序中

linux - SCSS 。如何添加不是那些返回错误的所有文件?

windows - 使用 Winsock 的原始以太网帧

linux - 用于分析函数缓存行为的 SystemTap 脚本