
Interim OS: minimalist OS influenced by Lisp machines and Plan 9 - pmoriarty
https://github.com/mntmn/interim
======
mntmn
Interim author here. Surprised to see this reappear. I'm a bit embarrassed by
the code quality nowadays, but I still like the concept and as critics here
have correctly pointed out, there ought to be a lot less C in it.

Back then I was struggling very hard to get the low level details of the
machine under control (Pi back then and some experiments with x86 BIOS stuff).
It was super fun to have this ham-fisted brutalist JIT actually do something
real and to connect to IRC on this mockery of a TCP stack and to make some VC4
GL triangles appear out of a bunch of commandstream arrays.

In the meantime I've built an FPGA graphics card for Amiga (VA2000) and an
open laptop, the MNT Reform, whose beta units will ship very soon now (TM). A
while ago I also worked with some really smart software engineers as a startup
CTO for 1.5 years and all of these things together have given me a lot more
perspective and depth compared to back then.

It will be fun to return to this and clean it up as a demo for Reform.

~~~
dman
The fact that you are embarassed is a sure sign that you have grown
tremendously as an engineer. Kudos for working on such interesting things.

~~~
wanderfowl
This is a stellar comment, I've always found that a person's level of
(dis)comfort with their past work is a great judge of how willing they are to
learn and improve.

------
DonHopkins
Reminds me of this legendary but true story about Lisp Machine hacking I
posted a few years ago:

[https://news.ycombinator.com/item?id=7879364](https://news.ycombinator.com/item?id=7879364)

Precisely! When Lisp Machine programmer look at a screen dump, they see a lot
more going on behind the scenes than meets the eye.

I'll attempt to explain the deep implications of what the article said about
"Everything on the screen is an object, mouse-sensitive and reusable":

There's a legendary story about Gyro hacking away on a Lisp Machine, when he
accidentally trashed the function cell of an important primitive like AREF (or
something like that -- I can't remember the details -- do you, Scott? Or does
Devon just make this stuff up? ;), and that totally crashed the operating
system.

It dumped him into a "cold load stream" where he could poke around at the
memory image, so he clamored around the display list, a graph of live objects
(currently in suspended animation) behind the windows on the screen, and found
an instance where the original value of the function pointer had been printed
out in hex (which of course was a numeric object that let you click up a menu
to change its presentation, etc).

He grabbed the value of the function pointer out of that numeric object, poked
it back into the function cell where it belonged, pressed the "Please proceed,
Governor" button, and was immediately back up and running where he left off
before the crash, like nothing had ever happened!

Here's another example of someone pulling themselves back up by their
bootstraps without actually cold rebooting, thanks to the real time help of
the networked Lisp Machine user community:

ftp://ftp.ai.sri.com/pub/mailing-lists/slug/900531/msg00339.html

Also eudox posted this link:

Related: A huge collections of images showing Symbolics UI and the software
written for it:

[http://lispm.de/symbolics-ui-examples/symbolics-ui-
examples....](http://lispm.de/symbolics-ui-examples/symbolics-ui-
examples.html)

~~~
equalunique
On the topic of the Symbolics machines, there is a group-buy running until
October 26 for Cherry-compatible keycaps inspired by the look and feel of the
Space Cadet keyboard for the Symbolics Lisp Machine. A Novelty keycaps set
even includes "LMI" and "Symbolics" logo keycaps:
[https://kono.store/collections/all-products-
list/products/sa...](https://kono.store/collections/all-products-
list/products/sa-symbiosis-keycaps?variant=12358483771492)

------
jxy
When you have Lisp, why do you still need a so called filesystem?

The idea of flat text files sounds odd, when you can have structured S-exp's.

~~~
jj12345
I'm just now starting to crack open some Lisp tutorials, coming from the OOP
side of the fence, so please excuse the ignorance. For my learning purposes,
would you be open to explaining how symbolic expressions would circumvent the
need for a file system?

~~~
derefr
Instead of a file system (a system that consumes a block device and exposes a
database mapping a hierarchy of tree-nodes with stringly-keyed names to
seekable byte-buffers), picture something like Erlang’s DETS (a system that
consumes a seekable byte-buffer and exposes a tuple store, where the tuples
are regular in-memory objects that happen to live in an isolated heap which is
memory-mapped from the file.)

Now consider that anything that consumes a seekable byte-buffer as its backing
store could just-as-well be modified to consume a block device as its backing
store.

Voila: your OS now has “durable memory” in place of a filesystem.

(And, in fact, in modern systems you can skip the whole block-device layer and
just sit your tuple store directly on top of NVMe.)

~~~
skissane
I've often wondered, instead of a filesystem, why not a database?

A filesystem is effectively a hierarchical model database with a very limited
feature set (usually no transactions, minimal or no schema enforcement, very
limited query language.)

Why not add some of those features?

Filesystem transactions: Windows supports them, but Microsoft has deprecated
them; part of the reason, I think, is transactions required use of a different
API to access files, which meant almost nobody used them; if they had been
accessible through the same filesystem API as non-transactional operations,
they might have seen more adoption.

Schema enforcement: I could create a directory called "images", and then
specify that all files in images have to be of MIME type image/*, and the FS
will refuse to let me put a text file or executable in there. I could have a
directory called "logs", and require all file names in that directory to have
names containing a valid date/timestamp. I could enforce the rule that a .json
file has to contain well-formed JSON, or a .xml file must contain well-formed
XML.

Querying: filesystem could support SQL queries over file extended attributes.
(It doesn't have to be SQL, SQL syntax is pretty ugly.) "Find all files of
MIME type image/png which are greater than 100KB in size?" "How many
executable files are there? How much space do they consume?"

~~~
pjmlp
Mainframes like the OS/400, now IBM i, do have databases instead of plain file
systems.

~~~
skissane
Most mainframe and minicomputer filesystems support record-oriented files, and
indexed/keyed files. In Unix/Windows land, if my file has 80 byte fixed width
records, that's an application file format detail, and the filesystem knows
nothing about it. In mainframe/minicomputer systems, the file is declared to
the filesystem as F80 (fixed-width 80 byte records), and the FS will force all
reads/writes to be in multiples of the record size.

Now, you can call this a "database", although it is basically a flat-file
database (ISAM/VSAM). But then, many mainframe/minicomputer relational
database products use this as their underlying storage layer, and put SQL on
top of it. But the SQL access is an application layer, not part of the actual
OS-level filesystem. In some cases, you can have legacy apps directly
accessing the files via ISAM/VSAM, bypassing the relational layer, while
having newer apps going through the SQL interface instead to read/write the
very same files.

Where OS/400 / IBM i makes this picture a bit more complex, is the relational
layer is shipped as part of the OS, not as a separate product. What I can't
work out, is how deep the integration actually is. Is it just like a
relational database bundled with the OS (like how many Linux distros bundle
MySQL and Postgres?) Or does it reach deep down into the OS kernel? There is
not much technical info available on OS/400 internals, and I wonder if IBM's
marketing/evangelism makes the integration sound deeper than it really is?

But, the idea I had was you can use SQL queries to locate ordinary files.
Imagine if I had a view VW_FILES which contains metadata
(name/directory/size/etc) of every file in my filesystem, and I could query it
with SQL. I don't believe OS/400 / IBM i offers that kind of feature. It just
allows SQL queries of the contents of database files.

~~~
pjmlp
Last time I touched OS/400 was in 1993, where my sole job was to manage weekly
tape backups, so I don't remember much technical details.

I ended up reading OS/400 Redbooks years later.

However I remember that all file related activities were done via the catalog
management tools, files weren't visible as such.

------
pjmlp
> C 88.8% Common Lisp 6.4% C++ 3.1% Assembly 0.7%

I would expect a bit more Lisp in an OS that is supposed to be inspired by
Lisp Machines.

~~~
DonHopkins
Lisp is just such a powerfully concentrated language that it's doing 85% of
the work even though it's just 6.3% of the mass. ;)

It's like Dr. Bronner's soap: Dilute! Dilute!

------
rudolfwinestock
Previous Discussion:
[https://news.ycombinator.com/item?id=10222934](https://news.ycombinator.com/item?id=10222934)

------
nanomonkey
The documentation specifies the Raspberry Pi 2. Are there problems getting
this to load on other version? I have a RPi 1 and a 3.

