Tethered Forth FileSystem (http://www.lowfatcomputing.org)


ForthFS | 9P Tethered Forth File System

Old-Skool Forth systems have the advantage of a short compose-debug-fix cycle because you could use a block editor on the device itself. Unfortunately, contemporary Forths largely negate this benefit because the code is written on a big computer and then uploaded to the microcontroller over serial, which can take more time than compiling and flashing a C program from the big computer.

Not anymore with a tethered Forth File System. Write Forth on your microcontroller from the comfort of your preferred editor.

Mount your microcontroller's memory regions as a 9p synthetic filesystem on your big computer running Linux with v9fs in the kernel.

Special regions such as Memory-Mapped I/O, peripherals, or soft memory regions such as the Terminal Input Buffer (TIB) will be provided as device files.


  • ForthFS is currently being written for mecrisp-stellaris and is being tested on the Teensy 3.1 (mk20dx256).
  • Flow-control is necessary for ForthFS. Echo-checking (which is all amForth does) is of no use.


Upload server.4th to your microcontroller.


# Start it on your microcontroller.

# Mount it.
./4mount <device> <speed> <mountpoint>


  • Because we are occupying the serial port with ForthFS, multiplex the prompt with the other files of ForthFS and export it as a character device which can be opened in picocom.
  • Use a union filesystem mounted on top of the ForthFS tree to catch .swp file from vim and other junk that should not be written to the microcontroller flash.
  • Use String-to-String Correction with Block Moves algorithm to minimize the number of bytes written to flash.
  • Install ForthFS as a turnkey on the microcontroller so that ForthFS is started when the microcontroller is powered on.
  • Use defered words so that the 9P synthetic fileserver protocol can run over SPI, I2C, radio link, etc.
  • Use defered words so that we can present different synthetic fileservers for different storage mediums like SDHC, SPI Flash as well as non-storage peripherals and synthetic devices.
  • 9P client in Forth so ForthFS can be used from Forth not just Unix.


I am Andreas Wagner, you can contact me at andreas.wagner@lowfatcomputing.org