Sylphide OS: マイクロコントローラベースのコンピュータ向け汎用OS
Sylphide OS: a general-purpose OS for microcontroller-based computers (projects.freehackers.org)
要約
Sylphide OSは、MMUを持たないマイクロコントローラ(MCU)向けに設計された汎用オペレーティングシステムです。80年代のホームコンピュータのような環境を提供することを目指しており、レトロコンピューティングの新たなアプローチとして、安価で入手しやすい最新のMCUを活用します。ハードウェアとソフトウェアはオープンソースで公開されています。
全文翻訳
Sylphide OS
[動画]
What is it ?
Sylphide OSは、マイクロコントローラ(MCU)から作られたコンピュータ向けの汎用オペレーティングシステムです。
MMUがないため、これらのボードは通常、Linuxのようなフル機能の最新オペレーティングシステムを実行できません。
しかし、それらは現在、私たちが80年代に知っていたホームコンピュータと非常に似た環境を提供するのに十分なほど強力になっています。
Context
レトロコンピューティングは今日、非常に人気がありますが、それは多くの異なる意味を持ち得ます。
「古いコンピュータを復元する」(主にプレイやコレクションのため)人々がおり、エミュレータでは古い記憶に対する本物らしさが足りないと言うのが一般的です。
他の、熱狂的なエレクトロニクス愛好家は、古いコンピュータの「再現」に興味を持っています。これは、現代のコンポーネント(安価で入手しやすい)を使用するか、あるいは逆に、それらを所有できる人々にとっては時代に合ったチップを使用します。
さまざまなレイヤー(純粋なソフトウェア、FPGAベース、サイクル精度または高レベルなど)のあらゆる種類のものが存在するエミュレータがあります。1990年以前のほぼすべてのプラットフォームのオンラインエミュレータさえ見つけることができます。
一部の開発者は、通常はゲームですが、最新のコンピュータとソフトウェアを使用して開発し、古いコンピュータをターゲットにしています。
このプロジェクトは、さらに別の方法に関するものです。それは、最新のマイクロコントローラを使用するコンピュータです。これらは安価で、ますます一般的になっています。そしてもちろん、より多くのものが利用可能になると予想されます。
Purpose
伝統的に、コンピュータは強力なプロセッサと多くの周辺機器、特にキーボード、スクリーン、マウスに基づいていますが、マイクロコントローラははるかに低性能で、小さなコアと非常に少ないRAM、そして同じチップ上に多くの組み込みスタイルの周辺機器(UART、SPI、ADC、I2C、カウンタ、タイマーなど)を備えています。
しかしもちろん、テクノロジーが進歩するにつれて、その違いは曖昧になり、私たちは「コンピュータのような」システム設計を処理できるマイクロコントローラを目にするようになります。これは計算能力(MCUはすでにかなりの間強力でした)というよりも、何も出力しないのではなく、VGAやHDMIのような標準ディスプレイ、SPIベースの小型LCDスクリーン、またはDSIに出力できるかどうかにかかっています。入力も同様に困難な場合があり、多くのMCUにはUSBホスト機能がなく、あっても1つのポートしか使用できない場合があります。キーボードとマウスのために少なくとも2つ、理想的にはUSBキー用の3つ目のポートが必要です。
これらすべてを管理できる場合でも、環境は非常に制約されます(低RAM、低色数または色なし)。ユーザーとしてもプログラマーとしても、80年代/90年代初頭のコンピュータのように感じられます。これはまさに私が求めている「レトロコンピューティング」のタイプです。
ここでは、「コンピュータ」は次のように定義されます。
- キーボードとマウスの入力(通常はPS/2またはUSB)
- 標準ディスプレイコネクタ:VGAまたはHDMI
- 実際のフレームバッファ:オンザフライのビデオ信号生成なし
- ストレージ、通常はmicroSDカードですが、USBキーも使用できます
ネットワーク(イーサネット/Wi-Fi)は必須ではありませんが、素晴らしい機能です。
要約すると、これは「開発ボード」(ディスプレイ/キーボード/マウスなしのMCU)と、通常はLinuxを実行できるシングルボードコンピュータの間のプラットフォームを対象としています。
これはオープンハードウェアであり、PCBはKiCadで設計されており、ソフトウェアとハードウェアの両方のソースファイルは、mercurialリポジトリ(https://freehackers.org/electronics/sylphide-os)で見つけることができます。
これはThomas Capricelliによって開発されています。
Sylphide OSという名前は、私がコンサルタントとして活動する際の屋号がSylphide Consultingであることに由来しています。
Hardware
Sylphide OSは当初からさまざまなプラットフォームで実行できるように設計されていました。以下は現在のターゲットであり、それぞれに専用ページがあります。
- Olimex esp32-p4-pc、フラッグシップ製品:新しく、強力です。
- Barebone raspberry pi Pico 2、rp2350でVGA+USBを試みた私のミニマリストな試み。
- FabGL、PS/2入力とVGAを備えた古いクラシック。
- 開発に使用される、(Linux上の)ホストで実行されるエミュレータがあります。
他にもターゲットを考えています。もし、このようなOSを使用できる既製のハードウェアをご存知でしたら、教えてください。さらに良いことに、ご自身でポートを開始してください(ただし、まず私に連絡してください)。
Software
今日のPCオペレーティングシステムは、カーネル、ドライバ、ライブラリ、プログラムなど、さまざまなソフトウェアの大きなバンドルです。しかし、「昔は」、それはむしろ統合された自己完結型のプログラムであり、グラフィカルインターフェースに焦点を当てていました。ドライバは少なく、各コンピュータメーカー、あるいは各コンピュータモデルが独自の専用オペレーティングシステムを持っていたためです。
これが私がここで再現したいことです。
内部では、Sylphide OSは、この種のプラットフォームで一般的に使用される低レベルカーネルであるFreeRTOSを使用しています。これは、タスクの実行や一部の低レベルルーチンを支援します。
その上に、Sylphide OSは以下を追加します。
- マウス、キーボード、ディスプレイ、ストレージ、ネットワーク用のドライバ
- グラフィカルインターフェース
- プログラム
これは、非常に限定されたプラットフォーム(小さなフレームバッファ、モノクロディスプレイ、非常に少ないRAM)で使用できるほど汎用的でありながら、より高性能なプラットフォームの機能も利用できるようにすることを目指しています。
コードは主にC(低レベル、ドライバ、レンダリングライブラリ)とC++(グラフィカルインターフェース用)です。一部のターゲットでは、ドライバにアセンブラを使用しています。C++は非常に限定的な形で使用されており、ソフトウェアを肥大化させない機能のみを使用しています。このような限られたリソースでは、非常に注意が必要です。
Current status
これはまだ0.1であることを念頭に置いてください。
焦点は、クリーンで安定したフレームワークと、いくつかのターゲットに対する適切なドライバを持つことに置かれていました。
利用可能なもの:
- kconfigベースの設定
- フレームワーク:さまざまなSDK、さまざまなプラットフォーム、ツール
- 低レベルレンダリング:フレームバッファ、ビットマップ、フォント
- 適切なドライバを備えた3つのターゲット(+エミュレータ)
- デスクトップ、メニュー、ウィンドウ、ウィンドウマネージャ、デスクトップアイコンを備えたグラフィカルインターフェース。有名な外観を認識するかもしれません。
- ハードウェアとソフトウェアの詳細を表示し、カラー機能を示す情報パネル。
まだ利用できないが、確実に計画されているもの:
- ストレージ(microSD、USB)
- ネットワーク(イーサネット、Wi-Fi)
- ウィジェット(ボタン、チェックボックス、モーダルダイアログなど)
- 外部プログラム(SDカードから実行可能ファイルをロードして実行する)
Project layout
最も重要なディレクトリとファイルは次のとおりです。
.
├── docs # (この)ドキュメント
├── main # ソフトウェア
│ ├── main.c # エントリポイント:初期化 + イベントループ
│ ├── gfx_generic.c # 低レベルグラフィックレンダリングのフォールバック
│ ├── bitmaps
│ ├── fonts
│ ├── arch # プラットフォーム固有のコード
│ ├── gfx # 低レベルグラフィックレンダリング(ビット深度ごとに1つ)
│ └── gui # ウィンドウマネージャ、メニュー、ウィジェットなど
└── tools # ヘルパー
Get in touch
プロジェクトをフォローしたい場合は、私のブログを購読してください。
連絡するには、昔ながらのIRC(インスタントメッセージング)を使用してください。私はliberaネットワークの#freehackersチャンネルにいます。
まだIRCを知らない場合、最も簡単な方法はこのWebインターフェースまたはこの別のインターフェースでしょう。
このフォームからメッセージを送ることもできます。
Contributing
Sylphide OSの作成を手伝いたい場合は、まず私に連絡してください。
リポジトリをフォークするには、まずhttps://freehackers.org/explore(右上「sign in」)でアカウントを作成し、当社のGitLabを使用できます。GitHub、GitLab、Atlassianへのコネクタがあります。
問題が発生した場合は、遠慮なく私に連絡してください。
[1] タイトル: Sylphide OS: a general-purpose OS for microcontroller-based computers
URL: https://projects.freehackers.org/sylphide-os/
本文:
Sylphide OS
[動画]
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.
- Olimex esp32-p4-pc, the flagship product: new, powerful
- Barebone raspberry pi Pico 2, my own minimalist attempt at VGA+USB on a rp2350.
- FabGL, an old classic with PS/2 input and VGA
- There's an emulator that runs on the (linux) host, used for development.
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.