posts: 06d, 06e
authorLucian Mogosanu <lucian.mogosanu@gmail.com>
Mon, 16 Apr 2018 11:58:18 +0000 (14:58 +0300)
committerLucian Mogosanu <lucian.mogosanu@gmail.com>
Mon, 16 Apr 2018 11:58:18 +0000 (14:58 +0300)
posts/y04/06d-what-is-an-os.markdown [new file with mode: 0644]
posts/y04/06e-sieranevada-cuibul-de-viespi.markdown [new file with mode: 0644]

diff --git a/posts/y04/06d-what-is-an-os.markdown b/posts/y04/06d-what-is-an-os.markdown
new file mode 100644 (file)
index 0000000..dbb6e4d
--- /dev/null
@@ -0,0 +1,212 @@
+---
+postid: 06d
+title: What is an operating system?
+date: April 13, 2018
+author: Lucian Mogoșanu
+tags: cogitatio, tech
+---
+
+The last time I visited the field of
+[operating system design][os-design], I concluded that journey with
+questions. That line of questioning didn't solve much, but merely
+provided a sort of hierarchy that aims to reconcile current
+well-established designs, i.e. Unix, with proposed designs from current
+research, e.g. microkernels, unikernels. I now propose the idea that my
+previous proposal was utter, unmitigated bullshit. I further propose
+that current definitions of the term operating system are ill-conceived,
+and that the problem of how to properly design a general-purpose
+operating system is in principle unresolvable, first and foremost
+because there is no such thing as a "general-purpose operating system".
+
+In defining the operating system, let us first defer to our priors. We
+begin with Tanenbaum[^1]:
+
+> The machine language typically has between 50 and 300 instructions,
+> mostly for moving data around the machine, doing arithmetic, and
+> comparing values. [...] For example, a disk can be commanded to read
+> by loading the values of the disk address, main memory address, byte
+> count and direction [...] into its registers.
+>
+> To hide this complexity, an operating system is provided. It consists
+> of a layer of software that (partially) hides the hardware and gives
+> the programmer a more convenient set of instructions to work
+> with. [...]
+>
+> On top of the operating system is the rest of the system
+> software. Here we find the command interpreter (shell), window
+> systems, compilers, editors and similar application-dependent
+> programs. It is important to realize that these programs are
+> definitely not part of the operating system, even though they are
+> typically supplied by the computer manufacturer. [...] The operating
+> system is (usually) that portion of the software that runs in **kernel
+> mode** or **supervisor mode**. [...] Compilers and editors run in
+> **user mode**. If a user does not like a particular compiler, he is
+> free to write his own if he so chooses: he is not free to write his
+> own clock interrupt handler, which is part of the operating system and
+> is normally protected by hardware against attempts by users to modify
+> it.
+
+The Modern Operating Systems (MOS) definition goes bottom up from the
+hardware to the user, and delimits the operating system as the software
+component running in supervisor mode. I propose that this is at best a
+confusion in terms (and at worst bullshit): the operating system
+*kernel* is indeed the software component residing in supervisor mode,
+or ring 0, name it what you will. But on what grounds do we state that
+the kernel is equivalent to the operating system in its entirety?
+"Andrew Tanenbaum is a god in the field of distributed systems" is not
+an argument, or at least not one worth taking into account.
+
+Then Tanenbaum sets to make politics instead of science. Despite being a
+proponent of the microkernel design, he decides that the user may modify
+their compiler, but not their kernel. To which we humbly ask, on what
+fucking basis? I can readily invalidate this argument on any GNU/Linux
+box that I own, and thus there it is, GNU/Linux -- *not* just Linux! --
+is an operating system.
+
+Then later (not quoted here) Tanenbaum mentions embedded OSes, but he
+does not mention, say, Sinclair BASIC, which is technically speaking an
+operating system, despite the fact that it does not reside in a special
+supervisor mode. How do we delimit the operating system from the
+application base in that case? Are ZX Spectrums (or say, Lisp machines)
+embedded systems and I didn't know?
+
+Since MOS does not even get close to satisfying our intellectual
+curiosity, we move on to Silberschatz et al.'s[^2] Operating System
+Concepts, aka OSC:
+
+> We have looked at the operating system's role from the views of the
+> user and of the system. How, though, can we define what an operating
+> system is? In general, we have no completely adequate definition of an
+> operating system. Operating systems exist because they offer a
+> reasonable way to solve the computer problem of creating a usable
+> computing system. [...]
+>
+> In addition, we have no universally accepted definition of what is
+> part of the operating system. A simple viewpoint is that it includes
+> everything a vendor ships when you order "the operating system". The
+> features included, however, vary greatly across systems. [...] A more
+> common definition is that the operating system is the one program
+> running at all times on the computer (usually called the **kernel**),
+> with all else being systems programs and application programs. This
+> last definition is the one that we generally follow.
+
+Here the authors try to give a more rigorous definition, but they admit
+in failing to do so. Indeed, there is no clear delineation of where the
+operating system ends and the service or the application starts; but
+this is not a matter of acceptance, but one of properly defining our
+notions so as to not muddy our understanding of this universe. And yet,
+Silberschatz et al. end up confusing the kernel with the OS again, and
+then they go on writing an entire book on the subject[^3].
+
+Given the lack of a proper definition, we, as educated people, are left
+with the unpleasant task of figuring one out ourselves. Fortunately
+though, the previous definitions are not entirely wrong, they are merely
+crooked. The operating system is, as Tanenbaum points out, a set of
+abstractions, given that e.g. most of the time the user doesn't have the
+time to deal with processor interrupts and task scheduling. These
+abstractions, as Silberschatz et al. point out, may be implemented as
+programs meant to assist a human operator, i.e. user[^4], in the
+*operation* of a computer system.
+
+Fundamentally, the set of abstractions that make up an operating system
+comprises two classes of items: first, a language to be employed by the
+user; then, a set of operation tools, which tools may be either
+general-purpose, or on the contrary, very specific, depending on the
+system and on the task that the user wants to achieve. Does this
+description sound familiar?  Well, it should, because we've just
+described the key elements of any general-purpose programming language
+out there. And that's fine, because formal languages and automata are
+isomorphic!
+
+So, is the C programming language an operating system? That sounds like
+a stupid proposition. I don't know about C, but isn't Unix an operating
+system? All \*nixes are specified by the UNIX standard, also known as
+IEEE Std 1003.1™, also known as POSIX.1. In fact, the UNIX standard
+specifies an operating system at two levels, both of which rely on a
+common set of definitions. The first level is the system interface,
+usually employed by C programmers to write e.g. system applications such
+as web servers; the language here is thus usually C, while the tools are
+the system API. The second level is the shell interface, which includes
+the shell command language, some built-in utilities such as `echo` and
+`set`, and a set of general-purpose utilities such as `ls`, `awk`,
+`grep` etc. This, all of this, represents the *UNIX operating system* --
+notice how I haven't mentioned "kernel" or "supervisor mode" anywhere,
+because these are implementation details which may vary from one system
+to another.
+
+What other operating systems do we have at our disposal, then? Let's
+enumerate a few more.
+
+Is Java an operating system? Again, I don't know about the language
+itself, but Java, the JVM run-time and the libraries do form an
+operating system. The same goes for most Common Lisp implementations,
+which may in some cases require some extensions for e.g. threading, but
+are otherwise operating systems in their own right. What about Emacs
+then?  Yes, Emacs is an operating system built on top of a text editor,
+and I'm not even joking: I am writing this text, using IRC, sending
+e-mails, organizing notes and setting up music playlists, all from
+Emacs, so that makes it very much a general-purpose OS.
+
+Notice how all these systems make use of general-purpose tools, which is
+what makes them systems, as opposed to appliances, which use only
+specific tools. However, each operating system differs from another in
+some specificity or another. For example, TeX and its tools form an
+operating system, and while theoretically they can be used for any task,
+in practice they are used for typesetting. Similarly, web browsers are
+operating systems, generally exposing JavaScript as their language, but
+we don't use them for... in fact, people are using them for all sorts of
+applications nowadays, so who am I to judge. Similarly, Excel is an
+operating system for data-flow applications, etc.
+
+This then kills the myth of the general-purpose operating system. If
+there were such a thing, then it is conceivable that we would now use
+GPOS instead of GNU/Linux, Chrome OS, MacOS or SLIME -- and when I say
+"if there were", I mean that there exists no such thing in the
+observable universe, and until someone proves the opposite, I reserve
+the right to remain very skeptical. And since there is no such thing, we
+are left with operating systems which are only somewhat general-purpose,
+but which in fact differ very much in the way they work and/or the tasks
+they are suited for. Their particular organization is of course
+interesting -- they are nested, or co-located on the same hardware, and
+they often communicate in various ways from which stem such and such
+complexities -- but all these are details that must be taken precisely
+as the details they represent.
+
+Thus, this essay untangles some concepts, laying a (not in any way
+novel, mind you!) foundation for designing operating systems that
+[do not suck][software-engineering-iii]. Please to properly cite these
+ideas in your paper, or else.
+
+[^1]: Tanenbaum, Andrew S. *Modern operating systems*, 2nd Ed. Prentice
+    Hall Press, 2007.
+
+[^2]: Silberschatz, Abraham, et al. *Operating system concepts*, 7th
+    Ed. John Wiley & Sons, 2005.
+
+[^3]: The reader might be inclined to handwave this as empty sarcasm,
+    while my observation is pointedly *not* this. This misunderstanding
+    has led us to the mess in current systems; for example, did you know
+    that the entirety of [Android][android] has at least two layers of
+    memory allocation present? There's the buddy allocator in Linux, and
+    then on top of it there is the kernel slab allocator, which serves
+    kernel object allocation. But this buddy scaffolding is also used to
+    expose `mmap` to user space. Then on top of `brk` and `mmap` the C
+    library builds `malloc`, so three! Three levels! Then on top of this
+    the Java Virtual Machine builds its own memory management system
+    based on garbage collection, so four levels!
+
+    Despite what some may say that "we need" "abstractions", this hell
+    is mostly the consequence of politics and incompetence. Yes, each of
+    these abstractions may be useful under some circumstances, but no,
+    they're not (at) all *needed*.
+
+[^4]: Please to not confuse the current popular "user" with the proper
+    meaning of the term. A user is one who makes use of a computing
+    machine in order to achieve some particular task. Thus an accountant
+    doing their Excel stuff is as much a user as a hacker hacking at the
+    kernel, only in two entirely different contexts. The user versus
+    programmer tribalism is... uncivilized, to say the least.
+
+[os-design]: /posts/y01/03a-the-linguistic-barrier-of-os-design.html
+[android]: /posts/y02/03f-android-the-bad-and-the-ugly.html
+[software-engineering-iii]: /posts/y03/04e-the-myth-of-software-engineering-iii.html
diff --git a/posts/y04/06e-sieranevada-cuibul-de-viespi.markdown b/posts/y04/06e-sieranevada-cuibul-de-viespi.markdown
new file mode 100644 (file)
index 0000000..4d57efb
--- /dev/null
@@ -0,0 +1,239 @@
+---
+postid: 06e
+title: Two on the parastas: Sieranevada and Cuibul de viespi
+date: April 16, 2018
+author: Lucian Mogoșanu
+tags: video
+---
+
+Romanian funeral and memorial services are interesting, somewhat
+peculiar and necessarily Christian Orthodox proceedings. You have to see
+one to notice its peculiarities, and you have to actually live through
+one to start comprehending its subtleties; and while experimenting
+things is out of fashion nowadays, Father Time giveth not even the
+slightest fuck what people want and it forgiveth no one. The older ones
+around you usually go first, then it's your time, and in all civilized
+societies, people firstly participate in that which links the gone to
+the otherworldy, and only then they mourn in silence and carry on with
+their lives. The proceedings of course bear some value for the alien
+anthropologist etc., anyway, this is but an aside[^1].
+
+The first item under scrutiny is Cristi Puiu's superb Sieranevada, a
+lengthy onion-shaped film, in that it is structured in layers waiting to
+be peeled by the scrupulous viewer. The film takes place in a wintery
+Bucharest of 2015, about [this or that time][charlie-hebdo], a Bucharest
+which incidentally is not that different from the same place in 2018, at
+least not from the points of view illustrated in our piece. People go
+about their lives much like ants, preocuppying themselves with this or
+that minor issue, or at least that's what the exposition would have us
+believe.
+
+One of the layers embedded within Sieranevada's structure confronts the
+viewer with the general problem of managing a family. Traditional
+Romanian families are relatively large: back in the days when Romanians
+were preponderently organized in villages, everyone knew everyone, so
+who married whom was usually a pretty clearly cut deal; now, in the
+modern days of urban villages, things are in fact not that different,
+the difference being mostly geographical in nature. Anyway, everyone's
+related to everyone else in some way or another.
+
+There is for one that old story of the fruit that doesn't fall far from
+the tree, illustrating that so-called mistakes tend to be repeated by
+exponents of the next generation in pretty much the same ways the
+previous one did it. So you see, the husband's upset that his wife
+doesn't know how to give blowjobs, regardless of the fact that the derp
+in question was entirely incapable to find a woman who would be willing
+to do that in the first place. Then we find out that the faithful
+husband (the other one) was oh, not so faithful after all, and that the
+wife knew, and now what? he's gone anyway; and that the cousins are
+obnoxious, the uncle is an old fucker and that the kids are generally
+little pieces of shit. There's more to it than that. The viewer is
+encouraged to analyze in more depth; who would have thought that such
+complexity could arise from just putting a bunch of people in an
+apartment and looking at the relations between them, eh?
+
+Then there's the social layer. At some point during communism, a bunch
+of people had the naive impression that if they worked hard enough, they
+-- well, maybe not they, but at least their children will succeed. And
+it so happens that the smarter ones did! The older son is a doctor of
+sorts, and the younger one works in the army, so they're at least one
+step more accomplished than their forefathers. We're also faced with the
+exact opposite situation: the uncle's social situation isn't explicitly
+stated, but given that he's unable to keep a family with two children
+who have just grown into their adulthood -- one who's a rebel chick no
+one gives a fuck about, and the other a kid who spends most of his time
+in the YouTube indoctrination camp -- we're led to believe that he is in
+fact a nobody.
+
+And of course, there's the frustrated ex-"[party cadre][theses]" old
+woman who keeps yammering about how communism was all about the "greater
+good" and about how "sacrifices had to be made", the despicable old hag
+who is [guilty][vina-batranilor] of simply having existed on the face of
+the Earth during the communist years. She touts about all the "progress"
+brought about by her dear communists, not even discussing that no, the
+people did not need fucking apartment blocks in order to live better,
+and that some of them lived better before being crammed in those nasty
+matchboxes, and that overall, decades of living in matchboxes resulted
+in everyone being worse off than before. And yes, the young woman is
+right, the fact that she gets to sit at a table with everyone else,
+including the failed guy, is an offense to everyone having to listen to
+her insufferable crap. I tip my hat to both the actress and the director
+for this part, she'll go down in history as *the* archetypal communist
+lady still living as a parasite in the 2010s.
+
+Then the last layer -- at least as far as this armchair movie critic can
+tell -- goes full circle, blending the old and the new in the very same
+matchbox-apartment where most of the action takes place. By the way,
+who would have thought that a good film can be made using only one
+stage? This was a thing back in the day when people still made movies.
+
+Anyway, the last layer exposes the bonds between the olds and the news
+through the simple act of documentation. We have, give or take, two
+generations of a family, three if we count the baby. A memorial service
+is presented in the literal sense: the priest and the small choir
+perform the memorial service exactly as-is, which again, makes this
+quite a documentary. Then, the West is presented through the distorted
+lens used by Romanians, at micrometer precision: leaving aside the fact
+that they all think they know "who was behind 9/11", the music, the
+television, all the modern crap down to the suffocatingly crowded
+Bucharest with its middle-class people preparing their kids for Disney
+cosplay, all these are entirely accurate -- ask me how I know this. The
+very intro depicts approximately ten minutes of Bucharestian "cotidian",
+which is almost everything that can be said on the subject.
+
+Finally, the actors are accurate firstly because they're good, and not
+lastly because Cristi Puiu may have been able to pull this off with say,
+Russians, but definitely not with Czech, or, heavens forbid, French
+actors. A fine eye can discern the exact pedigree of each of the actors
+just by looking at the Romanianness of their acting, going back to the
+days when "[aferim][aferim]" was still in use.
+
+So at the end the guys have a laugh. Not impressive, but what can I say,
+at least they didn't have to bring
+[British journalists][nevermind-the-balkans] to document the thing.
+
+The second item under scrutiny is Cuibul de viespi (The wasps' nest), a
+1987 picturization of Alexandru Kirițescu's Gaițele (The magpies). The
+film is part comedy-part snorefest, and I expect that the original play
+is not very far off, but we'll have to work with what we have. In any
+case, the movie is way too burdened with late totalitarian communist
+influence to be of any notable value, but again, we work with what we
+have.
+
+The action takes place somewhere in the 1930s. Aneta, the wife of the
+late Tase Duduleanu, is an old yet rich and powerful woman. She is also
+the sister of two other women, one stupid, the other also a
+narcissist. She also has two sons, Ianache and George (frenchized
+Georges) and a daughter, Margareta (frenchized Margot), who is the
+family snowflake, and incidentally the object of the parastas and a
+pretext for everything presented by the authors.
+
+Margot becomes the wife of one Mircea from Bucharest, a seemingly noir
+figure, but in a very forced manner that annoyed the hell out of
+me. Anyway, Mircea becomes enamoured with Wanda, an expensive whore
+freshly returned from Paris, so at one point Margot finds out, she kills
+herself, and thus the family ends up organizing a small party in the
+family tomb. The end, big whoop.
+
+There are good parts and bad parts. One of the bad parts is that the
+acting is most of the time very exaggerated. This is very typical of
+Romanian actors, but this one is beyond all Romanian movies that I
+remember, and I've seen quite a few of them. Yes, I get that this is a
+comedy, but the exaggeration is usually meant to tilt situations and
+characters towards the artistic and not away from it. Take by contrast
+the [Rădulescu-Caragiu rendition][petitiune] of Caragiale's Petițiune,
+and you'll see how bad a job Horea Popescu has done with his Wasps'
+nest.
+
+Another bad part is the aforementioned communist thing which makes the
+movie completely unsalvageable. The typical tropes -- i.e. the bourgeois
+are evil, the kids are assploited, the servants are badly treated and
+the social life (of actual people) is full of debauchery -- permeate
+throughout the whole thing in a way completely lacking verisimilitude:
+yes, women are whores, so how does that automagically make them bitches?
+what, you think women weren't whoring during the communist years? And,
+how the fuck does a man take random chick into his home and just
+promises to marry her like that? Now now, really.
+
+The good parts are few and far between, as follows. First, the cast:
+Tamara Buciuceanu does a pretty good job when she doesn't completely
+exaggerate her acting, and so does Ileana Stana-Ionescu, whose Germanian
+-- a mix of German and Romanian -- is hilarious; Marin Moraru and
+Gheorghe Dinică (playing the young brothers Duduleanu) are
+stellar. Then, the intellectual status of cultivated people in the '30s
+is (unexpectedly!) correctly represented, as illustrated by the fact
+that the average educated person could speak three or four languages,
+whereas the average educated communist could speak maybe Russian, maybe
+French, but rarely both. Sadly, this is where the good parts end.
+
+Finally, we have the parastas, which funnily enough, is missing. Getting
+priests on the tape was most likely verboten, despite the fact that the
+film does not depict communist Romania and also that even in the '80s
+communist Romanians had memorial services; because
+[remember][christian]:
+
+> The majority of people living on what is now Romanian soil have been
+> Orthodox Christians centuries before such a thing as a "Romania" even
+> existed. Even today's rationalist-atheist propaganda makes only a
+> small dent in Romanians' belief, which makes the Romanian Orthodox
+> Church one of the country's most powerful institutions, religious,
+> political or otherwise.
+
+All in all, a pretty bad movie, that turned out to be much worse
+re-seeing it after circa ten years.
+
+So there you have them, two depictions of Romanian families remembering
+their dead. One new, one old, the new one clearly superior in each and
+every possible way, save for the voice quality, which is awful in Cristi
+Puiu's film and just plain bad in Horea Popescu's. But the same can be
+said of most (all) of Romanian movies, so it helps to have subtitles
+ready for them.
+
+[^1]: Speaking of asides: I wanted to keep this review without too many
+    parentheses, but I just can't help it.
+
+    "Parastas" comes from the greek "parastasis", which literally means
+    standing (στασις) beside (παρά-). In Christian-Orthodox tradition,
+    the passed-away's closed ones spend the first night after death in
+    vigil, watching over the passed-away's remains, and, symbolically,
+    over the soul which has yet to cross into the other world. Then, at
+    the day of the funeral, the dead is (at least at the funerals I've
+    been to) walked on a last visit near places that were important to
+    them during their life, just before the actual burial. On this walk,
+    coins are often thrown by the mourners at crossroads. In some
+    regions (and also as can been observed in the movie), the dead's
+    relatives also go through the ritual of wrapping handkerchiefs
+    around coins and handing them to other participants.
+    
+    Now, why would this be? The internets seem to be of help
+    here. [I quote][parastasis]:
+
+    > PARA´STASIS (παράστασις), a fee of one drachm paid to an
+    > arbitrator by the plaintiff, on bringing his cause before him, and
+    > by the defendant, on putting in his answer; likewise on making an
+    > application for delay, and probably also on making a
+    > counter-affidavit [...]
+
+    This is somewhat funny, because the coin-throwing thing is older
+    than Christianity; it in fact symbolizes the fee paid by the dead to
+    cross the Styx into the other world. This meaning is closer to the
+    actual "parastas" (not to the vigil, which is simply "priveghi" in
+    Romanian), which is an official service (that is, it involves a
+    priest) to help the dead be received into Heaven -- for srs, listen
+    to it! it's in Sieranevada. This is then followed by a dinner from
+    which koliva and strong alcohol are never-ever absent, which makes
+    this a party, sort-of.
+
+    Maybe only through coincidence, the ancient Dacians in the
+    geographical region of Romania also commemorated their dead through
+    celebration. But my naive self may just like to believe that some of
+    the ancient traditions remained with the passing of millenia.
+
+[parastasis]: https://archive.is/pfn3o
+[charlie-hebdo]: /posts/y01/037-charlie-hebdo.html
+[theses]: /posts/y03/05a-july-theses.html
+[vina-batranilor]: http://trilema.com/2010/vina-batranilor
+[aferim]: /posts/y01/039-aferim.html
+[nevermind-the-balkans]: /posts/y02/03d-never-mind-the-balkans-heres-romania.html
+[petitiune]: https://www.youtube.com/watch?v=ksbIJI27_Rs
+[christian]: /posts/y03/05a-july-theses.html#fn33