April 5, 2015



I'm new to very low-level programming. I'm C programmer and I have programming microcontrolers for only month. I also, when I'm child program very basic kernel with text mode and keyboard support(and buildtin shell).

I have an idea and expect somebody told me how hard is to realize. My idea is to create new directory in proc filesystem for each process and allows to mount ram or process filesystem to this direcotry.

Filesystem will be handled by kernel(ram filesystem) or by separate thread(process filesystem).

What's the reason?
Imagine GIMP can allow to access to edited image by this filesystem, wayland compositor can allow to access to windows screenshots by this filesystem, program can inform about thier state(starting, in progress, done), cp like program can share percent of task done, some information can be printet to file in this filesystem, servers could creare unix sockets on this fs, named pipes could be created on this fs(for example /proc/1/application-fs/logs/warning to get all warning), etc.

For example, we can do:
some_command &
waitforfile /proc/$pid/application-fs/output
some_other_command &
some_other_command2 &
ln -s /proc/$pid/application-fs/output /proc/$pid2/application-fs/input
ln -s /proc/$pid/application-fs/output /proc/$pid3/application-fs/input

Unfortunately, we cannot delete this fs and restore pid until some process uses file in this filesystem(in situation it was in memory) and there can be errors if the filesystem is handled by thread of application. Imagine that gimp's filters are separated programs and works directly on gimp's memory, using /proc/$gimp_pid/application_fs/images/1/layers/1/bmp_data

Click Here!