Skip to content

Fuzix for the Pico Computer — v0.31

Latest

Choose a tag to compare

@UKTailwind UKTailwind released this 03 Dec 17:42
· 0 commits to master since this release

3 December 2026. Compared with 0.28, the last release announced on the Back Shed. 0.29 and 0.30 were released on GitHub without a word on the forum: what they brought is here, with what has come since.

This is Fuzix, a small Unix, for the Pico Computer 3 and the Pico Computer 2: one kernel for both boards, which works out at boot which one it is. With it comes a C compiler and an MMBasic translator that run on the machine itself, so a BASIC program is written, translated, compiled and run without leaving it. Please report problems on the Back Shed forum, or as an issue here.

The files are below: fuzix.uf2, the kernel for both boards; pc3-sd-cc.img.gz, the SD card with the compiler and the BASIC corpus; FUZIX-PC3-MANUAL.pdf, the manual; and PC3-C-MANUAL.pdf, programming the machine in C.

Since 0.28:

  • The translator follows the PicoMite to V8 (0.29 to V7, 0.31 to V8): LIBRARY LOAD, DRAW3D, #INCLUDE and #DEFINE, MEMORY COPY, SAVE PNG, TILEMAP LOAD, the raster commands and much more. MM.VER answers 8.000005, the PicoMite version it follows.
  • FRAMEBUFFER WARPH, WARPV, AFFINE and SPAN, and BLIT RESIZE, run by the kernel.
  • Forty games on the card (0.29), Zork I among them.
  • The network: large TLS downloads, TLS writes, wifi scan and WEB SCAN, WEB CONNECT's rejoin, and the web server's fixes.
  • USB: a mouse behind the hub, a device plugged in later, and a hub's over-current.
  • Pictures: progressive JPEGs, compressed BMPs and PNGs from SAVE IMAGE, more kinds of PNG.
  • A BBC envelope with no pitch steps no longer locks the machine (0.29).
  • A fault is reported on the screen (0.30), where it stopped after fourteen characters on the serial console.
  • mmbedit keeps a paste (0.29) and colours V8's keywords (0.31).

Before you update

Flash the new fuzix.uf2 and write the new card image: both have changed. The card's programs are built for this kernel. Flash the kernel the usual way: hold BOOT, click RESET, and drag fuzix.uf2 onto the drive that appears. Write pc3-sd-cc.img.gz, ungzipped, to a card of 1GB or more with any raw-image tool; the whole card is overwritten, so copy off anything of your own first. Then connect a monitor and a USB keyboard, switch on, and log in as root. There is no password.

/etc/wifi.conf ships a placeholder, so wifi -f on a fresh card joins nothing until you put your own network in it. Its auth must now be a digit, 0 to 3.

PETSCII Robots needs THUMB_BUDGET=70000 (it was 140000 at 0.28, 130000 at 0.29 and 120000 at 0.30): the runtime has grown, and with more native code the program leaves no room for playmod, the helper that plays its music, and stops with "Could not play the MOD file". Build it on the machine with

# cd /root/MMBasic/robots
# THUMB_BUDGET=70000 cc robots.bas
# ./robots.bc

and run it with the root filesystem read-write.

What is new

The translator: PicoMite V7, then V8

0.29 brought mmbc up to PicoMite V7, and a review against the firmware closed twenty more differences: operators take the firmware's precedence, so 2^3^2 is 64; MAX and MIN return a float; PRINT's comma counts to 8-column stops; ON ERROR SKIP counts statements as the firmware does; SUB MM.END runs at END; SETTICK PAUSE and RESUME take their target; and an error the firmware raises only when a line runs is raised when the translated line runs.

0.30 added LOAD DATA, SAVE DATA and MM.INFO(FREE SPACE), and gave mmbc 40K of stack: translating PETSCII Robots ran off the end of 16K and took the machine down with it.

0.31 follows V8:

  • LIBRARY LOAD, whole-array assignment a() = b(), #INCLUDE and #DEFINE, DIM ... AS, a nested structure assigned whole, OPTION PICOMITE and OPTION MILLISECONDS.
  • DRAW3D, the PicoMite's 3D engine, whole.
  • FRAMEBUFFER WARPH, WARPV, AFFINE and SPAN, and BLIT RESIZE, run by the kernel: 0.9 to 8.9 milliseconds for a MODE 2 screen.
  • MEMORY COPY and MEMORY SET, PEEK(VAR v, n), BASE$, MATH CLAMP, and MATH SCALE and ADD between float and integer arrays.
  • RESOLUTION 640, RESTORE with an expression, TIME$ = n, and a command's name used as a variable, as in font = 3.
  • SAVE PNG, SAVE COMPRESSED IMAGE, OPTION PRINTSCREEN, TILEMAP LOAD, SPRITE(B) and the PicoMite's October sprite fixes, image slots 1 to 8, and DefineFont 1 to 16.
  • PLAY MODSAMPLE's rate, pan and LOOP, and PLAY MODSAMPLE CHANGE and STOP.
  • MM.INFO(HEAP), (PIN n), (PSRAM SIZE), (FONT), (BBC BUFFER), (FCOLOUR) and (BCOLOUR); MM.INFO$(LCDPANEL), (SYSTEM I2C), (SDCARD) and (USBDRIVE).

What mmbc is for (0.30): it translates programs that already run correctly under MMBasic, and such a program prints, draws and computes here what it does there. Error messages and ON ERROR behaviour may differ from the firmware's, and the translated code does not pay for error paths a correct program never takes. What mmbc does not translate it lists by name and comments out, and the translation carries on.

Fixes a correct program can see

  • 0.31:
    • A FOR or DO opened and closed inside a single-line IF is translated as MMBasic runs it.
    • DIR$ looks in the directory its spec names, and A:/ is the drive's top.
    • PEEK(INTEGER) of an array no longer stops with "Address not divisible by 8": arrays and structures are laid out as gcc lays them out.
    • FORMAT$ gives exactly the firmware's digits.
    • A PAUSE with a SETTICK armed wakes when the tick is due.
    • The C compiler combined the constants of x + 35200.0 + 2.0 as bit patterns and compiled it as x. It no longer regroups a floating sum, in C programs too.
    • DIM a$(n) LENGTH m = (...), a fixed-length string array with its values, is translated; it stopped with "expected ')'".
    • A program with more than about a thousand functions, structures and arrays, the runtime's included, stopped the machine's C compiler with "narg". PETSCII Robots crossed that line in 0.31.
    • A helper such as PLAY MODFILE's player or LOAD IMAGE's decoder inherited every file its program had open, and a big program left it too few of its own sixteen: the music never started. A helper now starts with only its input and output.
  • 0.30:
    • A LOCAL array sized when the routine runs was never given back, so a SUB called often enough ran out of memory.
    • A single-line IF inside ON ERROR SKIP could leave an error pending.
    • STR$ with a wide field wrote past its buffer.
    • The program is read as LOAD reads it.
  • 0.29:
    • FORMAT$ with a long text around its specifier wrote past its buffer.
    • TAB in a graphics mode could loop for ever.
    • When a program's bytecode ended on an odd byte, every call from native code into the runtime landed a byte early: a HardFault before the program printed anything.

Pictures and sound

  • SAVE IMAGE writes the PicoMite's compressed BMPs (0.31), a MODE 2 screen in 3 to 4K where it took 230K, and saveimage -p writes a PNG.
  • loadjpg decodes progressive JPEGs (0.31), the kind most cameras and web sites make, held in PSRAM: 1920 x 1080 loads, 4000 x 3000 is refused.
  • loadpng takes 8-bit RGB, grey and grey with alpha, crops a large picture and takes the image offsets (0.31), and stays inside its buffers (0.29): a 15-bit code length wrote past an array, and a bad back-reference read before the output.
  • V4 and V5 BMPs read their colour masks (0.31).
  • PLAY VOLUME left, right keeps the two channels apart in the synthesiser, and a PLAY VOLUME before the first note counts (0.31).
  • PLAY BBC SOUND and ENVELOPE play through the synthesiser BBC BASIC uses, and the BBC note queues are 16 deep (0.31).
  • A BBC ENVELOPE with no pitch steps, the usual amplitude-only shape, restarted its empty pitch sections for ever inside the audio interrupt and locked the machine on its first note (0.29).

The network (Pico Computer 3)

  • TLS: a large download no longer stalls, a write larger than one record no longer panics the kernel, tlsca no longer breaks open connections, and reads and writes of 64K are right (0.31).
  • wifi scan and WEB SCAN list the networks in reach (0.31).
  • WEB CONNECT with no arguments rejoins a dropped link (0.31).
  • The web server keeps a request that arrives in pieces, gives a slow client 5 seconds without progress rather than 5 seconds in all, and takes {expressions} of up to 253 characters in WEB TRANSMIT PAGE (0.31).
  • dig's answers were two bytes off and are right (0.31).
  • C programs get send, recv, shutdown, getpeername and getsockname (0.31).

USB

  • A low-speed mouse behind the hub no longer stops every USB device (0.31).
  • A device plugged in later can no longer take the keyboard's input (0.31).
  • A hub's ports are powered again after an over-current, and a port the hub disabled is enumerated again (0.31).
  • Two faults that panicked now print one line each: "USB: stale buffer arming ... cleared" and "USB: no endpoint left ... too many USB devices" (0.31).

