4
12
Fork
You've already forked LensorOS
4

EVERYTHING is a File System #24

Merged
LensPlaysGames merged 29 commits from everything_is_a_filesystem into main 2024年03月03日 22:07:54 +01:00

Basically, there used to be a "leapfrog" design in the file driver stack, where the VFS would leap the file system entirely in favor of using the device driver itself.

Upon reflection, a few things became clear:

  1. The VFS, or virtual file system, should almost definitely only operate with file systems, and the way we do that is through file system drivers. If it was the virtual device system, maybe this leapfrog would make sense.
  2. Expanding a file is impossible with the leapfrog design, as well as a lot of other things like caching then flushing.

So, all the sort of "meta" drivers (Lensor domain sockets, pipes, etc) that used to be implemented as device drivers are now file system drivers.

Driving this change is the lack of an ability to "discover" anything on LensorOS; if you don't know an exact path, you don't know how to do anything. In hopes of implementing a basic ls, I needed a way to get directory data, and that sparked this whole line of changes.

Basically, there used to be a "leapfrog" design in the file driver stack, where the VFS would leap the file system entirely in favor of using the device driver itself. Upon reflection, a few things became clear: 1. The VFS, or *virtual file system*, should almost definitely only operate with file systems, and the way we do that is through file system drivers. If it was the virtual device system, maybe this leapfrog would make sense. 2. Expanding a file is impossible with the leapfrog design, as well as a lot of other things like caching then flushing. So, all the sort of "meta" drivers (Lensor domain sockets, pipes, etc) that used to be implemented as device drivers are now file system drivers. Driving this change is the lack of an ability to "discover" anything on LensorOS; if you don't know an exact path, you don't know how to do anything. In hopes of implementing a basic `ls`, I needed a way to get directory data, and that sparked this whole line of changes.
Previously, they were just StorageDeviceDrivers. But, I think the new
squeeze is, we will have the VFS only interact with FilesystemDrivers,
rather than the current "tunneling" from the VFS to the storage device.
This is necessary but just hasn't been done yet due to the sheer size
of the change. Everything will be broken for a long, long time.
Now just sockets, pipes, input to go...
Now just sockets, pipes to go...
Now just sockets to go...
Make VFS call `directory_data` on FilesystemDriver, and implement
`directory_data` for FAT driver.
You know how when you plug a USB drive in it has a name that pops up?
That name is stored in the root directory in a volume label directory
entry in the FAT. Our directory_data implementation was including this
volume label as a regular file, when it really isn't one; this changes
it to skip past any and all volume labels it sees, so as to only
return regular files and subdirectories.
Basically, we need to convert 8.3 format into the format we convert
8.3 into on intake, that way the user can type that and get back to
the nonsense that's stored in the filesystem itself
Basically, I can't figure out how to do this properly. Doing it in the
kernel thread like we were before causes iterator invalidation across
yields.
I think what we may want to do is, in the main loop in the kernel
thread, to check for a threshold amount of page maps that need freed,
and, if it has been passed, DISABLE INTERRUPTS (no yield), free them
all, then reenable interrupts to allow for a yield away.
Sign in to join this conversation.
No reviewers
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
LensPlaysGames/LensorOS!24
Reference in a new issue
LensPlaysGames/LensorOS
No description provided.
Delete branch "everything_is_a_filesystem"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?