Cosmos v3.9.2 Sun Sep 22 09:48:55 UTC 2024 https://github.com/jart/cosmopolitan https://cosmo.zip/pub/cosmos/v/3.9.2/ This archive contains prebuilt Actually Portable Executables for popular open source projects. Each build artifact is a fat binary that runs on Linux, MacOS, Windows, FreeBSD, OpenBSD, and NetBSD for both the ARM64 and AMD64 architectures. We call it The Cosmos. You can think of it as a fat Linux distro we built for fun. In the Cosmos, every program is statically linked and contains a PKZIP central directory where its /usr/share dependencies are embedded. You can think of it as a coalition of individualistic executables, where each program can be separated from the whole and run on other OSes. -------------------------------------------------------------------------------- UNIX INSTALLATION -------------------------------------------------------------------------------- Put the bin/ folder on your $PATH and you're good to go! Some programs are renamed to have a .ape extension because they're upstream dependencies of the APE shell script that's embedded in each executable. You can't run those programs safely unless you rename them, or use binfmt_misc, or patch your kernel. So to make things work better, it's a good idea to have a systemwide APE loader. On Linux and BSDs you should copy the APE interpreter to /usr/bin/ape as follows: sudo mv bin/ape-$(uname -m).elf /usr/bin/ape Linux users may want to additionally enable binfmt_misc, which offers better execve() latency. sudo sh -c "echo ':APE:M::MZqFpD::/usr/bin/ape:' >/proc/sys/fs/binfmt_misc/register" sudo sh -c "echo ':APE-jart:M::jartsr::/usr/bin/ape:' >/proc/sys/fs/binfmt_misc/register" MacOS ARM64 users can gain the best performance by installing APE loader to /usr/local/bin/ape as follows: cc -O -o ape bin/ape-m1.c sudo mv ape /usr/local/bin/ape -------------------------------------------------------------------------------- WINDOWS INSTALLATION -------------------------------------------------------------------------------- You need Windows 10+. It's recommended you extract the bin/ folder to C:\bin\ and then install Terminal Preview from the Microsoft Store. You can then configure a profile that launches the cosmo bash login shell: C:\bin\bash -l If you want to launch Cosmopolitan Bash inside the normal CMD.EXE command prompt, then all you need to do is copy C:\bin\bash to C:\bin\bash.exe and then run: C:\bin\bash.exe -l We recommend copying C:\bin\dash to C:\bin\sh although you could use bash instead if you prefer. On Windows, it's recommended that you rename programs like C:\bin\gzip.ape to be C:\bin\gzip instead. This is perfectly safe on Windows, because APE binaries load natively. You don't need to use C:\bin. You could put them in any directory that's on your system PATH. However many programs will assume that /bin/sh exists. Cosmo maps that path to \bin\sh on WIN32, which means the current drive should have a bin/sh interpreter.