filesystems - 什么是文件系统协议(protocol),它是如何工作的?

标签 filesystems terminology protocols

作为示例,我将选择 Plan9 的文件系统协议(protocol),称为 9P(又名 Styx)。
正如维基百科中的文章所述:

9P is a network protocol developed (...) as the means of connecting the components of a Plan 9 system



我想知道,从编程的角度来看,应该使用哪些技术来构建这样的模块通信系统。操作系统(阅读 Unix 衍生产品)支持此协议(protocol)的要求是什么。

在我的理解中,整个网络的每个组件(id est、application、module)都必须有一个私有(private)的 Controller (或者这个 Controller 是否应该在整个系统中共享?),来发送请求和接收响应,并具有执行翻译的能力单个应用程序的内部逻辑和通信协议(protocol)本身之间的任务(可能是一种特定的语言,例如 XML?、数据库,甚至是某种文件系统信息的反射?)。从这个(我的)观点来看,所描述的系统可能被定义为客户端-服务器架构的变体,但被投影到本地或受限网络范围,并强调直接数据访问和效率。这就是我如何看待文件系统协议(protocol)的设计......

我刚刚开始研究操作系统的进程/应用程序通信技术,并想开发一个迷你文件系统协议(protocol)来查看这些概念的实际应用。由于理论基础的泄露,本人没有任何真实具体的工作计划,欢迎大家多多解释、文献建议、实例和评论!

最佳答案

您可以在 /sys/doc 中阅读有关 Plan9 网络的所有信息。部分(或在线 htmlpspdf )。

这个工作的高级方式与您的理解相似,系统有 17 条协议(protocol)消息(诸如 opencreatewalkremove 之类的东西)。有一个RPC负责从服务器发送和接收消息的机制。这是论文的引述:

A kernel data structure, the channel, is a handle to a file server. Operations on a channel generate the following 9P messages. The session and attach messages authenticate a connection, established by means external to 9P, and validate its user. The result is an authenticated channel referencing the root of the server. The clone message makes a new channel identical to an existing channel, much like the dup system call. A channel may be moved to a file on the server using a walk message to descend each level in the hierarchy. The stat and wstat messages read and write the attributes of the file referenced by a channel. The open message prepares a channel for subsequent read and write messages to access the contents of the file. Create and remove perform the actions implied by their names on the file referenced by the channel. The clunk message discards a channel without affecting the file.



Plan9 的巧妙之处在于该接口(interface)在操作系统中无处不在。很多东西都存在这个接口(interface)(文件服务器)。

关于filesystems - 什么是文件系统协议(protocol),它是如何工作的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4674824/

相关文章:

c++ - boost::filesystem - 如何在 posix 平台上从 Windows 路径字符串创建 boost 路径?

lisp - John McCarthy 所说的*色情节目*是什么意思?

automated-tests - 自动化浏览器测试的简短通用术语是什么?

swift - 如何使 CoreData 模型符合协议(protocol)?

sockets - 将 "Large"数据文件传输到服务器的简单 TCP 协议(protocol)

android - 在哪里可以创建对 Windows 资源管理器和我的 Android 应用程序可见的目录?

windows - 如果应用程序未运行,如何删除文件?

php - Eclipse PDT - 文件系统更改或新的 Composer 自动加载路径会破坏自动加载器

terminology - 在编译器构造中,符号是否与标记相同?

ios - 打开 Google map 应用 iOS 6(网络应用)