Running Beryllium OS on the RP2040 that is inside the x2l and X4

Hi yall,

I’ve recently managed to get Beryllium OS up and running on the RP2040 microcontroller inside the X2L and X4 devices, and I wanted to share the steps with you guys since its a straightforward process. Credit goes to @bill88t which is the developer of BerylliumOS. You should also go checkout BerylliumOS for yourself if you want https://github.com/beryllium-org/OS

Step-by-Step Guide

  1. Download the CircuitPython UF2 File:
    First, you’ll need to download the appropriate CircuitPython UF2 file for the Raspberry Pi Pico (RP2040):
    Download CircuitPython UF2 File

  2. Put the RP2040 into UF2 Mode:

    • Locate the BOOTSEL button between the USB A 2.0 and 3.0 ports on your device.
    • Press it.
    • This will mount the RP2040 as a mass storage device named RPI-RP2
  3. Flash the CircuitPython UF2 File:

    • Open the RPI-RP2 folder that appears on your computer.
    • Drag and drop the downloaded adafruit-circuitpython-raspberry_pi_pico-en_US-9.1.0.uf2 file into this folder.
    • The microcontroller will automatically reboot once the file is copied. A new “device” will appear called CIRCUITPY that means everything went well
  4. Clone and build Beryllium OS :
    Open a terminal on your computer and execute the following commands:

    git clone https://github.com/beryllium-org/OS
    cd OS/source
    make install
    
  5. Restart CircuitPython:
    After installing Beryllium OS, restart the CircuitPython environment for the changes to take effect.
    On linux i use picocom. Use the following command:

    sudo picocom -b 115200 /dev/ttyACM0
    

    Once you are in the circuit py env you need to write import microcontroller;microcontroller.reset() to restart the mcu. After that you should be in BeOS (you may need to reconnect the serial console)

  6. Enjoy
    Keep in mind that BerylliumOS is a unix-like operating system for CircuitPython and not a linux distro it cannot run any linux executables. Tho you can use it to control the GPIO . Consider reading the Manual.txt provided.
    image

5 Likes

The official project page never refers BerylliumOS as “BeOS”, and there is already a product called BeOS, so to eliminate the chance of misunderstanding, please stop using this abbrevation.

1 Like

Also if you actually plan to use the RP2040 for something which needs a REPL shell, check this or this Forth implementation instead of this slow-ass abomination.

Heyo, i’m Beryllium OS’s author. BeOS, the original is a 28yr old piece of software.
I did think about this happening when I was choosing the name, but proceeded anyway since… it’s a 28yr old piece of software, having nothing to do with microcontrollers.

1 Like

CircuitPython, which is purposefully used as a base for Beryllium OS is a REPL shell. It can be accessed freely within it.

Beryllium OS is not designed to be fast, it’s designed to run on anything and everything, the exact same way. Optimization isn’t always “just make it faster”.
Memory is too tight for running an operating system on most microcontrollers.
Hence I only optimize for memory. Every part of it is designed to run as reliably as possible under high memory pressure.

“slow-ass abomination”… If you think you can make something resembling a unix shell, that has telnet, ftp, ntp, a package manager, tcp/ip, automatic wifi management, while being user friendly and whilst running on every 1€ potato from aliexpress, from esp32-c3 to samd51 and rp2040 the exact same way, pant, hit me up.

3 Likes

Even ancient operating systems like BeOS have active users. So active, that they even recreated it from scratch. See Haiku for example.
AFAIK the BeOS trademark is still owned by Palm One / Access, but do your research, I am not sure anymore. Please do not try to argue, that your “unix-like BeOS” is not “that unix-like BeOS”, “because that is not meant for microcontrollers”. Many people doing well-poisoning already. You are late from the party, please pick a different name.


Regarding the BeryilliumOS: This is a nice accomplishment. I don’t see the point, but if you enjoy working on it: feel free to do so.

If I understand it correctly: the slowness can be credited to the underlying Python implementation, so there is not too much you can do. I am just simply asking if even the underlying REPL is slow, then why do you think the best idea is to wrap even more candypapers around it? I don’t want to hurt your feelings, but from my POV it seems one of the main selling-pont / use-case of your system is being able to run a fetch on it, so people can post screenshots on the net.

To answer your question: maybe I would be able to do something resembling to a unix shell all all that jazz, but i would never do that, because this is simply unnecessary complexity. A simulacrum, if you wish.

Even ancient operating systems like BeOS have active users.

Sure, yet probably not more than what I can count with one hand.
The fact of the matter is that it’s a 28 year old OS that has been mostly forgotten.

AFAIK the BeOS trademark is still owned by Palm One / Access, but do your research, I am not sure anymore.

Probably so. For that reason, taking no risks, nowhere in the codebase or official material is it referred as “BeOS”. However when referring to it in a day-to-day setting, abbreviating the name to that cannot be considered “infringing” under any country’s copyright law.

I don’t see the point, but if you enjoy working on it: feel free to do so.

Thanks for your kind permission.

the slowness can be credited to the underlying Python implementation

It’s a lot more complicated than that, since Beryllium OS runs in a partially-compiled (mpy) state for the kernel and libraries, but userspace apps (when not cached) are interpreted.
Memory optimizations, parity hacks, checks and serial speed, are causing a lot more slowness and visible delay than python itself.

Plus remember that the RP2040 runs at like 133MHz and has spi flash storage running in QSPI mode.
Without much ram to spare, caching is limited, in turn iowait’ing.

why do you think the best idea is to wrap even more candypapers around it?

Nobody else had done it to this extent.
Excluding PyDOS which is very similar, also running on CircuitPython (but also MicroPython, which mine doesn’t), there isn’t anything.
Someone pretty recently did port actual linux to ESP32-S3, but that was only working on the maxed out PSRAM models, and running much, much slower (though undoubtedly, it’s a lot more useful).

I don’t want to hurt your feelings, but from my POV it seems one of the main selling-pont / use-case of your system is being able to run a fetch on it, so people can post screenshots on the net.

Beryllium OS features flexibility, since without reprogramming, you can just tell it to do things over whatever comm you have available.

Example: The M5Stack Cardputer. On it, it makes it become a laptop of sorts, working without the need for another computer. It can connect to other serial devices, inject ducky hid scripts (much like a Flipper Zero), perform web requests (wget basically and some post stuff) and even write notes on it.

Sure though, most people will just run a fetch on it, and I don’t mind.

To answer your question: maybe I would be able to do something resembling to a unix shell all all that jazz, but i would never do that, because this is simply unnecessary complexity.

Well, for RTOS applications the complexity of having a unix shell is of course unnecessary and most certainly unwanted.
But BeOS ain’t trying to be like that. It’s trying to be homey, flexible and compatible. Not your next supercomputer.

2 Likes