Skip to content

Implement basic VFS#32

Draft
bartlomiej-stefanski wants to merge 57 commits intoOperacja-System:mainfrom
bartlomiej-stefanski:vfs
Draft

Implement basic VFS#32
bartlomiej-stefanski wants to merge 57 commits intoOperacja-System:mainfrom
bartlomiej-stefanski:vfs

Conversation

@bartlomiej-stefanski
Copy link
Member

@bartlomiej-stefanski bartlomiej-stefanski commented May 26, 2025

  • Create mount tree structure
  • Create inner pipes
  • Create path normalization (and other path algorithms)
  • Allow fs servers to register themselves in the filesystem
  • Create fs server resolver (from given path)
  • Create a protocol for communication between kernel and fs servers
  • Create async response-matching algorithm for communication with fs servers
  • Create fd data structure
  • Create open/close syscalls
  • Create stat alongside some file info structure
  • Create read / write syscalls
  • Create /dev/random as a simple demo of vfs driver
  • Create procfs as a complete demo of vfs driver

@Kamilosok
Copy link
Collaborator

Good protocol very nice, good documentation 🫶🏻

Copy link
Collaborator

@Kamilosok Kamilosok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite like
image
But I'm happy with the work.

Inx - Index

## K
Kompot - VFS FS Server Communication Protocoll
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure whether a panic, even a debug one, should be in this pr.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We needed a way to panic (for unwraps, etc.)

We kind-of assume such functionality will be on master when we merge (if so, then in a future rebase we will remove our solution)

[[nodiscard]]
size_or_err_t pstring_concat(pstring_t* dest, const pstring_t* first, const pstring_t* second);

#define PSTRING_WRITE(type) \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason for using this instead of _Generic ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ummmmm
Probably not...

If I were to make one up I would say that this way we could create 'private' definitions of pstring write with such macro.

But looking at this again we could just wrap pstring_memmove with with some sizeof inside and get the same features _Generic could provide without type switching

We would lose some performance that inline allows, but we do not care about that now.

}
}

static void vfs_test_pipes() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion test functionalities should be somewhat separated from the actually functional stuff

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are plans to create some unit-testing solution, will see how it goes

Also we do not currently implement public api (no syscalls etc) so this is the only place to sanity-check our code

in summary: this will not be here in future

while (*s) dputc(*s++);
}

void dputps(const pstring_t* ps) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was done to death in other pr's and even the current main repo. Please pull the existing stuff to avoid future merge conflicts

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current main does not implement pedantic-strings – this type originated in vfs

but there would be some reason in merging it into main in different pr

@Kamilosok Kamilosok added help wanted Extra attention is needed wontfix This will not be worked on labels Mar 4, 2026
@Kamilosok
Copy link
Collaborator

I'm not sure if this is a help wanted or wontfix situation so I'm adding both

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants