We’ve mentioned David Given’s port of Fuzix to the Raspberry Pi Pico previously, once or twice, and the other day I thought I’d give it a spin. No extra hardware needed, although an SD Card is supported.
It’s my first taste of Fuzix, I think. I had to change one line to build, but it was otherwise plain sailing.
The Pico reboots to offer a serial device over USB, which I can connect to, although not quickly enough to catch the boot messages:
Current time is 15:52:37
Enter new time:
^ ^
n n Fuzix 0.3.1
>@<
Welcome to Fuzix
m m
login: root
Welcome to FUZIX.
#
We get all the usual utilities: ls, rm, mv, and so on. But no awk! Not even a sed! There’s a vi-like editor, with a man page:
# man levee
levee(1) FUZIX System Utilities
NAME
levee - A Screen-Oriented Editor, based on "vi".
SYNOPSIS
levee [+address] [file ...]
DESCRIPTION
Levee is a screen oriented editor based on the Unix editor "vi". It
provides a terse, powerful way to enter and edit text (however, if you
want a word-processor, you're better off with WordStar.)
...
I usually look around when I arrive on a new system (copy-pasted from several sessions):
# ls
# df
Filesystem Blocks Used Free %Used Mounted on
/dev/hda 2515 1918 597 76% /
# ls /usr/games
advent
cowsay
lib
# who
root tty01 Thu Nov 03 15:58:33 2022
# free
total used free
Mem: 160 56 104
Swap: 0 0 0
# uptime
16:00:26 up 00:07, 1 user, load average: 0.00 0.00 0.00
We have proper unix-like subprocesses and pipelines too:
# (sleep 4 && echo done) &
24
# ps -ef
UID PID PPID C STIME TTY TIME CMD
0 1 1 0 15:14 ? 00:00:42 /init
0 9 1 0 15:15 tty1 00:02:27 -sh
0 24 9 0 15:17 tty1 00:00:00 -sh
0 25 0 0 15:17 tty1 00:00:00 sleep
0 26 9 0 15:17 tty1 00:00:00 ps
# done
# ps -ef
UID PID PPID C STIME TTY TIME CMD
0 1 1 0 15:14 ? 00:00:42 /init
0 9 1 0 15:15 tty1 00:02:42 -sh
0 24 9 0 15:17 tty1 00:00:06 echo <defunct>
0 27 9 0 15:17 tty1 00:00:00 ps
# ps -ef
UID PID PPID C STIME TTY TIME CMD
0 1 1 0 15:14 ? 00:00:42 /init
0 9 1 0 15:15 tty1 00:03:09 -sh
0 28 9 0 15:17 tty1 00:00:00 ps
Just for fun:
# /usr/games/cowsay Pico
______
< Pico >
------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
# banner Fuzix!
FFFFFFF !!!
F u u zzzzzz i x x !!!
F u u z i x x !!!
FFFFF u u z i xx !
F u u z i xx
F u u z i x x !!!
F uuuu zzzzzz i x x !!!
David included Adventure and Forth, but no other programming language. So Forth it will have to be - here’s everything I know:
# fforth
ok
22 7 / .
3 ok
22000 7 / .
3142 ok
I’ll paste some programs from Rosetta Code:
# fforth
ok
: DECOMP ( N -- )
2
BEGIN 2DUP DUP * >=
WHILE 2DUP /MOD SWAP
IF DROP 1+ 1 OR \ NEXT ODD NUMBER
ELSE -ROT NIP DUP .
THEN
REPEAT
DROP . ;
ok
100 DECOMP
2 2 5 5 ok
899 DECOMP
29 31 ok
1001 DECOMP
7 11 13 ok
4096 DECOMP
2 2 2 2 2 2 2 2 2 2 2 2 ok
And I can run a program from a file:
# cat factor.fth
: FACTORS DUP 2/ 1+ 1 DO DUP I MOD 0= IF I SWAP THEN LOOP ;
: .FACTORS FACTORS BEGIN DUP DUP . 1 <> WHILE DROP REPEAT DROP CR ;
60 .FACTORS
12 .FACTORS
899 .FACTORS
64 .FACTORS
11 .FACTORS
# fforth factor.fth
60 30 20 15 12 10 6 5 4 3 2 1
12 6 4 3 2 1
899 31 29 1
64 32 16 8 4 2 1
11 1
#
What would be nice is to be able to write and run a program to blink a LED, on the device itself, but that’s a step too far at present, I think.
There’s a thread here which might be useful or interesting:
https://forums.raspberrypi.com/viewtopic.php?t=304223
Fuzix describes itself as
a fusion of various elements from the assorted UZI forks and branches beaten together into some kind of semi-coherent platform and then extended from V7 to somewhere in the SYS3 to SYS5.x world with bits of POSIX thrown in for good measure.
and of course it’s an @EtchedPixels project.