Image 1 — How far can a Pico go as a real computer? VGA + 3.2" touch LCD, USB keyboard and mouse through a second Pico, RTC - one RP2040, 264 KB SRAM
Image 2 — How far can a Pico go as a real computer? VGA + 3.2" touch LCD, USB keyboard and mouse through a second Pico, RTC - one RP2040, 264 KB SRAM

How far can a Pico go as a real computer? VGA + 3.2" touch LCD, USB keyboard and mouse through a second Pico, RTC - one RP2040, 264 KB SRAM

Hey! Last time I showed Recaster Pico as a screenshot - here's the real thing on my desk: one RP2040 running a small desktop OS in its 264 KB of SRAM, now with the parts that make it feel like a computer. Yeah, it is still multi-user and multi-tasking (preemptive). No Linux/Unix, no RISC OS.

What's on the board now

  • VGA, 640×480 at 60 Hz, 256 colors (RGB332), straight from PIO and DMA. Core 1 composes every scanline just in time.
  • A 3.2" SPI touch LCD as a second screen. It mirrors the VGA desktop (well, 1/4 of it ;-)) - core 1 hands the lines it has just composed to a DMA channel, no second compose - or a program takes it over and draws on it directly. Touch moves and clicks the mouse pointer, and the panel also works alone, without a monitor.
  • USB keyboard and mouse through a second RP2040 in the serial line: USB host on its micro-USB port, plus a USB-A socket on two GPIOs driven by Pico-PIO-USB. Events travel as CRC-protected packets mixed into the 1 Mbaud UART console, and the serial terminal still works through it. German layout with dead keys and umlauts.
  • RTC and EEPROM (DS1307 / AT24C32) on I2C, set up with a small text file - the EEPROM even shows up as a file under /dev.
  • GPIO, ADC, PWM, PIO and DMA from the shell language, with the same names as in the Pico SDK.
  • Runs from a power bank.

Lessons for your own projects

  1. pico_minimize_runtime() turns float off. Pico-PIO-USB computes its PIO clock dividers in float at init, so every float operation hits the SDK's panic stub and core 1 silently stops. Use pico_minimize_runtime(target INCLUDE FLOAT).
  2. The same function with pico_multicore: malloc's auto-init mutex never gets initialized, so the first malloc on core 1 hangs forever. PICO_USE_MALLOC_MUTEX=0 if you only malloc once at start.
  3. TinyUSB 0.18 drives one host controller per firmware, and Pico-PIO-USB 0.7 no longer enumerates devices on its own. A second USB port means writing a small host on its low-level API - about 300 lines for boot keyboards and mice.
  4. Flash erases switch core 0's interrupts off for ~45 ms per sector, while at 1 Mbaud the UART's 32-byte FIFO holds about 10 ms of mouse traffic. Put the UART interrupt on core 1 and run it from SRAM.

Next: sound (the speaker is already on the board), the SD card (already there), and touch-friendly UI controls - buttons, sliders, lists.

And yes: I will post a video of it showing it in motion, soon. And you will get your fingers at that ".uf2"-files to play with it.

u/realmcalec — 8 days ago
▲ 46 r/osdev

Racing the beam on the Raspberry Pi Pico: full-feature demo of the graphics engine under my new OS (custom ISA, one VM task draws everything)

A few months back I built the DatCube 82 - a fictional 1982 workstation with its own ISA, an OS written in its own assembly, and a JS emulator. Fun project, but it never quite took off, and I think I know why: there was no real machine you could hold. This is the fix. Same spirit, new target: real silicon, the whole Raspberry Pi Pico family - RP2040, RP2350 (ARM), and RP2350 in RISC-V mode. And I am creating an OS for it! Yeeeeah!

I call it "RECASTER PICO".

The video shows the graphics engine's feature demo (this is from a browser window, but it runs on a VGA screen as well via real hardware (I will show you, soon)! Everything on screen is drawn by one user-space task running in a deterministic register VM (custom ISA, no DIV (for now!), no arithmetic shift - the demo does its 3D math with Q7 sine tables and bias-trick shifts), on a budget of 100,000 VM ops per frame. It uses ~90k. What you're looking at, bottom layer to top:

  • Matrix rain on the 80×60 character generator - "ground" cells with transparent backgrounds, so sprites shine through between glyphs
  • a 1-bpp city skyline and a spinning wireframe cube on the 1-bit pixel layer (640x480)
  • the main attraction: the winding gradient column plus the dark ribbon orbiting it, drawn with nothing but the engine's newest feature - two overlay segments per scanline (per line: two x-spans + two colors, palette index or raw RGB332). The ribbon does hidden-line clipping against the column silhouette with a single span per row. The banding isn't a shader - it's the RGB332 color system doing what it does
  • 16 of the 128 sprites as color-cycling orbs, split across two render levels (half in front of everything, half behind the text ink)
  • a smooth-scrolling text row at the bottom: the text-offset register is read per scanline, so flipping it at the right beam position gives one row true sub-cell scrolling - a raster split, the register only has 16 values

The OS around it (preemptive multitasking, windows, a terminal with pipes, a tiny flash filesystem, the desktop) is a story for a follow-up post - including the browser emulator so you can run all of it without hardware, or of course WITH IT, if you have a Pi Pico. ;-)

