Skip to content

hellertime/manos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

manos - a Plan9 like operating system, but worse.
=================================================

Manos is an operating system which takes inspiration from the Plan9 operating system.
That is in manos, everything is a file. It does not actually implement the distributed
nature of Plan9, as manos is written for a system which does not yet have networking
and may never have it at all (we shall see). 

It does have a simmilar API to the 9p protocol, and so could be extended to a full
fledged Plan9 clone with some (substantial) effort.

The Kernel
----------

Kernel devices are represented by a common virtual device API. Each VDev presents itself
on the device tree. The VDev tree can be represented as a filesystem with interior nodes
representing directories and leaf nodes representing files.

The kernel maintains a table of VDev objects. In addition to the VDev table, the kernel also maintains
a per-process Mount table. The Mount table maps a VDev path onto another VDev path, this allows for
certains paths in the global filesystem to be managed by an individual VDev. These Mount objects are 
realized as pairs of VNodes. In addition a VNode handle can link to sibling VNodes. This
allows a single Mount point to actually be the union of multiple mountpoints.

(When walking a union of VNodes the walk will be done in a depth first manner).

Mounting
--------

The kernel has three operations to manipulate the namespace:

1. mount

mount is used to map a Vdev into the namespace at a given path. It takes an optional relative path so
that Vdev[path] is what gets mounted at the destination instead of Vdev[/].

The destination of a mount must be a directory.

2. bind

bind maps two existing namespace paths. Bind(src, dst) will result in a walk to dst in the filesystem
follwing through to src. For bind the rule is like to like. Ie you can bind a directory to a directory or a
file to a file, but not to each other.

3. unmount

unmount undoes the work of mount or bind. effectively removing the entry from the mount table. It is possible
to give umount a extra argument to remove a single part of a unioned mount.

* Unions

Optionally mount and bind can be used to union directories. In this case an operation like Bind(src,dst, AFTER)
would be the same as Bind(dst,dst); Bind(src, dst, AFTER);

Walking
-------

To navigate the global filesystem, a process first obtains a VNodeHandle at some path in the filesystem.
This path can be relative to another path, it can be absolute to the '/' root path, or it can be absolute
to a specific VDev tree. The walk proceeds down the tree following nodes. If a node is missing the walk 
'fails' and results in the parent to the missing node. If the walk crosses a mount point it decends into 
the mount point and restarts the walk relative to the new path.

In the end the walk will result in a new VNodeHandle at either the requested node or the node parent if 
the requested node is missing.

NOTE: This behaviour is just a contract. A Vdev can screw it up and the system will collapse. There is
no protections in place to ensure contract adherence. Just common sense.

About

Manos - The Operating System of Fate

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published