The kernel

  • PSRAM runs at the speed its datasheet gives, 94.5MHz where 126MHz overran a part rated for 109, and a board without PSRAM no longer hangs the boot (0.31).
  • The Olimex RP2350pc is recognised (0.31).
  • A fault is reported on the screen (0.30): the exception, the fault registers, the program counter, the registers and where the program was loaded. It went through the serial console, which cannot drain at that moment, and stopped after fourteen characters.
  • A failed system call returns -1 with errno set, as Fuzix means it to, and a kernel allocation that fails returns ENOMEM instead of panicking (0.31).
  • fat put writes in an order that leaves the old file or the new one whole after a reset (0.31).
  • mkdir -p with a full path, mkdir -p /tmp/www, gave the directory a nonsense mode and left another with a nonsense name and no permissions in the current directory. It makes what it is asked for now (0.31).

Games and the editor

  • Forty games (0.29): the Scott Adams and Brian Howarth adventures, Super Star Trek, Space Invaders, 2048, dopewars, Hamurabi, four games from Unix V7, and Zork I, which Microsoft released under the MIT licence in 2025, on the z3 Z-machine player. /usr/games is on the PATH, every game has a manual page, and three that were broken are fixed.
  • mmbedit keeps a paste (0.29): everything after the first line or so was lost. The file's last line keeps its ending, Esc leaves even with a line too long to save, and F9 says why a file did not load.
  • mmbedit colours V8's keywords, THREAD and SQL among them, saves the screen at the Print Screen key, and pages up without leaving a blank top row (0.31).

What behaves differently

  • MM.VER and MM.INFO(VERSION) are 8.000005 (0.31), where they were the Fuzix release (0.3 at 0.30).
  • Expressions follow the PicoMite (0.29): 2^3^2 is 64, NOT and INV bind to the value after them, integer ^ integer is an integer, MAX and MIN return a float.
  • / and / follow the manual (0.30): each must be the first thing on its line and outside any SUB or FUNCTION, and a line that breaks the rule is refused.
  • Some constructs are refused rather than translated wrongly (0.30): a string member passed by reference to a routine that changes its structure, a two-dimensional STATIC with a run-time bound and a list of values, and an array of a TYPE dimensioned again after ERASE with other bounds.
  • PLAY VOLUME 50 sets the left channel alone, as a PicoMite does; PLAY VOLUME 30, 70 sets each (0.31).
  • PIXEL() after MAP reads MMBasic's fixed colours, not the live palette's (0.31).
  • ON KEY k no longer fires for a k typed before it was armed (0.31).
  • A bare FRAMEBUFFER CLOSE closes every buffer, and a MODE change drops the layer (0.31).
  • JSON$ follows V8's path rules: arr[0] returns its value (0.31).
  • The music stops when the program ends, however it ends, as on a PicoMite (0.31). PLAY MP3, WAV, FLAC and MODFILE played on after END or Ctrl-C, and the player stopped remount / ro until it was killed.
  • A BLIT of width 0 draws nothing, where it was an error (0.31).
  • SAVE IMAGE writes a compressed BMP (0.31).
  • C programs: a failed call returns -1, a TLS write sends at most one 2,048-byte record, and structures may be laid out differently (0.31).

Tested

On a Pico Computer 3 with this kernel and card:

  • the boot banner and MM.VER
  • a BASIC program and a C program, each written, compiled and run on the machine
  • wifi -f, ntpdate, tlsca and a TLS fetch with certificates checked
  • httpd serving a 20K program byte for byte
  • PETSCII Robots built on the card at THUMB_BUDGET=70000 and played with a USB keyboard, music and all
  • a program's music stopping when it ends, by END, by Ctrl-C and by kill, and mkdir -p

On a Pico Computer 2 with the same kernel and card: the boot banner, wifi saying there is no radio, BASIC and C, mkdir -p, the music test, and a clean read-only remount.

On a PC, the translator's 224 tests through both translators, and through the board's own compiler passes.

Known problems

  • Threads are not on this machine yet: THREAD translates, and THREAD START stops the program with "Threads are not available on this machine yet". They run on a PC, in pc3host.
  • Serial ports are not on this machine yet: OPEN "COM..." and LIST SERIAL PORTS translate and stop with "Serial ports are not available on this machine". They run on a PC, in pc3host.
  • MM.INFO(THREAD FREE) is translated as MM.INFO(THREAD n) with FREE a variable, and MM.INFO(STACK FREE) is refused; they come with threads.
  • Bluetooth and MQTT are not here.
  • The USB hub's recovery after an over-current has not been made to happen on the machine.
  • The new PLAY MODSAMPLE forms have been translated and checked against the firmware's calls, but not yet listened to on the machine.