u/realmcalec — 2 months ago

Pfingsten ohne Freunde

Hallo! Will nicht rumjammern, aber irgendwie habe ich so viel gearbeitet und mich nicht um Freunde gekümmert letztes Jahr und auch nicht gemerkt, dass immer mehr Leute aus meinem Umfeld weggezogen sind oder irgendwie durchgestartet haben oder ... naja.. irgendwie "weg" sind jetzt. Bin jetzt nicht so religiös, aber allein an Pfingsten irgendwie Bildschirmzeit ansammeln ist echt hart. Vor allem, wenn man dann darüber auch noch schreibt. Daher ist der Post hier mal zu Ende. Wollte nur kurz fragen: Geht es nur mir so?

reddit.com
u/realmcalec — 5 months ago

[Ich bin Henry, ein überaus unsicherer Mensch. Ich scheine alles falsch zu machen. Dennoch versuche ich jeden Tag aufs Neue, das Schöne in der Welt zu entdecken und mit meinen Ängsten und Alltagssorgen klarzukommen. Das Gras ist chronisch grüner bei anderen und ich stehe stets in der falschen Schlange. Apropos:]

Er hatte "ein Pils" gesagt. Und für die Mädels Dunkelbier. Wann ist denn ein Bier ein Pils? Ist das eine Marke? Ist da Schimmelpilz drin? Ich hatte ungefähr soviel Ahnung von Bier wie von Fußball. Dennoch wollte ich mal wieder etwas an meinen Social-Skills arbeiten. Lisa [die Therapeutin] sagte, ich sei auf einem guten Weg. Ja ... sie hatte Recht! Der Weg führte jetzt noch kurz durch die Bierabteilung dieses riesigen Konsumtempels der Lebensmittel und dann nur noch einmal durch die Kasse. Danach würde ich die drei Stunden Gegröle mit Tom und den drei eingeladenen Freundinnen, wie er sie nannte, noch aushalten und könnte danach seelenruhig in meinem Ein-Zimmer-Apartment ins Bett fallen. Ein Erfolg, richtig? Ich merkte auf einmal, dass mein Hals ganz trocken wurde. Ein großer Kloß steckte fest. Ich hatte gar nicht bemerkt, dass ich aufgehört hatte, die Biere zu prüfen, die ich herausnahm und wieder wegsortierte in den unendlichen Kästen in der Abteilung. Ich nahm jetzt das nächstbeste Bier, das "Pils" auf dem Etikett verzeichnet hatte und griff noch einen Kasten von dem Bier mit dem dunklen Aufkleber. Niemand würde dunkle Aufkleber auf helles Bier kleben, oder? Das wäre diabolisch! Auf einmal schwitzte ich - auch das fiel mir erst spät auf. Erschöpft rannte ich zur Schlange an der Kasse und reihte mich direkt neben Tom ein - vor gefühlt 15 folgenden Supermarktkunden.

Mit einem "Wir gehören zusammen..." versuchte ich mein Vordrängeln zu rechtfertigen. Oh Gott, was sagte ich da? "... also nicht so, wie man jetzt denkt." Da war es: Die Frau hinter mir war mittleren Alters. Ihre Brille schien genauso fassungslos zu sein wie sie. Deren Gläser wirkten groß wie Teller. Sie blickte mich direkt an mit eiserner Miene. Der Laserstrahl aus ihren Augen wurde durch die Linsen der Brille gebündelt, zumindest wurde mein Gesicht dadurch ganz warm. Ich merkte, wie es rot wurde und leicht anschwoll. - "Wo bleibst Du denn?", erwiderte Tom. Ich warf noch schnell zurück zu ihr: "Er ist nicht mein fester Freund, so." und drehte mich dann zu Tom. - "Bitte? Was?" stammelte dieser. -

"Nein, ich meine, wir sind schon befreundet, aber eben nicht so! Wir machen nur heute was zusammen." Mit dem Satz hatte ich mich erneut zur Schlange hinter mir gewandt. Diesmal war ich vorsichtiger und schaute nur auf die Einkaufswagen, nicht mehr in Laserstrahlen-Augen. Doch meine gewünschte Klarstellung machte es nur schlimmer. "Nicht One-Night-Stand, das meine ich damit nicht. Sondern eben ein Treffen nach langer Zeit mal wieder." Das klang nun in meinen Ohren wenigstens eher wie "Freund+", was natürlich nicht gemeint war, ich war hetero. War ich doch, oder?

[Kritik erwünscht...]

reddit.com
u/realmcalec — 6 months ago

Hab meiner Freundin head&shoulders gekauft als Geburtstagsgeschenk. Sie sagte mir, dass sie alle "APPLE"-Produkte mag, aber bitte keine Süßigkeiten! Nun ja, im lokalen EDEKA hier war das hier das einzige Produkt, was dem Wunsch entsprach. Leider fand sie das nicht witzig. :( Nun ist wohl Schluss.
Zusatzfrage für Leute, die es prüfen können: Ist das eigentlich für Fische geeignet? Ich meine wegen "SCHUPPEN-SCHUTZ²", steht ja da.

u/realmcalec — 6 months ago