<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
	<channel>
		<title>Nikita Popov&#39;s Capsule (en)</title>
		<link>https://polyserv.xyz/en/</link>
		<atom:link href="https://polyserv.xyz/en/atom.xml" rel="self" type="application/atom+xml" />
		<description>Recent content on Nikita Popov&#39;s Capsule</description>
		<generator>Hugo</generator>
		<language>en</language>
		<copyright>POLYSERV BY MODERN HOME</copyright>
		<author> ()</author>
		<managingEditor> ()</managingEditor>
		<webMaster> ()</webMaster>
		<lastBuildDate>2025-10-06T12:54:56Z</lastBuildDate>
		<item>
			<title>Lets type?</title>
			<link>https://polyserv.xyz/en/posts/2025-03-31-lets-type/</link>
			<description>Directly to Plan 9!</description>
			<itunes:summary type="html"><![CDATA[<h2 id="plan-typewriter">Plan &ldquo;Typewriter&rdquo;</h2>
<p>I hasten to inform you that I have launched a project to return the <strong>UNIX</strong>typewriter to <strong>Plan 9</strong>/<strong>9 front</strong> - <strong>Plan &ldquo;Typewriter&rdquo;</strong><sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>.
The project is focused on preparing an environment that ignores the mouse completely and allows you to work without removing your hands from the keyboard.</p>
<blockquote>
<p>&ndash; We built, built, and finally built! Long live us, hooray!</p></blockquote>
<p>So far, it is ready ** very basic** only the window manager - <strong>nwm</strong>.
At this stage, this is a fork of <strong>rio</strong> from the <strong>9front</strong> project, to which I added the rendering of the navigation bar and the processing of hotkeys.
When developing the interface, I was inspired by <strong>dwm</strong><sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup>, a simple and concise window manager for the X server.
Only working with windows and the file system will remain directly from <strong>rio</strong>.
As development progresses, everything &ldquo;superfluous&rdquo; will be removed to reduce the amount of code.</p>
<p>I&rsquo;ve been hatching the idea for about a year.
The project seemed too complicated and unaffordable to me.
But one day I decided to make a couple of sketches of the bar rendering.
It just went on by itself&hellip;</p>
<p>On the way as well:</p>
<ul>
<li><strong>st</strong><sup id="fnref:3"><a href="#fn:3" class="footnote-ref" role="doc-noteref">3</a></sup>/<strong>foot</strong><sup id="fnref:4"><a href="#fn:4" class="footnote-ref" role="doc-noteref">4</a></sup>-like terminal emulator. So far, I&rsquo;ve only made small sketches and am diving into the technical details.</li>
<li><strong>Emacs</strong><sup id="fnref:5"><a href="#fn:5" class="footnote-ref" role="doc-noteref">5</a></sup>-like text editor, extensible (in the future) not just with its <strong>Lisp</strong> dialect, but with a full-fledged <strong>Scheme</strong> (I haven&rsquo;t decided which one to use yet).
As soon as everything is ready, it will be published on the project&rsquo;s website.</li>
</ul>
<h2 id="acme-off">Acme: OFF</h2>
<p>Acme (as conceived by the developers) is a system interface.
After all, if everything is a files and most of them are with text, then only a text editor is needed to work with the system.
But what I can&rsquo;t accept is the very limited keyboard support.
The editor is too mouse-oriented.
It also lacks syntax highlighting.
The idea is not to write code so complex that syntax highlighting is needed.
If you plan to limit writing code to &ldquo;Hello, world!&quot;&rsquo;s applications, then its capabilities should be quite sufficient.
But few people will be able to say that the code, for example, <strong>rio</strong> is simple.</p>
<p>So when developing, I used <strong>Emacs</strong> and immediately tested the code in <strong>9front</strong>.
And <strong>drawterm</strong> helped me in this.
When connected to <strong>Plan 9</strong> via <strong>drawterm</strong>, the machine&rsquo;s local file system is mounted to the current environment.
All files are available absolutely transparently.
Just go to the right directory, compile and run.</p>
<h2 id="amazing-c">Amazing C</h2>
<p>In the process, I discovered something very interesting about <strong>Plan 9</strong> dialect <strong>C</strong> - embedding structures.
We are used to the fact that in <strong>C</strong> you can use one structure inside another in two ways.</p>
<ol>
<li>As a variable:</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-c" data-lang="c"><span style="display:flex;"><span><span style="color:#66d9ef">struct</span> A {
</span></span><span style="display:flex;"><span>	<span style="color:#66d9ef">int</span> x;
</span></span><span style="display:flex;"><span>};
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">struct</span> B {
</span></span><span style="display:flex;"><span>	<span style="color:#66d9ef">struct</span> A a;
</span></span><span style="display:flex;"><span>};
</span></span></code></pre></div><p>After that, we can access the field from the structure <code>A</code> through <code>b.a.x</code>.</p>
<ol start="2">
<li>As an anonymous structure:</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-c" data-lang="c"><span style="display:flex;"><span><span style="color:#66d9ef">struct</span> B {
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">struct</span> {
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">int</span> x;
</span></span><span style="display:flex;"><span>    };
</span></span><span style="display:flex;"><span>};
</span></span></code></pre></div><p>This is especially noticeable when there is a high level of nesting of structures in large projects and long field names.</p>
<p>But in <strong>Plan 9</strong> dialect <strong>C</strong>, the developers didn&rsquo;t look back.
They will later transfer this behavior to <strong>Go</strong>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-c" data-lang="c"><span style="display:flex;"><span><span style="color:#66d9ef">struct</span> A {
</span></span><span style="display:flex;"><span>	<span style="color:#66d9ef">int</span> x;
</span></span><span style="display:flex;"><span>};
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">struct</span> B {
</span></span><span style="display:flex;"><span>	A;
</span></span><span style="display:flex;"><span>};
</span></span></code></pre></div><p>The field <code>x</code> is now available as native through <code>b.x</code>.
And you know what, it&rsquo;s very pleasant and convenient to work with it.
Especially after <strong>Go</strong>.
There is a small fleur of OOP (in the good sense).</p>
<h2 id="whats-next">What&rsquo;s next?</h2>
<p>I will certainly bring the application to 1.0 releases (not mean quickly).
I will develop the project as much as I can.
As always, I will not refuse advice and recommendations.
At this stage, the most important help you can provide to the project is the dissemination of information and commits/patches.
Yes, the project is currently at a very early stage.
But I did not say that this is Production-ready software.</p>
<p>The main purpose of this publication is to attract the attention of an already narrow community.
Maybe there are 3.5 people somewhere who wanted to see in <strong>Plan 9</strong> what they were used to on their <strong>UNIX</strong> machines.</p>
<p>If you are there, please respond!</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p><a href="https://plantypewriter.tech/">https://plantypewriter.tech/</a> Plan &ldquo;Typewriter&rdquo;&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p><a href="http://dwm.suckless.org/">http://dwm.suckless.org/</a> dwm - dynamic window manager&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:3">
<p><a href="https://st.suckless.org/">https://st.suckless.org/</a> st - simple terminal&#160;<a href="#fnref:3" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:4">
<p><a href="https://codeberg.org/dnkl/foot">https://codeberg.org/dnkl/foot</a> foot - A fast, lightweight and minimalistic Wayland terminal emulator&#160;<a href="#fnref:4" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:5">
<p><a href="https://www.gnu.org/software/emacs/">https://www.gnu.org/software/emacs/</a> GNU Emacs - An extensible, customizable, free/libre text editor — and more.&#160;<a href="#fnref:5" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></itunes:summary>
			<category domain="https://polyserv.xyz/en/posts/">posts</category>
			<guid>https://polyserv.xyz/en/posts/2025-03-31-lets-type/</guid>
			<pubDate>2025-03-31T19:00:00Z</pubDate>
		</item>
		<item>
			<title>Man and Web</title>
			<link>https://polyserv.xyz/en/posts/2025-03-09-man-and-web/</link>
			<description>Midnight thoughts</description>
			<itunes:summary type="html"><![CDATA[<blockquote>
<p>In no case do I pretend to be the truth.
Maybe I&rsquo;m completely mistaken somewhere.
But I post it to share my thoughts and understand myself.</p></blockquote>
<p>Lately, I&rsquo;ve been thinking more and more about the essence of the Web as a reflection of a Man.
By its very nature, a Man, like a Web, is decentralized.
Both have both vertical (bosses, cities, node routers) and horizontal (close, neighbors, local area networks) connections.
Is that why the original Web so easily overlapped with society and was accepted?</p>
<p>The original idea was simple - here are a handful of protocols that allow you to transfer information between nodes.
From person to person, from terminal to mainframe, from worker to shop supervisor, from computer to computer, and so on.
There are a lot of analogies here.
But if vertical connections in human society have a rather indirect effect on horizontal ones (you won&rsquo;t stop loving someone if you are ordered to), then horizontal connections in networks are extremely difficult to maintain.
Technology is not perfect and does not reflect well how a person builds connections in the real world.
We can get to know someone online, communicate, and belong to communities, but we depend on the site where this communication takes place.
Whether it&rsquo;s a game server, a forum, or a social network.
Just think about how many of you know your friends&rsquo; email in case the WathsApp or Telegram are closed.
At best, a cell phone number.</p>
<p>It is also important that a person is not inclined to perceive network connections as at least somewhat similar to real ones.
You&rsquo;re more likely to meet people at a concert than in the comments below a video or post.
And this lower weight of connections in the Web is difficult to condemn, because humanity does not live with them for so long.
Here you are communicating with people, strengthening your connection based on interests.
But suddenly the person disappears, and you don&rsquo;t have any other contacts.
He might just get bored and stop going on the platform for a while.
And without knowing it, you decided that he had left the resource forever, and you were leaving too.
Perhaps that is why we are all drawn to large resources where &ldquo;all friends are sitting&rdquo;.</p>
<p>But back to the protocols.
For example, RSS<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> and Atom<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup> are extremely simple protocols that people know almost nothing about.
Their essence is to convey the news to people in a simple way.
You don&rsquo;t need to visit your favorite website or blog to find out if there was any news.
The RSS reader will receive all the updates on its own and inform you about them.
But the ease of receiving this news in a decentralized manner has helped major news aggregators also receive this news, publish it, and thereby increase their already considerable audience.
After all, a person is simple and unpretentious, he will not check the original source.
This creates two excellent opportunities.
First, publish half-truths or lies.
Secondly, don&rsquo;t publish anything at all.
And we get censorship and the imposition of opinions based on the vector of editorial policy.
That is, what was originally intended to bring independence to people was used against them, in favor of selfish interests at best.</p>
<p>And so we find ourselves in a situation where, with a seemingly abundance of information, we find ourselves in an information cocoon that we don&rsquo;t even know we have.
For balance, we have, for example, as many as three different opinions about the same event.
The others before you were filtered, digested, and disguised.
You won&rsquo;t even know about it, because people learned to lie and manipulate long before the advent of the Web.</p>
<p>There have been other attempts besides RSS and Atom.
The most successful of them, of course, is email.
There are no options.
It appeared much earlier than large companies realized how to take advantage of such technologies.
And due to the steady growth of email, they are now in a situation where it is a very risky idea for them to lose backward compatibility.
Perhaps this is one good example of a protocol that could not be subdued and squeezed under itself.
But despite this, they do not stop trying to make a mail club &ldquo;for their own&rdquo; and continue to impose &ldquo;new&rdquo; and &ldquo;secure&rdquo; protocol extensions on us.
Dancing with certification authorities and PTR records alone is worth a lot.
I am already silent about the shadow blocking of the 25 TCP port by providers.</p>
<p>XMPP/Jabber<sup id="fnref:3"><a href="#fn:3" class="footnote-ref" role="doc-noteref">3</a></sup> was the least lucky.
Does anyone even remember it?
And it&rsquo;s not surprising, because the whole Google has put a lot of effort into suppressing its use.
Ban?
Blocking?
Be more cunning!
The good old tactic: if you can&rsquo;t win, take the lead.
They have launched their large XMPP service.
The same free cheese as the Gmail, but which was much easier to collapse.
The fact is that it is quite difficult and expensive to keep an XMPP server.
This requires a fairly large storage for chat histories, a stable connection, and round-the-clock server operation.
Only geeks could keep it for themselves.
Basically, people signed up at large nodes, which kept crashing, and people left for others.
That was until Google came on the scene.
And indeed, they will be able to provide user support.
Large nodes began to close due to the outflow of users.
And soon Google itself shut down support due to &ldquo;low demand&rdquo;.
What can you do against Google?
The funny thing about this is that XMPP/Jabber is still in use.
But you don&rsquo;t know about it.
After all, you don&rsquo;t care how WhatsApp works.
The RSS story repeated itself, almost one-on-one.
It was the same with personal websites and blogs: just switch to hosting or a platform.
And as a result, we have to count on our fingers the companies whose resources are used by, if not 90%, then certainly 70% of the planet.</p>
<p>People on large platforms don&rsquo;t belong to themselves.
Their correspondence is being read, information is being leaked, and is being used in behavior analysis, targeted advertising, and neural network training without their consent.
They can be automatically blocked at any moment for saying something that is &ldquo;incorrect&rdquo; from the platform&rsquo;s point of view.
And even despite the huge number of people on these platforms, they are all extremely lonely.
After all, as I have already said, the value of virtual communication is much lower than the real one.
Have a million followers or 100 friends, which one do you choose?
Moreover, the more subscribers you have, the less you belong to yourself.
Sincerity disappears, sponsors and advertisers appear.
Step to the left and you&rsquo;re an outcast without funding.
A commissioned article, a few corrected facts - no one will remember you tomorrow.
But even worse, you don&rsquo;t communicate.
It&rsquo;s a surrogate.
On the one hand, the content producer.
On the other hand, the consumer.
No love, no trust.
Just production and consumption.
Accurate calculation.
Does this really happen in real life?
No, of course, you can give examples of their category of &ldquo;so calm, sociable, but it turned out to be a maniac&rdquo;, but this is already a distortion.
Most often, people who know you personally will either not believe in slandering you at all, or ask you for your position on the situation.
Truth and sincerity are rarely truly alone.</p>
<p>But what is the purpose of separating us by false unity?
I&rsquo;m afraid I don&rsquo;t know the answer to this question yet.
All I know is that it all depends on us.
Yes, it&rsquo;s hard to keep your email server at least for your family.
But this is already a huge step at a fairly low price.
And I understand ordinary people who are far from information technology, and geeks who are not interested in this routine.
After all, it&rsquo;s so easier to go with the flow than to stand apart and even more so to go against.</p>
<p>In general my thought is very simple - protocols can only combine and cannot be evil in themselves.
Only in evil hands.
That&rsquo;s what happened with XMPP.
This is what happens with RSS.
And the corporate Towers of Babel did not originate on their own.
It&rsquo;s all the fault of people&rsquo;s idleness and vanity.
&ldquo;They give me free registration and chat, just a rare advertisement&rdquo;.
But the ads you see aren&rsquo;t even half of what you got.</p>
<p>The externaly Web may have changed in a similar way to humanity - tribes, villages, cities - but in fact this path has not been passed.
The analogy here is very simple - the revolution of 1917 in Russia.
They have not been able to make a communist out of a man by force for 70 years.
Even the socialists turned out to be so-so.</p>
<p>I repent, I have sinned.
But I&rsquo;m working on myself.
Until recently I tried Fediverse, but I found all the same flaws in it as on major platforms.
At the moment, the nostr<sup id="fnref:4"><a href="#fn:4" class="footnote-ref" role="doc-noteref">4</a></sup> protocol looks very promising to me.
But I find the clearest reflection of myself on the web at the moment in returning to the original Web - the website, RSS, and Plan 9, which is very close to my spirit.</p>
<p>But I believe that Mankind will be able to find their true reflection on the Web and the Web will cease to be an alien and hostile place for a Man.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p><a href="https://en.wikipedia.org/wiki/RSS">https://en.wikipedia.org/wiki/RSS</a> RSS&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p><a href="https://en.wikipedia.org/wiki/Atom_(web_standard)">https://en.wikipedia.org/wiki/Atom_(web_standard)</a> Atom&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:3">
<p><a href="https://xmpp.org/">https://xmpp.org/</a> XMPP&#160;<a href="#fnref:3" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:4">
<p><a href="https://nostr.com/">https://nostr.com/</a> nostr&#160;<a href="#fnref:4" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></itunes:summary>
			<category domain="https://polyserv.xyz/en/posts/">posts</category>
			<guid>https://polyserv.xyz/en/posts/2025-03-09-man-and-web/</guid>
			<pubDate>2025-03-09T02:40:13Z</pubDate>
		</item>
		<item>
			<title>Plan 9 Installation</title>
			<link>https://polyserv.xyz/en/posts/2024-11-02-plan-9-installation/</link>
			<description>Basic installation and configuration of the file server and authorization server</description>
			<itunes:summary type="html"><![CDATA[<p>Due to its rather unique architecture and the approaches used, the installation of <strong>Plan 9</strong> <strong>[9front fork]</strong> can raise a lot of questions even from an experienced system administrator.
Most of this article will be a revised information from the help on the project&rsquo;s website<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>.
The help does not reveal some subtle points, so I will try to supplement it with my experience.
In the process, I will use a KVM virtual machine.</p>
<h2 id="preparation">Preparation</h2>
<blockquote>
<p>&ndash; Don&rsquo;t grab it right away. Don&rsquo;t grab him right away, Urry. Find out how it&rsquo;s operated first. Find out how it&rsquo;s managed first.</p>
<p>&ndash; I didn&rsquo;t understand, repeat.</p>
<p>&ndash; Find out where his button is!</p></blockquote>
<p>Before you start, you have to answer a few questions:</p>
<ul>
<li>What configuration does your local network have?</li>
<li>What hardware is installed in your machine and is it supported in the OS? <strong>[a list of supported hardware is available on the project&rsquo;s website<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup>]</strong></li>
<li>What name will the machine and your user have?</li>
</ul>
<p>If you are having difficulties at this stage, then I advise you to stop and come back later.
After you have received the answers to these questions, we can move on.</p>
<p>First, download the appropriate installation <strong>ISO</strong> system image from the project website<sup id="fnref:3"><a href="#fn:3" class="footnote-ref" role="doc-noteref">3</a></sup> and create a bootable USB flash drive.
If you have chosen to install on a virtual machine for the first attempt <strong>[which I advise you]</strong>, then simply mount the disk image to the VM and start booting.
If everything was done correctly, you will see the boot process.</p>
<p>
<figure>
  <img src="/images/005_first_boot_1.png" alt="First boot" />
</figure>


</p>
<p>Also, during the first boot, you will be asked several questions.
In most cases, you can leave the default values <strong>[usually indicated in square brackets]</strong>, if they are available.</p>
<h3 id="user">user</h3>
<pre tabindex="0"><code> user[glenda]:
</code></pre><p>The suggested default user is <strong>glenda</strong>.
The system will be started on this machine under this user.
Such a user in the context of <strong>Plan 9</strong> is called <strong>host owner</strong>.
The concept of a <strong>root</strong> user has been abolished due to security concerns.
The host owner has high permissions on a specific machine, but is limited in access to other users files.
For the first installation, it is better not to change it.
Just hit <code>Enter</code>.</p>
<h3 id="vgasize-monitor-mouseport">vgasize, monitor, mouseport</h3>
<p>The following questions will ask for information about the display and mouse:</p>
<pre tabindex="0"><code>vgasize is (text, 640x480x8, 1024x768x16, ...) [1024x768x16]
monitor is (vesa, xga, lcd, ...) [vesa]
mouseport is (ps2, ps2intellimouse, 0, 1, 2) [ps2]
</code></pre><p>Based on the responses, the environment variables <code>$vgasize</code>, <code>$monitor</code> and <code>$mouseport</code> will be set.
These values will also be written to the <code>plan9.ini</code> file, from which they will be used for follow bootings.</p>
<ul>
<li><code>monitor</code> - any value other than <code>vesa</code> will skip <strong>VESA BIOS</strong> emulation and an attempt will be made to use the native <strong>VGA</strong> driver for the video card.
The list of displays and video cards supported by the system can be found in the file <code>/lib/vgadb</code>.
Additional information can be found on the help pages <strong>vga(3)</strong>, <strong>vga(8)</strong> and <strong>vgadb(6)</strong>.</li>
<li><code>vgasize</code> - used to store the resolution and bit depth of the display.
Here you can specify any value supported by your display.</li>
<li><code>mouseport</code> - the default value <code>ps2</code> should be suitable in most cases.
When installing on a laptop or using a mouse with a scroll wheel, you may need to set it to `ps2intellimouse'.</li>
</ul>
<p>After the booting is complete, you can change the set values in the <code>plan9.ini</code> file.</p>
<p>Example of the content of <code>plan9.ini</code>:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-ini" data-lang="ini"><span style="display:flex;"><span><span style="color:#a6e22e">monitor</span><span style="color:#f92672">=</span><span style="color:#e6db74">vesa</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">vgasize</span><span style="color:#f92672">=</span><span style="color:#e6db74">1024x768x16</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">mouseport</span><span style="color:#f92672">=</span><span style="color:#e6db74">ps2intellimouse</span>
</span></span></code></pre></div><p>
<figure>
  <img src="/images/005_first_boot_2.png" alt="First boot finishing" />
</figure>


</p>
<h3 id="startup">Startup</h3>
<p>After answering the questions, the boot process will try to launch the standard graphics multiplexer <strong>rio</strong>, welcoming you with a gray desktop with a running load monitor <strong>stats</strong> and a window with a <strong>rc</strong> shell.</p>
<p>
<figure>
  <img src="/images/005_livecdrio.jpg" alt="rio" />
  <figcaption>Impeccable grayness.</figcaption>
</figure>


</p>
<p>Keep in mind that if the user has been changed, then you will just see a gray screen.
Initialization ready only for the <strong>glenda</strong> user.
In all other cases, the system remains clean.</p>
<h3 id="a-little-bit-about-control">A little bit about control</h3>
<p>A three-button mouse is used to control the multiplexer <strong>rio</strong>.</p>
<ul>
<li>Left Mouse Button - focus indication and highlighting, nothing special;</li>
<li>Middle Mouse Button - context menu, which will vary for different applications;</li>
<li>Right Mouse Button -  <strong>rio</strong> menu, allows you to create, edit and delete windows.</li>
</ul>
<p>Applications run in windows <strong>rio</strong>.
But the most interesting thing is that in the <strong>rio</strong> window can be launched &hellip; <strong>rio</strong>.
And more. And more.</p>
<p>When working with a flash drive, this may be enough for a first acquaintance.
The system will save its state as a regular live image of any other OS.
So you can move on to the next articles in the cycle.</p>
<p>If you have sufficiently explored the live image of <strong>Plan 9</strong> and feel that you are ready to build a full-fledged computing network <strong>[in the context of Plan 9, the term grid is used]</strong>, then we continue.</p>
<h2 id="installing-the-basic-system">Installing the basic system</h2>
<p>The installation is performed by the <strong>rc</strong> script <code>/rc/bin/inst</code>.
To start the installation, run the <code>inst/start</code> command in the terminal.</p>
<pre tabindex="0"><code>term% inst/start
</code></pre><p>Follow the instructions to complete the installation, selecting the default values if necessary.</p>
<p>Each step can be repeated by entering its name in the prompt.</p>
<p>
<figure>
  <img src="/images/005_inst_start.png" alt="inst/start script" />
</figure>


</p>
<p>Now let&rsquo;s move on to the installation steps.</p>
<h3 id="configfs">configfs</h3>
<p>The <code>cwfs64x</code> file system uses permanent and temporary storage on different partitions.
The <code>hjfs</code> file system is more homogeneous, but works slower.
If you are installing to a disk of less than 12 GiB, you should choose <code>hjfs</code>.
In this example we will press <code>Enter</code> to accept <code>cwfs64x</code> as the default.</p>
<pre tabindex="0"><code>You can install the following types of systems:
    cwfs64x     the cached-worm file server
    hjfs        the new 9front file server (experimental!)
File system (cwfs64x, hjfs)[cwfs64x]:
</code></pre><p>
<figure>
  <img src="/images/005_configfs.png" alt="configfs" />
</figure>


</p>
<h3 id="partdisk">partdisk</h3>
<p>At this step, we need to create partitions.
The installation script will tell you which disks it was able to detect.</p>
<p>Select the one that is not an optical disc emulation and press <code>Enter</code>.</p>
<pre tabindex="0"><code>The following disk devices were found.

sdC0 - QEMU DVD-ROM
    empty                  0 3916        (3916 cylinders, 29.99 GB)
  * p1

sdF0 -

Disk to partition (sdC0, sdD0)[no default]: sdF0
The disk you selected HAS NO master boot record on its first sector.
(Perhaps it is a completely blank disk.)
Shall we create a blank EFI partition table (GPT)
or install traditional DOS partition table (MBR)?
</code></pre><p>Our disk is empty, so let&rsquo;s create a fresh <strong>MBR</strong> table.</p>
<pre tabindex="0"><code>Install mbr or gpt (mbr, gpt)[no default]: mbr

This is disk/fdisk; use it to create a Plan 9 partition.
If there is enough room, a Plan 9 partition will be
suggested; you can probably just type ’w’ and then ’q’.

cylinder = 8225280 bytes
</code></pre><p>For this example we will use the entire disk.
Accept the defaults.</p>
<pre tabindex="0"><code>&gt;&gt;&gt; w
&gt;&gt;&gt; q
</code></pre><p>
<figure>
  <img src="/images/005_partdisk.png" alt="partdisk" />
</figure>


</p>
<h3 id="prepdisk">prepdisk</h3>
<p>Due to the peculiarities of <strong>CWFS</strong>, we need to divide of the partition into subpartitions.</p>
<pre tabindex="0"><code>The following Plan 9 disk partitions were found.

/dev/sdF0/plan9
  empty                  0 62910477    (62910477 sectors, 29.99 GB)

Plan 9 partition to subdivide (/dev/sdC0/plan9)[no default]:
Use the Plan 9 partition created in the previous step. Type /dev/sdC0/plan9 and hit enter.
This is disk/prep; use it to subdivide the Plan 9 partition.
If it is not yet subdivided, a sensible layout will be suggested;
you can probably just type `w` and then `q`.

no plan9 partition table found
9fat 204800
nvram 1
other 8957953
fscache 8957953
fsworm 44789770
&gt;&gt;&gt;
</code></pre><p>Again, accept the defaults.</p>
<pre tabindex="0"><code>&gt;&gt;&gt; w
&gt;&gt;&gt; q
</code></pre><p>
<figure>
  <img src="/images/005_prepdisk.png" alt="prepdisk" />
</figure>


</p>
<h3 id="mountfs">mountfs</h3>
<p>Now that the subpartitions are created, we specify how to mount them and format them.
If the previous steps went without problems, then the installation script will detect the partitions we created on its own.
Just press <code>Enter</code> on each of the questions.</p>
<pre tabindex="0"><code>The please choose your cwfs64x partitions

--rw-r----- S 0 glenda glenda 4586471936 Jul  4 13:28 /dev/sdC0/fscache

Cwfs cache partition (/dev/sdC0/fscache)[/dev/sdC0/fscache]:
--rw-r----- S 0 glenda glenda 22932362240 Jul  4 13:28 /dev/sdC0/fsworm

Cwfs worm partition (/dev/sdC0/fsworm)[/dev/sdC0/fsworm]:
--rw-r----- S 0 glenda glenda 4586471936 Jul  4 13:28 /dev/sdC0/other

Cwfs other partition (/dev/sdC0/other)[/dev/sdC0/other]:
</code></pre><p>Since this is a fresh install, we choose yes to ream (format) the file system:</p>
<pre tabindex="0"><code>Since this is a fresh install, we choose yes to ream (format) the file system:
Ream the file system? (yes, no)[no]: yes
Starting cwfs64x file server for /dev/sdC0/fscache
Reaming file system
bad nvram key
bad authentication id
bad authentication domain
nvrcheck: can’t read nvram
config: config: config: auth is now disabled
config: config: config: config: config: config: current fs is &#34;main&#34;
cmd_users: cannot access /adm/users
63-bit cwfs as of Wed Jul  4 00:59:30 2012
    last boot Tue Jul 17 13:34:57 2012
Configuering cwfs64x file server for /dev/sdC0/fscache
Mounting cwfs64x file server for /dev/sdC0/fscache
% mount -c /srv/cwfs /n/newfs
Mounting cwfs64x file server for /dev/sdC0/other
% mount -c /srv/cwfs /n/other other
</code></pre><p>
<figure>
  <img src="/images/005_mountfs.png" alt="mountfs" />
</figure>


</p>
<h3 id="confignet">confignet</h3>
<pre tabindex="0"><code>We will configure the ethernet.

Please choose a method for configuring your ethernet connection.

    manual - specify IP address, network mask, gateway IP address
    automatic - use DHCP and SLAAC to automatically configure

Configuration method (manual, automatic)[automatic]:
</code></pre><p>
<figure>
  <img src="/images/005_confignet.png" alt="confignet" />
</figure>


</p>
<h4 id="automatic">automatic</h4>
<p>In this example, I will focus on the automatic configuration, since I have <strong>DHCP</strong> configured.
If you will also use <strong>DHCP</strong>, then do not forget to reserve the address on the server.</p>
<p>Hit <code>Enter</code> to move on to the next task.</p>
<h4 id="manual">manual</h4>
<p>Manual configuration is not difficult.
You just need to specify the <strong>IP</strong> address, network mask, gateway and <strong>DNS</strong> server.</p>
<pre tabindex="0"><code>Configuration method (manual, automatic)[automatic]: manual
ip address [no default]: 192.168.2.10
network mask [no default]: 255.255.255.0
gateway address [no default]: 192.168.2.1
dns server [192.168.2.1]:
starting ethernet manual config
</code></pre><h3 id="mountdist">mountdist</h3>
<p>We will tell the installation script where to look for the files to install.</p>
<pre tabindex="0"><code>Please wait... Scanning storage devices...
    /dev/sdC0/9fat
    /dev/sdC0/data
    /dev/sdC0/fscache
    /dev/sdC0/fsworm
    /dev/sdC0/other
    /dev/sdD0/data

The following storage media were detected.
Choose the one containing the distribution.

    /dev/sdD0/data (iso9660 cdrom)

Distribution disk (/dev/sdD0/data, /dev/sdC0/fscache, /)[/]:
</code></pre><p>The CD-ROM is already mounted at <code>/</code>, so type <code>/</code> and hit <code>Enter</code>.</p>
<pre tabindex="0"><code>% mount /srv/boot /n/distmedia

Which directory contains the distribution?

Location of archives [/]:
</code></pre><p>And again, the root directory of the CD-ROM is already mounted at <code>/</code>, so hit <code>Enter</code> to choose the default.</p>
<p>
<figure>
  <img src="/images/005_mountdist.png" alt="mountdist" />
</figure>


</p>
<h3 id="copydist">copydist</h3>
<p>At this step, the system distribution files will be copied from the install media to the hard disk.
Currently, there is no progress meter.
Disk activity may be verified by inspecting the stats(8) window.
Task may exceed one hour in duration depending on the speed of your disk.</p>
<p>
<figure>
  <img src="/images/005_copydist_progress.png" alt="Progress of copydist" />
</figure>


</p>
<p>Eventually, you should see the following:</p>
<p>
<figure>
  <img src="/images/005_copydist.png" alt="Finishing copydist" />
</figure>


</p>
<p>This indicates that the system files have completed copying to the install target.</p>
<h3 id="ndbsetup">ndbsetup</h3>
<p>Let&rsquo;s give our host a name.
By default, <strong>cirno</strong> will be assigned.</p>
<pre tabindex="0"><code>Setup network configuration

sysname [cirno]: test-fs
</code></pre><p>
<figure>
  <img src="/images/005_ndbsetup.png" alt="ndbsetup" />
</figure>


</p>
<h3 id="tzsetup">tzsetup</h3>
<pre tabindex="0"><code>Setup Time Zone

Time Zone (Argentina, Australia_ACT, Australia_Broken-Hill,
Australia_LHI, Australia_NSW, Australia_North, Australia_Queensland,
Australia_South, Australia_Sturt, Australia_Tasmania,
Australia_Victoria, Australia_West, Australia_Yancowinna, Brazil_Acre,
Brazil_DeNoronha, Brazil_East, Brazil_West, CET, Canada_Atlantic,
Canada_Central, Canada_East-Saskatchewan, Canada_Eastern,
Canada_Mountain, Canada_Newfoundland, Canada_Pacific, Canada_Yukon,
Chile_Continental, Chile_EasterIsland, Cuba, EET, Egypt, GB-Eire, GMT,
HST, Hongkong, Iceland, Iran, Israel, Jamaica, Japan, Libya,
Mexico_BajaNorte, Mexico_BajaSur, Mexico_General, NZ, NZ_CHAT, Navajo,
PRC, Poland, ROC, ROK, Singapore, Turkey, US_Alaska, US_Arizona,
US_Central, US_East-Indiana, US_Eastern, US_Hawaii, US_Michigan,
US_Mountain, US_Pacific, US_Yukon, W-SU, WET)[US_Eastern]: GMT
</code></pre><p>Type your chosen time zone and hit <code>Enter</code>.</p>
<p>
<figure>
  <img src="/images/005_tzsetup.png" alt="tzsetup" />
</figure>


</p>
<h3 id="bootsetup">bootsetup</h3>
<pre tabindex="0"><code>Setup Plan 9 FAT boot partition (9fat)

Plan 9 FAT partition (/dev/sdC0/9fat)[/dev/sdC0/9fat]:
</code></pre><p>Hit enter to accept the default.</p>
<p>Any environment variables entered at the &gt; prompt during boot, as well as settings configured during install will now be written to <code>/n/9fat/plan9.ini</code> and the kernel will be copied to the <strong>9fat</strong> partition.</p>
<pre tabindex="0"><code>dossrv: serving /srv/dos
Initializing Plan 9 FAT partition.

% disk/format -r 2 -d -b /386/pbs /dev/sdC0/9fat
Initializing FAT file system
type hard, 12 tracks, 255 heads, 63 sectors/track, 512 bytes/sec
used 4096 bytes
% mount -c /srv/dos /n/9fat /dev/sdC0/9fat
% rm -f /n/9fat/9bootfat /n/9fat/plan9.ini /n/9fat/9pc
% cp /n/newfs/386/9bootfat /n/9fat/9bootfat
% chmod +al /n/9fat/9bootfat
% cp /tmp/plan9.ini /n/9fat/plan9.ini
% cp /n/newfs/386/9pc /n/9fat/9pc

If you use the Windows NT/2000/XP master boot record
or a master boot record from a Unix clone (e.g., LILO or
FreeBSD bootmgr), it is probably safe to continue using
that boot record rather than install the Plan 9 boot record.
</code></pre><p>Since we are not installing on a disk with a pre-existing Windows installation, we choose to install the <strong>Plan 9</strong> master boot record and mark the partition active.</p>
<pre tabindex="0"><code>Install the Plan 9 master boot record (yes, no)[no default]: yes
Mark the Plan 9 partition active (yes, no)[no default]: yes

The Plan 9 partition is now marked as active.
</code></pre><p>
<figure>
  <img src="/images/005_bootsetup.png" alt="bootsetup" />
</figure>


</p>
<h3 id="finish">finish</h3>
<p>The last step will disable the CD image and shut down.
We confirm by pressing the <code>Enter</code> key to restart the computer.</p>
<p>Your first installation of <strong>9front</strong> is complete.</p>
<p>Congratulations!</p>
<h2 id="auth-and-file-server-setup">Auth and File Server Setup</h2>
<p>Based on follow example - <a href="https://www.youtube.com/watch?v=wRpCnHTTbGU" title="Auth &amp; File Server Setup, using 9front">youtube</a>.</p>
<p>This step will be a little tricky to follow.
But only need to be done once to get the File server officially running.
There are a lot of moving parts and they need to be done correctly for everything to work.
As this will be a combination of Authorization and File server we will need to set up both those systems.</p>
<p>Authorization will handle checking the passwords and the file system will make sure the users have access to the correct files.
First thing that needs to be done is to set a host owner for the system.
The <strong>Plan 9</strong> developers did away with a <strong>root</strong> user because it was had obvious security issues.
Instead each system has a designated <strong>host owner</strong>.
The host owner has ultimate power over any processes runnung on the system it owns.
So the host owner can kill processes and access pretty much all the hardware.</p>
<p>In the case of the file server the host owner does not have ultimate acceess to the files normally.
Only in the special case where the host owner boots the console mode with authorization disabled.</p>
<h3 id="setup-nvram">Setup NVRAM</h3>
<p>We&rsquo;ve noted the <strong>NVRAM</strong> partition <a href="###prepdisk">before</a> this is a small piece of storage called <strong>Non-Volatile RAM</strong> for historical reasons and it holds a password token for the host owner.
This allows the system to boot with authorization without needing to enter a password at the boot prompt.
To be sure the system uses it i will add it to the <code>plan9.ini</code>.
Some systems will do this automatically but i just want to be sure.</p>
<p>So lets mount the <strong>9fat</strong> partition.</p>
<pre tabindex="0"><code>% 9fs 9fat
% sam /n/9fat/plan9.ini
</code></pre><p>Here we can specify exactly where to get the <strong>NVRAM</strong> partition from and this can also be set as a file.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;display:grid;"><code class="language-ini" data-lang="ini"><span style="display:flex;"><span><span style="color:#a6e22e">bootfile</span><span style="color:#f92672">=</span><span style="color:#e6db74">9pc64</span>
</span></span><span style="display:flex; background-color:#3c3d38"><span><span style="color:#a6e22e">nvram</span><span style="color:#f92672">=</span><span style="color:#e6db74">/dev/sdF0/nvram</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">bootargs</span><span style="color:#f92672">=</span><span style="color:#e6db74">local!/dev/sdF0/fscache</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">mouseport</span><span style="color:#f92672">=</span><span style="color:#e6db74">ps2</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">monitor</span><span style="color:#f92672">=</span><span style="color:#e6db74">vesa</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">vgasize</span><span style="color:#f92672">=</span><span style="color:#e6db74">1024x768x16</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">tiltscreen</span><span style="color:#f92672">=</span><span style="color:#e6db74">none</span>
</span></span></code></pre></div><p>And now we&rsquo;ll reboot the system so that takes effect.</p>
<pre tabindex="0"><code>% fshalt -r
</code></pre><h3 id="write-to-nvram">Write to NVRAM</h3>
<p>Now we have rebooted the system with the <strong>NVRAM</strong> partition specified and the next step is to write to it.</p>
<ul>
<li><code>authid</code> - will be the host owner which will be <strong>glenda</strong>.</li>
<li><code>authdom</code> - in this case this asking for a domain name.
If you use one just specify it.
If not - put something as stub.</li>
<li><code>secstore key</code> is used for another authorization system and i&rsquo;m just going to be skipping it for now.
Hit <code>Enter</code> and leave it blank.</li>
<li><code>password</code> - password for <strong>glenda</strong> user.</li>
</ul>
<pre tabindex="0"><code>% auth/wrkey
authid: glenda
authdom: testdom
secstore key:
password:
</code></pre><p>That it.</p>
<h3 id="add-users-to-auth">Add users to auth</h3>
<p>The next step is to add <strong>glenda</strong> to the authorization system and we&rsquo;ll also be adding a regular user to.
So first we need to make sure we have access to the keys.</p>
<pre tabindex="0"><code>% auth/keyfs
</code></pre><p>So we&rsquo;ll do one for <strong>glenda</strong> here:</p>
<ul>
<li><code>Password</code> - enter the same password;</li>
<li><code>Confirm password</code> - and again;</li>
<li><code>assign new Inferno/POP secret? [y/n]: n</code> - nevermind for now, just set to no;</li>
<li><code>Expiration date (YYYYMMDD or never)[never]:</code> won&rsquo;t bother with an expiration date, set to never;</li>
<li><code>Post id:</code>, <code>User's full name:</code>, <code>Department #:</code>, <code>User's email address:</code>, <code>Sponsor's email address:</code> - these are if you have like an actual office full of people.</li>
</ul>
<pre tabindex="0"><code>% auth/changeuser glenda
Password:
Confirm password:
assign new Inferno/POP secret? [y/n]: n
Expiration date (YYYYMMDD or never)[never]:
Post id:
User&#39;s full name:
Department #:
User&#39;s email address:
Sponsor&#39;s email address:
user glenda installed for Plan 9
</code></pre><p>There we go.
<strong>glenda</strong> is now added as a user.
And i&rsquo;ll add just a plain regular user <strong>testuser</strong>.
Give them a password and basically the same options.</p>
<pre tabindex="0"><code>% auth/changeuser testuser
Password:
Confirm password:
assign new Inferno/POP secret? [y/n]: n
Expiration date (YYYYMMDD or never)[never]:
Post id:
User&#39;s full name:
Department #:
User&#39;s email address:
Sponsor&#39;s email address:
user testuser installed for Plan 9
</code></pre><h3 id="add-users-to-file-system">Add users to file system</h3>
<p>The next step is to add our new <strong>testuser</strong> to the file system.
So <strong>glenda</strong> automatically gets entered as one of the users on the file system when you do the basic install.
And now we need to add the <strong>testuser</strong> so that they can also own files.
To do that we need send commands into the file system&rsquo;s command server.</p>
<pre tabindex="0"><code>% echo newuser testuser &gt;&gt;/srv/cwfs.cmd
</code></pre><p>All right, so now the new user <strong>testuser</strong> has been added to the <strong>CWFS</strong>.</p>
<h3 id="set-up-network-database">Set up network database</h3>
<p>The next step is to edit the network database file to designate this system as the authentication and file server.
This file located in <code>/lib/ndb/local</code>.
Down near the bottom here we have an example that we can use.</p>
<pre tabindex="0"><code># example: adjust to fit your network
#auth=cirno authdom=9front
#ipnet=9front ip=192.168.0.0 ipmask=255.255.255.0
#	ipgw=192.168.0.1
#	dns=192.168.0.1
#	auth=cirno
#	dnsdom=9front
#	cpu=cirno
#	smtp=cirno
</code></pre><p>So we just need to make own version of this:</p>
<pre tabindex="0"><code>auth=test-fs authdom=testdom
ipnet=testdom ip=192.168.2.0 ipmask=255.255.255.0
	ipgw=192.168.2.1
	dns=192.168.2.1
	auth=test-fs
	fs=test-fs
	dnsdom=testdom
</code></pre><h3 id="edit-plan9ini">Edit <code>plan9.ini</code></h3>
<p>Now we need add another edit to <code>plan9.ini</code>.
Because of quircks with <strong>CWFS</strong> we need to do two edits.</p>
<ul>
<li>The first is to make copy of <code>plan9.ini</code> to boot the system up in configure mode to make sure that authorization to the file system is working;</li>
<li>And we also need a final <code>plan9.ini</code> configuration so the server boots up normally without any need for interaction.</li>
</ul>
<p>So let&rsquo;s mount the <strong>9fat</strong> again and make a copy of current <code>plan9.ini</code> and another one which we&rsquo;ll use later.</p>
<pre tabindex="0"><code>9fs 9fat
cp /n/9fat/plan9.ini /n/9fat/plan9.bak.ini
cp /n/9fat/plan9.ini /n/9fat/plan9.new.ini
</code></pre><p>For existing one the first thing we need to do is change this from the default which is a terminal to a <strong>CPU</strong> server.
And then to the boot arguments we&rsquo;ll add a <code>-c</code> to drive option for the file system and this will put it into  configure mode.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;display:grid;"><code class="language-ini" data-lang="ini"><span style="display:flex;"><span><span style="color:#a6e22e">bootfile</span><span style="color:#f92672">=</span><span style="color:#e6db74">9pc64</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">nvram</span><span style="color:#f92672">=</span><span style="color:#e6db74">/dev/sdF0/nvram</span>
</span></span><span style="display:flex; background-color:#3c3d38"><span><span style="color:#a6e22e">service</span><span style="color:#f92672">=</span><span style="color:#e6db74">cpu</span>
</span></span><span style="display:flex; background-color:#3c3d38"><span><span style="color:#a6e22e">bootargs</span><span style="color:#f92672">=</span><span style="color:#e6db74">local!/dev/sdF0/fscache -c</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">mouseport</span><span style="color:#f92672">=</span><span style="color:#e6db74">ps2</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">monitor</span><span style="color:#f92672">=</span><span style="color:#e6db74">vesa</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">vgasize</span><span style="color:#f92672">=</span><span style="color:#e6db74">1024x768x16</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">tiltscreen</span><span style="color:#f92672">=</span><span style="color:#e6db74">none</span>
</span></span></code></pre></div><p>For the new one we&rsquo;ll add an option <code>-a tcp!*!564</code> to drive options.
This will tell the system to be listening on <strong>TCP</strong> port 564 for commands to mount to the file system.
This will also be a service CPU and we will change the boot args to <code>nobootprompt</code> so it won&rsquo;t ask for us to hit <code>Enter</code>.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;display:grid;"><code class="language-ini" data-lang="ini"><span style="display:flex;"><span><span style="color:#a6e22e">bootfile</span><span style="color:#f92672">=</span><span style="color:#e6db74">9pc64</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">nvram</span><span style="color:#f92672">=</span><span style="color:#e6db74">/dev/sdF0/nvram</span>
</span></span><span style="display:flex; background-color:#3c3d38"><span><span style="color:#a6e22e">service</span><span style="color:#f92672">=</span><span style="color:#e6db74">cpu</span>
</span></span><span style="display:flex; background-color:#3c3d38"><span><span style="color:#a6e22e">nobootprompt</span><span style="color:#f92672">=</span><span style="color:#e6db74">local!/dev/sdF0/fscache -a tcp!*!564</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">mouseport</span><span style="color:#f92672">=</span><span style="color:#e6db74">ps2</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">monitor</span><span style="color:#f92672">=</span><span style="color:#e6db74">vesa</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">vgasize</span><span style="color:#f92672">=</span><span style="color:#e6db74">1024x768x16</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">tiltscreen</span><span style="color:#f92672">=</span><span style="color:#e6db74">none</span>
</span></span></code></pre></div><p>So we writing both file now because once the system reboots the graphical system will be disabled so it won&rsquo;t load <strong>rio</strong> and we can&rsquo;t edit the files with <strong>acme</strong> or <strong>sam</strong>.
You can use <strong>ed</strong>, but writing now and using just <strong>mv</strong> to rename them later is easier.</p>
<h3 id="boot-as-a-server">Boot as a server</h3>
<p>So we&rsquo;ve rebooted the system now and you can see it&rsquo;s waiting me to enter the default which has the <code>-c</code>.
Hit <code>Enter</code>.</p>
<p>And it has <code>config</code> prompt.
At this point we need to type <code>noauth</code>.
It says <code>auth is disabled</code>.</p>
<p>I&rsquo;ll type <code>noauth</code> again and auth is now enabled.
Than type <code>end</code> and continues booting the system.</p>
<pre tabindex="0"><code>bootargs is (tcp, tls, il, local!device)[local!/dev/sdF0/fscache -c]
config: noauth
auth disabled
config: noauth
auth enabled
config: end
</code></pre><p>As you can see there&rsquo;s no <strong>rio</strong> now.
It&rsquo;s just a prompt.</p>
<p>We&rsquo;ll mount <strong>9fat</strong> partition and so we will move that <code>plan9.ini</code> file with the configuration option.
And then move our final <code>plan9.ini</code> file and reboot the system again.</p>
<pre tabindex="0"><code># 9fs 9fat
# cd /n/9fat/
# mv plan9.ini plan9.config.ini
# mv plan9.new.ini plan9.ini
# fshalt -r
</code></pre><p>Now you can shut the system down and then take out the monitor, keyboard and mouse and boot it back.</p>
<p>It will happily sit there and wait for file server requests.</p>
<h3 id="connecting">Connecting</h3>
<p>Now you need a <strong>drawterm</strong><sup id="fnref:4"><a href="#fn:4" class="footnote-ref" role="doc-noteref">4</a></sup> on you main system to connect to file server.</p>
<pre tabindex="0"><code>drawterm -h 192.168.2.10 -u testuser -a 192.168.2.10
</code></pre><p>Enter user password and voila!
Now you connected to FS server.
You also can access you local machine files in <code>/mnt/term</code>.
It&rsquo;s a pretty usefull, you can write some software on your usual text editor and test it in <strong>Plan 9</strong> environment without copying any file.</p>
<p>In subsequent articles, we will focus in more detail on the application of <strong>Plan 9</strong>, working in the environment and expanding our grid.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p><a href="https://fqa.9front.org/fqa4.html">https://fqa.9front.org/fqa4.html</a> 9front FQA 4 - 9front Installation Guide&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p><a href="https://fqa.9front.org/fqa3.html">https://fqa.9front.org/fqa3.html</a> 9front FQA 3 - Hardware&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:3">
<p><a href="https://9front.org/releases/">https://9front.org/releases/</a> 9front releases&#160;<a href="#fnref:3" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:4">
<p><a href="http://git.9front.org/plan9front/drawterm/HEAD/info.html">http://git.9front.org/plan9front/drawterm/HEAD/info.html</a> drawterm&#160;<a href="#fnref:4" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></itunes:summary>
			<category domain="https://polyserv.xyz/en/posts/">posts</category>
			<guid>https://polyserv.xyz/en/posts/2024-11-02-plan-9-installation/</guid>
			<pubDate>2024-11-02T22:00:00Z</pubDate>
		</item>
		<item>
			<title>History of Plan 9</title>
			<link>https://polyserv.xyz/en/posts/2024-10-31-plan-9-history/</link>
			<description>Past and present</description>
			<itunes:summary type="html"><![CDATA[<p>Since the development of <strong>UNIX</strong>, the programmers of <strong>Bell Labs</strong> have not been idle.
Their next brainchild was the distributed operating system <strong>Plan 9</strong>.</p>
<h2 id="background">Background</h2>
<p>By the mid-80s, there was a tendency to move away from large centralized computers operating in time-sharing mode to networks on top of small personal machines <strong>[usually UNIX workstations]</strong>.
Users were eager to switch to small systems that they could support themselves despite the loss in computing power.
Microcomputers became faster and cheaper, and these losses were compensated.
This style of computing remains quite popular today.</p>
<p>When migrating <strong>UNIX</strong> to personal workstations, however, some of the existing shortcomings and problems were not taken into account.
The <strong>UNIX</strong> operating system was old, monolithic, and operated in time-sharing mode.
The possibilities of adapting it to new technologies that appeared later were very limited.
Graphics and networking capabilities were added to <strong>UNIX</strong> back in its heyday and were poorly integrated architecturally and, as a result, difficult to manage.</p>
<p>And most importantly, the early focus on personal machines made it impossible for the trouble-free operation of networks typical of old monolithic time-sharing systems.
Time-sharing and management centralization made it possible to amortize costs for large machines.
But with the advent of personal computing, the problems of administration have escalated to the limit.
Choosing an old time-sharing operating system to run on these personal machines would be unjustified.</p>
<h2 id="beginning">Beginning</h2>
<p>It was decided to create an OS more adapted to the challenges of the time.
<strong>Plan 9</strong> originated in the late 1980s as a new system designed to solve <strong>UNIX</strong> problems that the developers considered <strong>&ldquo;too deep to fix&rdquo;</strong>.
At the same time, two goals were pursued:</p>
<ul>
<li>the system, built from cheap modern microcomputers, had to be centrally controlled;</li>
<li>and at the same time be inexpensive.</li>
</ul>
<p>The idea was to use more than just workstations when building a computing system.
Computers should fit their role: small, cheap machines in offices could serve as terminals, providing access to large, central, shared resources such as computing and file servers.
Recent multiprocessor systems appeared to be obvious candidates for the role of central machines.</p>
<p>The project was taken over by a specialized division of <strong>Bell Labs</strong>, known as <strong>&ldquo;Computer Science Research Center&rdquo; (CSRC)</strong>.
In fact, the development was led by the same team that originally worked on <strong>UNIX</strong> and the <strong>C programming language</strong>: Ken Thompson, Dennis Ritchie, Rob Pike, Dave Presotto and Phil Winterbottom.
And it was decided to leave the concept the same, developing it as much as possible.</p>
<p>The name of the OS was inspired by the trash horror film <strong>&ldquo;Plan 9 from Outer Space&rdquo;</strong> directed by Edward Wood.
Mascot of OS - hare <strong>Glenda</strong> - was named after the film <strong>&ldquo;Glen or Glenda&rdquo;</strong> by the same director.
The same name was given to the default user in <strong>Plan 9</strong>.</p>
<p>
<figure>
  <img src="/images/004_glenda.jpg" alt="Glenda" />
  <figcaption>“Look, that rabbit’s got a vicious streak a mile wide! It’s a killer!” – Tim the Enchanter</figcaption>
</figure>


</p>
<p>By 1989, the system had become so stable that it was used as the only computing environment in the laboratory.
This meant the need to migrate many services and applications that were previously used in <strong>UNIX</strong>.
The researchers used this opportunity to review a lot of things in the OS architecture.
<strong>Plan 9</strong> had new compilers, languages, libraries, window systems and a variety of new applications.
Many of the old utilities have been omitted, and those that have been left behind have been re-written or debugged.</p>
<p>Why was it necessary to review everything to the ground?
The differences between the operating system, library, and application are important to operating system researchers, but uninteresting to users.
For them, only functionality matters.
By creating a completely new system, they were able to solve many problems that needed to be solved.
For example, there is no <strong>tty</strong> driver in the kernel.
It is the result of the operation of the window system in the user space.
In the modern world, computing systems, by necessity, are multiarchitectural and made up of products from different suppliers.
However, conventional compilers and utilities assume that the program must be built to run in a local environment.
More importantly, however, the operating environment it provides serves as a certain test for the system.
Ensuring greater efficiency when running old programs - the &ldquo;workhorses&rdquo; of <strong>UNIX</strong> - was only a matter of technique.
The researchers were much more interested in the fact that the new ideas proposed by the architecture of the new system would contribute to improving work efficiency.
Thus, although <strong>Plan 9</strong> provides an emulation environment for executing <strong>POSIX</strong> commands, this is not the main thing in the system.
Most of the system software is developed in the native <strong>Plan 9</strong> environment.</p>
<p>The completely updated system had certain advantages.
The laboratory had experience in developing controllers for experimental peripheral devices.
In order to make it easier to write their drivers, they wanted to have a system that would be available as source code <strong>[which UNIX could no longer guarantee, even in the laboratory where it was born]</strong>.
In addition, they wanted to redistribute the work.
The software should have been created in a decentralized manner <strong>[let me remind you, git and etc. haven&rsquo;t even thought about it yet, let alone CI/CD]</strong>.
For example, they could use <strong>C</strong> compilers from some vendors for the system.
But even if they had overcome the problems with cross-compilation, they would have had difficulty redistributing the result of this work.</p>
<h2 id="result">Result</h2>
<p>The basic concept of <strong>Plan 9</strong> is that it is a distributed operating system, unlike <strong>UNIX</strong>.
Network functionality is extended by mechanisms such as remote login and a network file system in it.
In <strong>Plan 9</strong> network support is built into the OS functionality.
For example, all resources, theoretically, can be transparently distributed in the <strong>Plan 9</strong> network.
The system hides from the user that the resources are not local.
<strong>Plan 9</strong> supports not only file servers, but also authorization and computing servers, and this list can be expanded<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup><sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup>.</p>
<p>The system was built on three principles:</p>
<ul>
<li>Firstly, resources are named and can be accessed as files in a hierarchical file system;</li>
<li>Secondly, there is a standard protocol called <strong>9P</strong> for accessing these resources;</li>
<li>Finally, the unrelated hierarchies provided by the various services are joined together into a single personal hierarchical file namespace.</li>
</ul>
<p>The unusual properties of <strong>Plan 9</strong> are due to the purposeful consistent application of these principles.</p>
<p><strong>Plan 9</strong> is based on the <strong>UNIX</strong> paradigm that <strong>&ldquo;everything is a file&rdquo;</strong>.
Relying on a huge collection of add-ons, <strong>UNIX</strong> absorbed more and more changes that went against this original, fundamental principle.
An example of this is the terrible socket mechanism used for the functions of reading and writing network resources, different than regular files.
<strong>Plan 9</strong> puts an end to this by providing a file-oriented system interface.
For example, <code>/net/tcp</code> and <code>/net/udp</code> for network interfaces.
Most system services also follow the server principle.
In <strong>Plan 9</strong>, for example, there is no regular <code>ftp</code> program.
Instead, <code>ftpfs</code> mounts the <strong>FTP server</strong> to the <code>/n/ftp</code> directory.
The <code>9660fs</code> server is responsible for mounting CD&rsquo;s.</p>
<p>Although <strong>Plan 9</strong> was originally intended to work with traditional files, its ideas have been extended to many other resources.
File hierarchy export services include I/O devices, backups, window system, network interfaces, and more.
The file system model is well understood by both system developers and ordinary users, so that services with file-like interfaces are easy to build, understand and use.
The files come with familiar, unified rules for protection, naming, and access (both local and remote).
Therefore, services built in this way are ready for use in distributed systems.
This is the difference from object-oriented models, where these aspects have to be dealt with anew for each class of objects.
The following articles will provide examples illustrating these ideas in practice.</p>
<p>One example would be the <code>/proc</code> file system command, which provides a clear way to explore and manage current processes.
<strong>Plan 9</strong> was the first OS to support the file-oriented process management system <code>proc</code>.
Precursor systems are based on a similar idea<sup id="fnref:3"><a href="#fn:3" class="footnote-ref" role="doc-noteref">3</a></sup>, but in Plan 9 the metaphor of files is developed much further<sup id="fnref:4"><a href="#fn:4" class="footnote-ref" role="doc-noteref">4</a></sup>.
Later, <code>/proc</code> was integrated into <strong>GNU/Linux</strong>.</p>
<p>In <strong>Plan 9</strong>, the main network functionality is provided by the <strong>9P</strong> protocol, which includes about 30 control messages.
The implementation of <strong>9P</strong> in <strong>GNU/Linux</strong> has been added to the main kernel since version <strong>2.6.14</strong> This eliminated any obstacles in the interaction between <strong>GNU/Linux</strong> and <strong>Plan 9</strong>.
The <strong>9P</strong> protocol is structured as a set of transactions, each of which sends a request from the client process to a local or remote server and returns the result.
<strong>9P</strong> controls the file system, not just the files.
It includes procedures for distinguishing file names and converting the hierarchy of file system names provided by the server.
On the other hand, unlike systems such as Sprite<sup id="fnref:5"><a href="#fn:5" class="footnote-ref" role="doc-noteref">5</a></sup>, the user namespace is supported only by the client system, and not on or with the server.
In addition, file access occurs at the byte level, not at the block level, which distinguishes <strong>9P</strong> from protocols such as <strong>NFS</strong> and <strong>RFS</strong>.</p>
<p>A typical <strong>Plan 9</strong> installation consists of a number of computers connected to a network and each providing services of a certain class.
Shared multiprocessor servers ensure the execution of computing cycles.
Other large machines serve as file storages.
These machines were located in an air-conditioned room and connected by a high-performance network.
Networks with lower bandwidth, such as <strong>Ethernet</strong>, connect these servers to office or home workstations or PCs, called terminals in <strong>Plan 9</strong> terminology.</p>
<p>The modern style of computing assumes that each user has a dedicated workstation or PC.
<strong>Plan 9</strong> uses a fundamentally different approach.
Although it can function on a workstation with files stored on a local disk, this configuration is not canonical.
Instead, machines with monitors, keyboards, and mice gain access to most computing resources and storage systems over the network, becoming terminals of the system, similar to the terminals of the old time-sharing system.
The terminal is temporarily personalized by this user when using <strong>Plan 9</strong>.</p>
<p>The principle of building equipment for the user does not work here.
<strong>Plan 9</strong> offers the possibility to programmatically change how it is perceived by the user.
This adjustment is accompanied by giving publicly visible resources on the network local personal names.
<strong>Plan 9</strong> provides a mechanism for organizing a personal representation of a shared space with local names of globally available resources.
Since the most important network resources are files, the model of this representation is file-oriented.</p>
<p>Local namespaces provide a way to implement a network representation &ldquo;for yourself&rdquo;.
All services available on the network export file hierarchies.
Those of them that are important to the user are gathered together into a personal namespace.
Currently of no interest are ignored <strong>[this approach is hard to understand, but it is one of the most important concepts implemented in the system]</strong>.
This usage style differs from the homogeneous global namespace in <strong>UNIX</strong>.
<strong>Plan 9</strong> has well-known names for services and unified names for files exported by these services, but their representation is completely local.
An example is the difference between the phrase &ldquo;my home&rdquo; and a clearly formulated exact address.
The latter can be used by anyone, whereas the former is used only in colloquial speech: the meaning of a phrase varies depending on who says it and when, but it is considered understandable.
Similarly, in <strong>Plan 9</strong>, the name <code>/dev/mouse</code> always refers to the mouse, and <code>/bin/date</code> is the date output command, but what files these names represent depends on circumstances, for example, on the architecture of the machine executing the <code>date</code> command.
<strong>Plan 9</strong> thus has local namespaces that obey global conventions.
It is these conventions that guarantee reasonable behavior in the presence of local names.</p>
<h2 id="present-day">Present day</h2>
<p><strong>Plan 9</strong> carried several innovations that influenced many subsequent systems.
But until recently, the source code was under a commercial license that bounded developers and users.
<strong>Bell Labs</strong> and a small community of programmers continued to improve and develop <strong>Plan 9</strong>.</p>
<p>The license was softened from year to year, and in 2003 <strong>Plan 9</strong> was finally released under the first free license.
The commercial branch, known as <strong>Inferno</strong>, is now also available under a free license.</p>
<h3 id="9front">9front</h3>
<p>This is a fork of <strong>Plan 9</strong>, which has been worked on by a team of developers from the <strong>NineTimes</strong> community since 2011.
It consists of fans of the original OS from <strong>Bell Labs</strong>.
One of the main problems of the original <strong>Plan 9</strong>, which slowed down the development of the system, was the lack of drivers and weak support for peripheral equipment.
This was due to the uniformity of the equipment in the laboratory.
This is exactly the problem that the developers of <strong>9front</strong> tried to solve.
They wrote OS drivers for <strong>USB</strong>, <strong>Wi-Fi</strong>, audio cards, game emulators <strong>[you can run DOOM]</strong>.
The fork was distributed under the same open <strong>Lucent Public License</strong> as <strong>Plan 9</strong>.
At the moment, distribution is conducted under the <strong>MIT</strong> license.</p>
<p>The creators of <strong>9front</strong> have placed a package repository on the network, which greatly facilitates the installation of system components.
The loader was completely rewritten in this fork.
It is called <strong>9boot</strong> and is distinguished by the use of <strong>rc</strong> scripts that allow you to access <strong>shell</strong> at any stage of loading <strong>[which may be useful if something went wrong]</strong>.</p>
<p><strong>Plan 9</strong> supported several file systems: first, the native <strong>Fossil</strong> developed at <strong>Bell Labs</strong> specifically for this platform, as well as <strong>Kfs</strong>, <strong>Paq</strong>, <strong>cwfs</strong> and <strong>FAT</strong> ** [where without it]**.
In <strong>9front</strong>, the main FS is <strong>cwfs (cwfs64x)</strong> - this is also a file system from <strong>Plan 9</strong>, which supports encryption of disk partitions, and also allows you to securely store backups of OS components and user data.</p>
<p>The <strong>Go</strong> programming language compiler has been added to <strong>9front</strong>.
A simple text editor <strong>hold</strong> was also added to the package.
The distributed version control system <strong>Git</strong> is used to update the OS.
In order to provide more flexible hardware support, the message-triggered interrupts subsystem <strong>MSI (message signalled interrupts)</strong> was introduced.</p>
<p>The system is regularly updated, the latest up-to-date version was released on April 28, 2024<sup id="fnref:6"><a href="#fn:6" class="footnote-ref" role="doc-noteref">6</a></sup>.
You can try <strong>9front</strong> on a virtual machine, either by installing it on a PC or a single-board computer.</p>
<h3 id="system-operational">System operational</h3>
<p>Yes, it is certainly not suitable for everyday use.
Like <strong>Plan 9</strong>, <strong>9front</strong> is still an experimental, research OS.
The main purpose of the creation was to bring to life some of the original ideas of <strong>UNIX</strong> and implement them on a more advanced and modern hardware platform.
It was generally successful.
In research laboratories <strong>Plan 9</strong> was used quite effectively as a platform for distributed computing.
At a minimum, <strong>Plan 9</strong> and <strong>9front</strong> have proven that the basic concept of <strong>UNIX</strong> - each system interface can be represented as a set of files - is quite successfully implemented in a modern OS.</p>
<p>Like other forks of <strong>Plan 9</strong>, among which it should be noted <strong>9atom</strong>, <strong>Harvey OS</strong> and <strong>Jehanne OS</strong>, <strong>9front</strong> is an OS for programmers and engineers.
For those who prefer to dig into configs and write their own code rather than run someone else&rsquo;s.
<strong>9front</strong> can be called the most active offshoot from the &ldquo;classic&rdquo; <strong>Plan 9</strong>.
The creators of the fork are continuously working to improve hardware support and develop new drivers.
Their efforts also have practical applications: for example, the <strong>ATA over Ethernet</strong> protocol, created for <strong>NAS</strong> clusters, works on principles similar to the <strong>Plan 9</strong> architecture.</p>
<p>With the advent and development of the Internet of Things and single-board computers with limited performance, the demand for distributed operating systems that allow flexible redistribution of computing resources in the network and ensure their balancing is sure to grow.</p>
<p>This means that this project has a future.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p><a href="https://powerman.name/Inferno/man/4/registry.html">https://powerman.name/Inferno/man/4/registry.html</a> Inferno Registry&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p><a href="https://github.com/doytsujin/registry">https://github.com/doytsujin/registry</a> Plan 9 Inferno-like registry server&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:3">
<p>. T.J. Killian, Processes as Files, USENlX, Summer 1984 Conf. Proc., June 1984, Salt Lake City, UT.&#160;<a href="#fnref:3" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:4">
<p>. Rob Pike, Dave Presotto, Ken Thompson, Howard Trickey, and Phil Winterbottom, The Use of Name Spaces in Plan 9, Ор. Sys. Rev., Vol. 27, No. 2, April 1993, рр. 72-76.&#160;<a href="#fnref:4" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:5">
<p>. John Ousterhout, Andrew Cherenson, Fred Douglis, Mike Nelson, and Brent Welch, The Sprite Network Operating Systems Operating System, IEEE Computer, 21(2), 23-38, Feb. 1988.&#160;<a href="#fnref:5" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:6">
<p><a href="http://9front.org/releases/2024/04/28/0/">http://9front.org/releases/2024/04/28/0/</a> 9FRONT “DO NOT INSTALL” RELEASED&#160;<a href="#fnref:6" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></itunes:summary>
			<category domain="https://polyserv.xyz/en/posts/">posts</category>
			<guid>https://polyserv.xyz/en/posts/2024-10-31-plan-9-history/</guid>
			<pubDate>2024-10-31T22:00:00Z</pubDate>
		</item>
		<item>
			<title>About Plan 9</title>
			<link>https://polyserv.xyz/en/posts/2024-10-28-about-plan-9/</link>
			<description>Say a word</description>
			<itunes:summary type="html"><![CDATA[<h2 id="introduction">Introduction</h2>
<p>Without a doubt, <strong>Plan 9</strong> is one of the most interesting operating systems I&rsquo;ve encountered along my way.
The approaches that were used in its design are simple and universal.
The OS itself turned out to be the same.
<strong>UNIX</strong>&rsquo;es &ldquo;<strong>everything is a file</strong>&rdquo; in <strong>Plan 9</strong> is raised to the absolute.</p>
<p>No wonder, because it was designed by the same engineers as the original <strong>UNIX</strong> - Ken Thompson, Dennis Ritchie, Rob Pike, etc.
It also developed approaches such as &ldquo;text as an interface&rdquo; and &ldquo;homogeneous operating environment&rdquo; - the ideas of Niklaus Wirth and his <strong>Oberon</strong><sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> environment.
<strong>[just compare the screenshots, for the rest you need to go into the code]</strong></p>
<p><strong>ENTIRE</strong> OS architecture is built on file interaction:</p>
<ul>
<li>Do you want to create a file? Create a file.</li>
<li>Do you want to create a TCP socket? &hellip; Create a file!
<strong>[hello to Berkeley sockets<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup> bolted sideways across with their special system calls]</strong></li>
<li>Do you want to raise the VPN? Well, let&rsquo;s skip it for a while&hellip;</li>
</ul>
<p>Any device in machine is represented to us as a hierarchical file system.
Yes, this imposes some restrictions on driver developers, because they have to design this device file system.
But the achieved uniformity of the entire system saves us a lot of time during operation.</p>
<p>Network transparency, which was incorporated into the <strong>9P</strong><sup id="fnref:3"><a href="#fn:3" class="footnote-ref" role="doc-noteref">3</a></sup> protocol from the very first stages of design, blurs the boundaries between machines.
Therefore, it does not matter where the file/device is located - locally or remotely - the interaction will follow the same protocol.
Access to mail? To the file storage? Chat? GPS data? Everything can be implemented using a single protocol.</p>
<p>Well, it&rsquo;s just some kind of engineering utopia.</p>
<h2 id="problems">Problems</h2>
<p>But if <strong>Plan 9</strong> is so great, then why hasn&rsquo;t everyone switched to it yet?
I think it was influenced by several factors.</p>
<h3 id="status">Status</h3>
<p><strong>Plan 9</strong> was conceived as an experimental OS with closed source code and has not got rid of this halo until now.
It was used to test the latest concepts that were developed in the <strong>Inferno</strong><sup id="fnref:4"><a href="#fn:4" class="footnote-ref" role="doc-noteref">4</a></sup> OS.
Initially there were almost no user programs in it.
Only the most necessary things for work.
And as a result &hellip;</p>
<h3 id="lost-time">Lost time</h3>
<p>The <strong>Plan 9</strong> source code was opened under the <strong>GPL-2.0-only</strong> license (and then under <strong>MIT</strong>) only in 2014.
The attention of the community was missed.
<strong>GNU/Linux</strong> was already growing and expanding, which <strong>&ldquo;just good enough&rdquo;</strong><sup id="fnref:5"><a href="#fn:5" class="footnote-ref" role="doc-noteref">5</a></sup>.
Think about all the community efforts that have been spent on the development of <strong>GNU/Linux</strong>.
Maybe with the same attention to <strong>Plan 9</strong> we would live in a completely different world.
But &hellip;</p>
<h3 id="architecture">Architecture</h3>
<p>The specificity of <strong>Plan 9</strong> block easy migration of software written for <strong>UNIX</strong> to it.
It turns out that a huge layer of programs that everyone is used to are nailed to the <strong>GNU/Linux</strong> and <strong>BSD</strong> system calls.
A very limited number of people agree to sit and write the entire toolkit from scratch with the same zeal<sup id="fnref:6"><a href="#fn:6" class="footnote-ref" role="doc-noteref">6</a></sup>.</p>
<p>Besides the fact that this is a laborious process, it is also slowed down by maintaining the ideological purity of the OS.
&ldquo;The best code is no code at all.&rdquo;
This idea is close to me, but not so literally.
The ability to create almost any software in the form of shell scripts is interesting, but not all software can be implemented this way.</p>
<h3 id="graphics">Graphics</h3>
<p>(this is from me personally)</p>
<p>They removed from <strong>Plan 9</strong> exactly why I left <strong>Windows</strong> for the <strong>UNIX</strong> family - a convenient typewriter machine.
The standard <strong>Rio</strong> shell and the <strong>Acme</strong> editor/interface require you to have a 3-button mouse.
If you manage to work using only the keyboard, it will be very uncomfortable and will require you to make changes to the code of the basic utilities.</p>
<p>And you know, I tried to work in this paradigm.
But the longer I worked like this, the more I realized that although this is an interesting approach <strong>[you can add your command to Acme by simply writing it in the panel!]</strong>, it does not allow me to work as fast as with a keyboard-oriented interface.</p>
<p>Standard CUA<sup id="fnref:7"><a href="#fn:7" class="footnote-ref" role="doc-noteref">7</a></sup>? Forget it.</p>
<p>Syntax highlighting? Forget it.
<strong>[&ldquo;Don&rsquo;t write such complex code that needs syntax highlighting.&rdquo; Well, it&rsquo;s just a great idea. How could I not have guessed it myself.]</strong></p>
<h2 id="what-to-do">What to do?</h2>
<p>I have been hatching a plan for some time to return the typewriter to <strong>Plan 9</strong> in the form of a small set of programs:</p>
<ul>
<li>tiling window manager (at the stage of experiments with input/output);</li>
<li>simple terminal emulator (not started yet);</li>
<li>emacs-like text editor (at the stage of the first sketches).</li>
</ul>
<p>But here&rsquo;s the dilemma.</p>
<p>Leave <strong>Plan 9</strong> as an ideologically pure artwork and not let it reveal itself to the fullest?</p>
<p><strong>OR</strong></p>
<p>Get in with my dirty hands with software that destroys <strong>[maybe]</strong> the philosophy of the entire OS?</p>
<p>As you may have noticed, I&rsquo;m leaning towards the second option.
Maybe a lot of people won&rsquo;t like what I&rsquo;m going to do.
Even with proper planning and careful work, I&rsquo;m afraid to complicate what I shouldn&rsquo;t.
On the other hand, no one forces them to use this software.
Well, I will not give up tips and commits.</p>
<p>But maybe I&rsquo;m not as lonely as I think I am?
Maybe there are more people who could not &ldquo;switch&rdquo; from <strong>UNIX</strong> to <strong>Plan 9</strong> for similar reasons?
And what happens if they all get, though not identical, but similar to the usual tool on top of a beautiful architecture that you can work with, forgetting about the boundaries of the machine?
I will not rush into such formulations as &ldquo;revolution&rdquo; or &ldquo;unprecedented progress&rdquo;, but this will definitely be an interesting dynamic.</p>
<h2 id="plans">Plans</h2>
<p>With this article, I want to start a series of publications, lyrical and technical, dedicated to <strong>9front</strong><sup id="fnref:8"><a href="#fn:8" class="footnote-ref" role="doc-noteref">8</a></sup> <strong>[Plan 9 fork]</strong>.</p>
<p>Some of the articles will be sketches for my educational work on OS <strong>[&ldquo;be&rdquo; won&rsquo;t mean often!]</strong>.
Technical articles (installation, configuration) will be useful for people who are just starting their acquaintance with <strong>Plan 9</strong>.
As it turned out, there are not so many of them even in English, not to mention Russian.
This way, beginners and those interested will get a faster start than I had.</p>
<h2 id="ps">PS</h2>
<p>Even if you read this article a year, two, five, ten years later and thought the same thing at the time - write to me in one of my resources <strong>[preferably by mail or in nostr]</strong>.
It will be very interesting to know your opinion on this matter.</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p><a href="https://en.wikipedia.org/wiki/Oberon_(operating_system)">https://en.wikipedia.org/wiki/Oberon_(operating_system)</a> Oberon&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p><a href="https://en.wikipedia.org/wiki/Berkeley_sockets">https://en.wikipedia.org/wiki/Berkeley_sockets</a> Berkeley sockets&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:3">
<p><a href="http://9p.cat-v.org/">http://9p.cat-v.org/</a> 9P&#160;<a href="#fnref:3" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:4">
<p><a href="http://doc.cat-v.org/inferno/4th_edition/">http://doc.cat-v.org/inferno/4th_edition/</a> Inferno&#160;<a href="#fnref:4" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:5">
<p><a href="https://news.ycombinator.com/item?id=1732404">https://news.ycombinator.com/item?id=1732404</a> &ldquo;Plan 9 failed simply because it fell short of being a compelling enough improvement on Unix to displace its ancestor. Compared to Plan 9, Unix creaks and clanks and has obvious rust spots, but it gets the job done well enough to hold its position. There is a lesson here for ambitious system architects: the most dangerous enemy of a better solution is an existing codebase that is just good enough.&rdquo; Eric S. Raymond&#160;<a href="#fnref:5" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:6">
<p><a href="http://9p.io/plan9/">http://9p.io/plan9/</a> Plan 9 Foundation&#160;<a href="#fnref:6" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:7">
<p><a href="https://ru.wikipedia.org/wiki/IBM_Common_User_Access">https://ru.wikipedia.org/wiki/IBM_Common_User_Access</a> CUA&#160;<a href="#fnref:7" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:8">
<p><a href="http://9front.org/">http://9front.org/</a> 9front&#160;<a href="#fnref:8" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></itunes:summary>
			<category domain="https://polyserv.xyz/en/posts/">posts</category>
			<guid>https://polyserv.xyz/en/posts/2024-10-28-about-plan-9/</guid>
			<pubDate>2024-10-28T19:00:00Z</pubDate>
		</item>
		<item>
			<title>Time to blog!</title>
			<link>https://polyserv.xyz/en/posts/2024-06-04-time-to-blog/</link>
			<description>Blog in 2K24? Yes.</description>
			<itunes:summary type="html"><![CDATA[<p>Well, looks like now is a great time to start blog.</p>
<p><strong>sarcasm</strong></p>
<p>Indeed, I think this will be a great entry point for my resources. For a long time there was a simple stub that I used for local resources. But then I started one of the projects and started thinking, how can I communicate my contacts to people in a compact way? And here is my own page on the <strong>Internet</strong>. So anyone with a browser and without any account can go in and read if they are interested. Well, my inner graphomaniac will finally find an outlet for his letters.</p>
<p>I use a simple <strong>SSG</strong> <strong>Hugo</strong><sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>. So a blog is a set of generated pages without any engine under the hood. It&rsquo;s both simple and safe. I think dependence on technologies, even free ones, is an addiction. So following <strong>KISS</strong><sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup> in everything is a good plan in my opinion. It should be possible to understand the technology within an acceptable period of time and not overcomplicate it <strong>ever</strong>. The tool should not be more complex than the job for which it is intended. This principle is preached by many: <strong>suckless.org</strong><sup id="fnref:3"><a href="#fn:3" class="footnote-ref" role="doc-noteref">3</a></sup>, <strong>Drew DeVault</strong><sup id="fnref:4"><a href="#fn:4" class="footnote-ref" role="doc-noteref">4</a></sup>, <strong>UNIX</strong>/<strong>Plan 9</strong><sup id="fnref:5"><a href="#fn:5" class="footnote-ref" role="doc-noteref">5</a></sup><sup id="fnref:6"><a href="#fn:6" class="footnote-ref" role="doc-noteref">6</a></sup>, etc. I won’t argue with them, because I mostly agree with them.</p>
<p>I also want to experience those good old days when people just kept their <strong>Internet</strong> pages for themselves and their friends. Before corporations lured everyone onto platforms they controlled. Everything I write here is entirely under my control. If I want, I’ll change it, if I want, I’ll delete it. Yes, someone can make a copy, but it will only be a copy. Of course, this does not mean that I will change everything that is written here every day. But the possibility of this warms the soul.</p>
<p>I will, of course, leave the rest of the resources for cross-posting for now. Over time, perhaps I will get rid of them. Or maybe they will be replaced by new popular resources and tools. At a minimum, this resource will also be available through <strong>Gemini</strong><sup id="fnref:7"><a href="#fn:7" class="footnote-ref" role="doc-noteref">7</a></sup> (seriously, this is a very interesting protocol).</p>
<p>So for now:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-sh" data-lang="sh"><span style="display:flex;"><span>make publish
</span></span></code></pre></div><div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p><a href="https://gohugo.io/">https://gohugo.io/</a> Hugo SSG&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p><a href="https://en.wikipedia.org/wiki/KISS_principle">https://en.wikipedia.org/wiki/KISS_principle</a> Keep It Simple, Stupud&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:3">
<p><a href="http://suckless.org/">http://suckless.org/</a> SuckLess&#160;<a href="#fnref:3" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:4">
<p><a href="https://drewdevault.com/">https://drewdevault.com/</a> Drew DeVault&rsquo;s Blog&#160;<a href="#fnref:4" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:5">
<p><a href="https://en.wikipedia.org/wiki/Unix_philosophy">https://en.wikipedia.org/wiki/Unix_philosophy</a> UNIX Way&#160;<a href="#fnref:5" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:6">
<p><a href="http://9front.org/">http://9front.org/</a> 9front&#160;<a href="#fnref:6" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:7">
<p><a href="https://geminiprotocol.net/">https://geminiprotocol.net/</a> Gemini Protocol&#160;<a href="#fnref:7" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></itunes:summary>
			<category domain="https://polyserv.xyz/en/posts/">posts</category>
			<guid>https://polyserv.xyz/en/posts/2024-06-04-time-to-blog/</guid>
			<pubDate>2024-06-04T19:00:00Z</pubDate>
		</item>
		<item>
			<title>New project</title>
			<link>https://polyserv.xyz/en/posts/2024-06-05-new-project/</link>
			<description>Some LISP for Hare?</description>
			<itunes:summary type="html"><![CDATA[<p>So, about my new project.</p>
<p>His name is <strong>mice</strong><sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup>. For he is small!</p>
<p>I thought, what am I missing as a programmer? That&rsquo;s right, my own <strong>Scheme</strong> dialect. Of course, the point is not that I just want to write an interpreter. The fact is that the new wonderful programming language <strong>Hare</strong><sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup> lives without the ability to extend application logic with any scripting language. This can&rsquo;t go on any longer! <strong>&ldquo;How long!&rdquo;</strong> I thought and sat down to work.</p>
<p>In fact, I expected that much would be unclear to me. But having some experience writing plugins for <strong>Emacs</strong> and a little experience in <strong>Hare</strong> itself, I had an idea where to approach it. I also found an excellent article<sup id="fnref:3"><a href="#fn:3" class="footnote-ref" role="doc-noteref">3</a></sup>, which explains in a very basic but clear way what and how to do. I slightly reworked <strong>Hare</strong> lexer, wrote a small <strong>READ</strong>, tweaked <strong>EVAL</strong>. And before I could blink, my interpreter began accepting test code for calculating <strong>Fibonacci</strong> numbers for interpretation!</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-scheme" data-lang="scheme"><span style="display:flex;"><span>(<span style="color:#66d9ef">define </span>(<span style="color:#a6e22e">fib</span> n)
</span></span><span style="display:flex;"><span>        (<span style="color:#66d9ef">if </span>(= n <span style="color:#ae81ff">2</span>) <span style="color:#ae81ff">1</span>
</span></span><span style="display:flex;"><span>          (<span style="color:#66d9ef">if </span>(= n <span style="color:#ae81ff">1</span>) <span style="color:#ae81ff">1</span>
</span></span><span style="display:flex;"><span>            (+ (<span style="color:#a6e22e">fib</span> (- n <span style="color:#ae81ff">1</span>)) (<span style="color:#a6e22e">fib</span> (- n <span style="color:#ae81ff">2</span>))))))
</span></span></code></pre></div><p>After that, I filed <strong>REPL</strong> itself and now it usable!</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-plain" data-lang="plain"><span style="display:flex;"><span>$ ./mice
</span></span><span style="display:flex;"><span>mice-repl v0.0.0
</span></span><span style="display:flex;"><span>λ =&gt; (define x 12)
</span></span><span style="display:flex;"><span>12
</span></span><span style="display:flex;"><span>λ =&gt; (+ x 25)
</span></span><span style="display:flex;"><span>37
</span></span><span style="display:flex;"><span>λ =&gt; (define y (+ x 25))
</span></span><span style="display:flex;"><span>37
</span></span><span style="display:flex;"><span>λ =&gt; (exit)
</span></span><span style="display:flex;"><span>Bye!
</span></span></code></pre></div><p>Of course, there is still a lot of work ahead, but I can handle it. Initially I thought I would add one primitive per week. But implementing <strong>Scheme</strong> on <strong>Hare</strong> turned out to be so easy that in a short time I was able to add almost all the most basic primitives. I think I will have some difficulties with the garbage collector. Something tells me that no one has done this on <strong>Hare</strong> before me. All that remains is to read the documentation and code examples in good old <strong>C</strong>. Fortunately, <strong>Hare</strong> and <strong>C</strong> have comparable capabilities.</p>
<p>As an unexpected bonus, I received another piece of the “understanding technology” puzzle that I was putting together. Now I can say with confidence that I not only understand exactly how machines process commands and perform the operations described in them, but I have also implemented such a machine, albeit at a very basic level and not in hardware. But who knows, maybe someday I’ll get to a stack machine on <strong>FPGA</strong>.</p>
<p>In the meantime, wish me luck, because I have very big plans for this interpreter.</p>
<p>To be continued&hellip;</p>
<div class="footnotes" role="doc-endnotes">
<hr>
<ol>
<li id="fn:1">
<p><a href="https://codeberg.org/nikita-popov/mice">https://codeberg.org/nikita-popov/mice</a> mice&#160;<a href="#fnref:1" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:2">
<p><a href="http://harelang.org/">http://harelang.org/</a> Harelang&#160;<a href="#fnref:2" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
<li id="fn:3">
<p><a href="https://kflu.github.io/2018/04/15/2018-04-15-implement-scheme/">https://kflu.github.io/2018/04/15/2018-04-15-implement-scheme/</a> Implement Scheme&#160;<a href="#fnref:3" class="footnote-backref" role="doc-backlink">&#x21a9;&#xfe0e;</a></p>
</li>
</ol>
</div>
]]></itunes:summary>
			<category domain="https://polyserv.xyz/en/posts/">posts</category>
			<guid>https://polyserv.xyz/en/posts/2024-06-05-new-project/</guid>
			<pubDate>2024-06-04T19:00:00Z</pubDate>
		</item>
	</channel>
</rss>
