before i get into how to use plan 9 it is important to explain why plan 9 does things the way it does plan 9 was started at bell labs by many of the same people who'd created unix unix was designed to work with the hardware at the time which was a central computer with limited storage and simple text-only terminals attached to it all the computer resources were in one location and so the design of unix made sense for what was available this is a world where computers were centralized and a strictly hierarchical view of their
resources was understandable fast forward a couple of decades the 1990s and the world of computers was very different computer manufacturers had started making servers for more specialized tasks databases office collaboration computer graphics computers have become smaller and cheaper and now people could have private workstations at their own desk mice and graphical interfaces have become the norm with all this the highly centralized and hierarchical view of computing resources had started to become anachronistic people at bell labs took one of the unix ideas to the extreme the idea that everything should be treated as a file they
also looked at the way computer networks were going and decide to tightly integrate connections to remote file systems if all computer resources look like files and remote files can appear as if they're local given that permissions are granted you could easily make a system where the resources of many computers can be accessed at one location the old convention and unix of having a central file system that device files and remote files could be globally mapped to had to go in its place was a hierarchical directory like namespace that was not only a pure abstraction but
was also created on a per-process basis on this old dell that i have installed nine front onto it appears to have a unix-like file system there's a root directory at slash and it has other directories in it ns is the command to show your current name space mount adds something to the namespace and bind overlays files from one place into another some systems call this a union mount we can see that this boot device is mounted at slash root and then slash root is bound to slash and then other devices are bound to slash dev
and a few other places one of the things to note is this bind amd64 slash bin to slash bin when the system boots up it uses a cpu type to set which binaries to put into the bin directory since it mounts it there we can unmount it so we can see now that the shell no longer finds any programs in slash bin but this window still has slash bin since namespaces can be handled per process we can just end the process with the broken namespace if we start another shell it will have the default namespace
back it isn't so much that it gets a default namespace as it inherits one let's mount the boot partition in the shell there's a script that automates this rather than typing out the mount command and this will automatically mount it in slash n and there's the boot files if we go over here it doesn't see them namespaces can be shared from a parent ch parent process to a child process to show that i'll run the window manager in this window here so everything in this environment now sees nine fat as being part of the name
space many of these sort of features have been added to other operating systems but they started in plan 9 and are pervasive here let's look at the namespaces again we can see that a lot of things don't look like directories the ones starting with a hash sign these are devices supplied by the kernel like most things they can be treated as files and directories a list of what your kernel offers is in a file called dev drivers since all these things can be treated like files or directories we can poke around in them using regular
shell tools this uh let's see here this hash s device is the sd interface for the internal drives from the install video we know the sd e0 is the internal hard drive and there are a list of partitions on the hard drive uh even the window system messes with the namespaces so we can just read from the mouse device as a text file so i move the mouse around we can see the output of it but if i move it outside the window it stops reading anything but each window has its own private namespace so
if i start another window we can see each window has its own mouse that it can see each window actually has its own private mouse keyboard and console log each one provided by the window manager there are a lot of things about plan 9 systems that look a lot like unix and they were developed by the same people but the appearance is deceiving because under the hood things behave very differently and pretty much everything i'll be covering about using plan 9 systems is affected by this the the first app to break is thinking that there
is a root file system underpinning everything there are file servers some is disks holding data as files and some is unix-like file or device files and some are synthetic files created on the fly by programs and all these can be mapped into a namespace later on i'll be putting together a network of plan 9 systems and show how one can do things like load the operating system and applications from one computer play music through the sound card on another while browsing files stored on a server somewhere over the internet for now like if you found
this helpful and feel free to leave questions or comments below