Profile
Back to NewsBack
Hacker News 6 min
Reader Mode
Sylphide OS: a general-purpose OS for microcontroller-based computers

Sylphide OS: a general-purpose OS for microcontroller-based computers

2 hours ago

Sylphide OS

Overview

What is it ?

Sylphide OS is a general-purpose Operating system for computers made from microcontrollers (MCU).

Lacking MMU, those boards are usually not able to run a full-fledge modern operating system such as Linux.

Yet they are now powerful enough to provide an environment very similar to home computers as we knew them from the 80's.

Context

Retrocomputing is all the rage nowadays, but it can mean a lot of different things.

There are people "restoring old computers" (mostly for playing and collecting), typically telling you that emulators dont feel genuine enough for their old memories.

Others, die-hard electronic freaks, are interested in 'recreation' of old computers, either with modern components (cheap, easy to source), or on the contrary with era-exact chips for those who can afford them.

There are emulators of all kind, at different layers (pure-software, FPGA based, cycle-accurate or higher level, ...). You can even find online emulators for almost all platforms before 1990.

Some are developing software, usually games, using modern computers and software, but targeting old computers.

This project is about yet another way: computers using modern microcontollers. There are cheap and more and more common. And of course we expect more will be available.

Purpose

Traditionally, computers are based on powerful processors, with lot of peripherals, more importantly keyboard, screen and mouse, while microcontollers are a lot less powerful, packing a small core with very little RAM and lot of embedded style peripherals on the same chip. Things like UART, SPI, ADC, I2C, counters, timers, and so on.

But of course, as technology evolves, the difference got blurred, and we start to see microcontrollers that can handle "computer-like" system design. It's not so much about compute power (MCUs have been very powerful from some time already), but rather about being able to output to a standard display like VGA or HDMI, rather than nothing, SPI-based small LCD screens, or DSI. To a lesser extent, input can also be challenging, lot of MCUs just have no USB host capability, and when they do, only one port can be used. You want at least two for keyboard and mouse, and ideally a third one for usb key.

When you manage to get all of that, you still have a severely constrained environment (low ram, low colors if any). It really feels like early computers from 80's/90's, both as a user and as a programmer. This is exactly the kind of 'retrocomputing' I'm after.

Here, a "computer" is defined as having:

  • keyboard and mouse input, usually either ps/2 or USB
  • a standard display connector: VGA or HDMI
  • a real framebuffer: no 'on-the-fly' video signal generation
  • storage, usually microSD card, but USB keys can also do

Network (ethernet/wifi) is not required, but is a great feature to have.

As a summary, it's targeted to platforms between "development boards" (MCU without display/keyboard/mouse) and Single-board computer which are usually able to run Linux.

This is open hardware, the PCB is designed with KiCad, and source files for both software and hardware can be found on the (mercurial) repository at https://freehackers.org/electronics/sylphide-os.

It is developed by Thomas Capricelli.

It's called Sylphide OS because Sylphide Consulting is the name under which I work as a consultant.

Hardware

From the beginning, Sylphide OS was designed to run on different platforms. Here are the currently targets, each one has a dedicated page.

I got some other targets in mind. If you know of readily hardware that could use such an OS, tell me about it. Or even better, start a port by yourself (but please contact me first).

Software

Nowadays, a PC operating system is a big bundle of different software (kernel, drivers, libraries, programs). But "back in the days", it was rather an integrated and self contained program, focused on the graphical interface. Drivers were few, because each computer manufacturer, or even each computer model had it's own dedicated operating system.

That's what I want to recreate here.

Under the hood, Sylphide OS uses FreeRTOS, a low-level kernel typically used on this kind of platform. It provides helpers for running tasks and some low-level routines.

On top of that, Sylphide OS adds:

  • drivers for mouse, keyboard, display, storage and network
  • graphical interface
  • programs

It aims to be versatile enough to be usable on very limited platforms (small framebuffer, monochrome display, tiny RAM), while still being able to use features for higher specs ones.

The code is mostly C (low-level, drivers, rendering library) and C++ (for the graphical interface). Some targets use assembler for drivers. C++ is used in a very limited form, using only features that would not bloat software. You really want to be very careful with such limited resources.

Current status

Keep in minde it's only 0.1.

The focus was on having a clean/stable framework and proper drivers for a few targets.

What you get:

  • kconfig-based configuration
  • Framework: different SDKs, different platforms, tooling
  • Low-level rendering: framebuffer, bitmaps, fonts
  • Three targets (+ emulator), with proper drivers
  • Graphical interface with desktop, menu, windows, windowmanager, desktop icons. You might recognize a famous look.
  • Information panel displaying hardware and software details and demonstrating the color capabilities.

What you don't have yet, but definitely planned:

  • storage (microsd, usb)
  • network (ethernet, wifi)
  • widgets (button, checkbox, modal dialog, ..)
  • external programs (loading an executable from sdcard and execute it)

Project layout

The most important directories and files are:

.
├── docs                        # (this) documentation
├── main                        # software
│   ├── main.c                  # entry point: init + event loop
│   ├── gfx_generic.c           # fall-back for low-level graphic rendering
│   ├── bitmaps
│   ├── fonts
│   ├── arch                    # platform-specific code
│   ├── gfx                     # low-level graphic rendering (one for each bit depth)
│   └── gui                     # window manager, menu, widgets, ...
└── tools                       # helpers

Get in touch

If you want to follow the project, subscribe to my blog.

For contacting me, use old-school IRC (instant messaging). I'm on channel #freehackers, on the libera network.

If you don't know IRC already, the easiest way is probably this web interface or this other one.

You can also send me a message through this form.

Contributing

If you want to help writing Sylphide OS, really the first thing you should do is contacting me.

You can use our gitlab to fork the repository: first create an account on https://freehackers.org/explore (top-right "sign in"). There are connectors to github, gitlab and atlassian.

In case of problem, contact me, don't be shy.

Chat with me