简单的内存文件系统
有人可以向我指出内存文件系统的简单(不能强调这一点)实现吗?如果我可以创建一个文件并执行一个简单的 cat file.txt 就足够了。
我想将它用作我的玩具操作系统的一部分。
Can anybody point me to a simple (can't stress this enough) implementation of an in memory file system? If I can create a file and do a simple cat file.txt it's more than enough.
I would like to use it as part of my toy OS.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
OSDev wiki 站点可能会帮助您。您也可以在那里提出您的问题,如果您查看 wiki 和他们的论坛,您很可能会得到答案。
The OSDev wiki site might help you. You can also ask your questions there and if you look at wiki and their forum you will pretty likely get your answer.
在我看来,内存文件系统应该尽可能基本。这是一个在 Windows 用户模式下实现的虚拟文件系统,但其设计原理可以在您自己的操作系统中使用。 http://www.flipcode.com/archives/Programming_a_Virtual_File_System-Part_I.shtml 。即使这对于您的基本操作系统来说也可能太多了。我说的是,只需创建一个文件描述符的链接列表,其中仅包含每个文件的文件属性、文件名和文件路径。
In my opinion, in-memory file systems should be as basic as possible. Here is a virtual file system implemented in user-mode from Windows, but its design principals can be used in your own OS. http://www.flipcode.com/archives/Programming_a_Virtual_File_System-Part_I.shtml . Even this might be too much for your basic OS. I say just wing it and create a linked list of file descriptors that include only file attributes, file name, and file path with each file.
这属于超级用户恕我直言,但无论如何,您可能想看看ImDisk。仅仅创建一个 RAM 磁盘就足够了。等等,我读错了……这是给你的“玩具操作系统”的?你的玩具操作系统支持文件系统吗?您必须自己实现它,因为预先存在的东西不可能与您自制的操作系统一起工作。
This belongs on Super User IMHO, but anyway, you might want to look at ImDisk. It should be more than enough for just creating a RAM disk.Wait, I misread... this is for your "toy OS"? Your toy OS supports file systems? You're going to have to implement it yourself, since there's no way something preexisting will work with your home-made OS.