Spyke

Syndicated from the fediverse. Read and engage on the original instance.

View original on piefed.zip

12 replies

piefed.social

Stages of POSIX enlightenment:

  1. It couldn't possibly all be files
  2. It's all files
  3. What is a file, anyway?
  4. There's no such thing as a file
  5. It couldn't possibly all be files
  6. Everything is a file

Most people stop at stage 2, stage 3 hits when you decide to write a filesystem, stage 4 when you've finished your first filesystem. Stage 5 is when you start working on kernel internals. No one can tell you how to reach stage 6, you must discover it for yourself.

48
lemmy.ca

Unfortunately, no one can be told what a file is. You have to see it for yourself.

This is your last chance. After this, there is no turning back. You take the blue pill - the story ends, you wake up in your bed and believe whatever you want to believe. You take the red pill - you stay in Wonderland and I show you how deep the file system goes.

15

You'll know you've reached stage 6 when you seriously start considering running Plan 9 as a daily driver

6
sh.itjust.works

Okay, but what are blocks then? A file is really just a bunch of blocked stacked together with the inode metadata also sitting on another block, so is everything just blocks or because you can emulate a block device on a filesystem, are blocks themselves files? If that last part is true then files are infinitely recursive and my head is starting to spin.

3

You are almost ready to take the next step. But to do so, you must unlearn what you think you know. Write a filesystem that does not have blocks for a media without pages, and you will find the footprints of your next teacher.

1

But some things are directories (like cgroups). And Networknamespaces were also controled in a weird way.
And then there are kernel features which are not exposed through a file or syscall but through a special type of socket.

3

Yep, takes a moment to wrap your head around but the longer you read linux/unix documentation, the more it makes sense why it is the case.

35

You reached the end