Ideal OS Mark 6

Yeah, it’s been a while, but not forgotten! In between moving homes and jobs and pets I found to do a new release of my IdealOS prototype. And not just a new release, but an actual full rewrite! Let’s take a look at what’s new in IdealOS Mark 6!

Rewrites

The central core process is now entirely in Rust. No more Javascript! The central core handles message passing, the on-disk database, and access to all actual hardware. This means the central core has to be fasty, secure and reliable. This made it a good fit for Rust.

The central core now has a database built around JSON objects. Apps can create, update, delete, and query these objects over a simple network api. Currently the database is loaded from test data files and changes are not persisted to disk, but this will change in the future. The database powers the Music and People (contacts) apps, and eventually almost everything in the system. The central core now also has an audio service which can play MP3s off of disk. This service is implemented with existing Rust libs, since rewriting an MP3 implementation from scratch is way beyond the scope of IdealOS.

The window manager and mouse/keyboard input are also in Rust now. While the Mac version still uses SDL2 underneath, the Linux implementation directly uses the the Linux Frame Buffer API and mouse & keyboard input APIs. This gives IdealOS the lowest level access to the kernel, which will give us more flexibility and power on the Raspberry Pi in the future.

On the client side, apps are still in JS, but they are now using a new UI toolkit called Thneed-Gfx that actual works, for a change. It’s a very traditional style of tree-based UI toolkit, think Swing or UIKit, but simple to understand and extremely portable. It’s also built in TypeScript so maintenance should be easier. It uses a hacky bitmap font of my own design, and a central theming system that's ugly as sin, but it works! It can also run on the web in any HTML Canvas impl, making it useful for other things and easier to test.

What does it look like?

Here ya go. Runs on Mac in a window or Linux full screen. That photo is on my Raspberry Pi 400 with the official keyboard and mouse.

zz

It’s very ugly and very slow. Very slow. That’s because all IPC is local web sockets. When an app wants to draw it sends a drawing command to the central, encoded as JSON, over a web socket. Central parses it, determines where the message should go, re-encodes back to JSON, and sends it to the window manager process, which parses it again, draws to the window’s back buffer, then actually redraws the screen. Whew. That's a lot. One day this will all be done lightning fast through shared GPU memory, but for now it’s good enough. Make it work first, then make it right, then make it fast. We’ll get there.

All the source is on GitHub in the Clogwench repo.

What’s next?

My plan is to continue working from this base. The core is Rust and apps are in Typescript. No more complete rewrites. The next few tasks are:

  • fix the central build so you can make and run the whole system with a single command.
  • move apps to a separate pure JS repo, also with a single build script.
  • heavy work on the multi-line text editor component. Editing text is such a fundamental part of an OS that it has to be good.
  • improve the database to actually persist to disk and have higher level semantics like versioning, security, and domains.

I hope you had a great summer. It’s time to get back to school.

Talk to me about it on Twitter

Posted September 21st, 2022

Tagged: idealos