franck v ykw0jjp7rlu unsplash 4

I’ve said earlier, that Linux would be inefficient with The Machine computer architecture, because its different memory model. Thus, as I said earlier, The Machine requires development of a radically new operating system, not just an adaptation of Linux. I have said: Linux is dead.

Recently I have realized that this is wrong: We indeed can adapt Linux to The Machine, and it will be fast enough.

I recall that the one of the main differences of The Machine from older computer hardware is that all its memory is persistent and fast (using memristor technology). There are no caches and no separate RAM and disk.

So, why I now think Linux (and similar long developed systems, such as FreeBSD) would use The Machine’s memory efficiently?

The reason is the following:

  1. In modern operating systems there are two main kinds of objects: files and processes (programs) (There are other kinds of objects, such as devices or mutexes, but I will skip this topic.)
  2. With files there is no problem: they are just stored in persistent memory organized as filesystem(s), and The Machine’s memory can be structured as one big filesystem or several partitions with filesystems, just like disks of old computers.
  3. Processes are in some sense not persistent, by definition. After a program exits, its program memory must be erased, in order not to allow other processes to retrieve potentially sensitive data. So, despite of the fact that in The Machine all memory is persistent, process memory behaves in such a way as if it would be non-persistent RAM.

Next question: How to allocate memory for processes? The most straightforward variant, is just to create for every process a special non-persistent file which holds the process memory, using mmap to efficiently access it.

It is possible to allocate a partition for memory specifically, but it is probably not necessary as all memory (including processes’s memory) can be hold in files in a filesystem.

One advantage of all memory being persistent is that we can momentarily turn on the computer and it would continue from the point where it has finished. No need for booting after every turning on.

Reboot however is a useful feature, to do with bugs, kernel updates, or just if a user wants to start the system from the beginning.

All this can be done with Linux.

It also was said by someone that The Machine requires new programming languages to use memory efficiently. It is wrong. In reality, processes use logically non-persistent memory, as I’ve described above. No need to introduce new programming languages with different memory handling. And if a process requires persistent storage, they can be used (possibly mmaped) files. I recommend to use traditional programming langauges such as Ada for The Machine.