Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for FileSystem #40

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hanfil
Copy link

@hanfil hanfil commented Dec 9, 2020

I've added a filesystem class and linked it to the Console.
This is currently just a Proof-Of-Concept, a basis for future development. A complete linux file structure is therefor not created.
In the filesystem class I've added some commands to intereact with the files and directories.
cat /etc/passwd should ouput the root user.

The filesystem is modelled after how linux and windows operate, with linked-list. A inode/mft entry list, and a data entry list.

Currently there is no way to add content to files. To replicate linux, the console needs to support StdIn, StdOut, and StdErr; 0, 1, & 2.
If we can implement some concepts of that, it's easier then to add piping ( "|", "<", ">"), and add content to files.

Adding a filesystem class with commands to interact with the inode.
Linking the filesystem class to the console
@quentincaffeino
Copy link
Owner

quentincaffeino commented Dec 9, 2020

This is really neat!

  1. What you've done for me seems more like an in-memory fs (or fs emulator), correct me if I'm wrong. Because you could just pass commands like ls/cd/... to OS.execute.

  2. Another thing is, this probably won't make into default console configuration.

    Q: Why?
    A: I want to keep it as simple and flexible as possible, so that on the start you get only basic stuff but it can do a lot.

    Q: What is default configuration?
    A: This is what you get as soon as you install console and run your game. But that doesn't mean your FS wont be available in the console git repo (if you still would want it to). At some point in time I would love and need to introduce plugins (see issue Separate console into two modules: Console and Console Ui. #24). This would allow greater flexibility and smaller default configuration. Everything that isn't a core functionality could be moved to a plugin which could enabled by an end user, if he needs that functionality.
    EDIT: Also the nice thing about plugins is that you could develop that plugin in your own repo, not being dependent on me merging your work. This would require however end user to search extra stuff, but it could be easily solved by me having a list of plugins and links to them in console readme.

  3. To replicate linux, the console needs to support StdIn, StdOut, and StdErr

    Totally agree, I'll create and issue for that. If I would have time I would do that my self.

Thanks, this is an awesome POC, would be cool see it developed further.
Best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants