Skip to the content.

What is MicroPython?

MicroPython is a real implementation of the Python 3 language that runs in tens-to-hundreds of kilobytes of memory. The same code base runs on microcontrollers (ESP32, RP2040, STM32, …), in WebAssembly, on Unix, and — with this port — on FreeDOS / i386.

When you type at the >>> prompt, you are running Python: the bytecode compiler, the garbage collector, the type system, and the standard-library subset are all the genuine MicroPython implementations. There is no translation layer to “DOS BASIC” or similar.

What is the same as desktop Python

What is different

The headline differences from desktop CPython, all driven either by MicroPython’s design or by DOS being a 32-bit single-process OS with no threads and no virtual memory:

What is unique to this port

Things that the FreeDOS port exposes which you won’t find on a microcontroller MicroPython:

A note on memory

MicroPython on this port runs with a 1 MB Python heap (the GC manages it) plus PMODE/W’s PM heap for everything outside the GC (libssh2 internal buffers, axtls cert chains, lwIP packet buffers). On a 16 MB DOS machine the port is comfortable; on the 4 MB minimum it is tight but works for small programs.

gc.collect() works and returns the same shape of result it does in CPython (None; the freed-bytes value is available through gc.mem_free() / gc.mem_alloc()).


Next: Getting started — running MP.EXE on your DOS system.