runtimejs / runtime

[not maintained] Lightweight JavaScript library operating system for the cloud
http://runtimejs.org
Apache License 2.0
1.93k stars 128 forks source link

VFS filesystem layer #1

Closed iefserge closed 9 years ago

iefserge commented 10 years ago

Implement VFS filesystem layer. Provide access to initrd filesystem, mount to /initrd.

thomasqbrady commented 10 years ago

In another thread there was reference to using Ext2. If you're starting from scratch, may I please request a more fault-tolerant file system? Something like BtrFS or ZFS? I really think the community will appreciate it later, and it would be easier to change now, right?

iefserge commented 10 years ago

VFS is high level abstraction and interface for programs to every supported filesystem. So its easy to add new or replace an existing FS later. Ext2 was chosen because it should be much simpler to implement.

piranna commented 10 years ago

Wouldn't it be better to offer a higher-level filesystem API (FUSE)? Or are they at a similar abstraction layer?

iefserge commented 10 years ago

@piranna Sorry, haven't seen your last question. What higher-level filesystem API FUSE provides? I think it's just a userspace fs implementation.

piranna commented 10 years ago

fuse request an api with a command for each fs related linux system call. you can look at fuse4js. Another high level api is pyfilesystem.

iefserge commented 9 years ago

No longer relevant.

piranna commented 9 years ago

No longer relevant.

Why is it no longer relevant?

iefserge commented 9 years ago

@piranna Well, at the moment there is no filesystem and all files need to be bundled up into single javascript bundle using Browserify. I agree, that it would probably be a good idea to support mutable filesystem in a future and have a VFS integrated, but the current implementation I've been working on no longer fits into overall system design.

piranna commented 9 years ago

How works the current implementation? Maybe you could use something like fatfs module to have a basic filesystem where to work with...

iefserge commented 9 years ago

@piranna fatfs module is very cool, yep, we should be able to use it. This would require virtio disk driver implementation though.

piranna commented 9 years ago

You are right, first it should be added a disk driver, if not only possible filesystems would be memory-only.

piranna commented 9 years ago

I'm thinking: since fatfs return an object with the same API that the Node.js fs module this could be used as basis for the VFS so there's no need for a "pure" VFS mechanism, you could use the filesystem objects directly, or a filesystem object where other ones could be attached. VFS + FUSE(-ish) system + ad-hoc user defined filesystems all for the same prize :-D