Skip to content

Building micropython for FreeDOS

pohmelie edited this page Apr 8, 2016 · 5 revisions

FreeDOS build based on unix build and use djgpp as cross-compiler. Build process tested with linux ubuntu 14.04, but should work fine with other *nix operating systems. Since resulting micropython binary is bigger than than DOS can hold, DOS extender should be used. This tutorial is based on CWSDPMI DOS extender and awesome build-djgpp.

  1. Building djgpp via build-djgpp project.

    git clone https://github.com/andrewwutw/build-djgpp
    cd build-djgpp
    DJGPP_PREFIX=path/to/djgpp source build-djgpp.sh 5.3.0
    

    You probably will need to view build-djgpp readme for prereqs and version number.

  2. Build micropython.

    git clone https://github.com/micropython/micropython
    cd micropython/unix
    PATH=path/to/djgpp/bin:$PATH make freedos    
    
  3. Extending with dos extender (CWSDPMI).

    path/to/djgpp/i586-pc-msdosdjgpp/bin/exe2coff micropython_freedos.exe
    cat CWSDSTUB.EXE micropython_freedos > upython.exe
    

You can change extender options for upython.exe with CWSPARAM.EXE

Clone this wiki locally