A WSL alternative for users who prefer an MS-DOS environment. DOS Subsystem for Linux integrates a real Linux environment into MS-DOS systems, allowing users to make use of both DOS and Linux applications from the DOS command prompt.
- doslinux depends on several packages.
In Fedora 38, run
sudo dnf install wget git patch bzip2 gcc glibc glibc-static g++ libstdc++ libstdc++-static make binutils flex bison openssl-devel mtools nasm zip unzip bc
In Ubuntu 22.04, run
sudo apt install build-essential git gcc make nano flex bison libssl-dev mtools nasm zip unzip bc
In a VM configured for 16 CPUs, 16GB RAM, hosted on a dual Intel Xeon E5-2680 v4 2.4GHz hypervisor (a 9 year old server in 2023), full builds take about 10-15 miniutes and will consume about 4GB of disk space.
-
The included
Makefile
will downloadgcc
,binutils
,busybox
(1.35.0), andhttps://github.com/richfelker/musl-cross-make
for you. -
The included
Makefile
will then build ai386-linux-musl
cross-compiler and Linux 5.8.9 kernel for you. -
Adjust the variables at the top of
Makefile
if you would like to use a higher/lower$(ARCH)
or different kernel. (NOTE: this isn't quite working correctly yet) -
Running
make
is an alias formake dist
which will result in aDSLxxxB.ZIP
file containingdoslinux
,init
, a LinuxbzImage
kernel, andbusybox
. -
After the completion of building the cross-compiler,
sudo make -j$(CORES) install
is executed to put the cross-compiler toolchain in your/usr/local/
path. -
You can unzip a roughly 6.5MB
DSLxxxB.ZIP
zipfile onto a DOS system, like MS-DOS or FreeDOS, and then start doslinux by running a command likeC:\DOSLINUX\dsl
orC:\DOSLINUX\dsl sh
(giving you a shell into the loaded Linux). -
Also try running
make help
,make showconfig
if you run into configuration issues. -
Run
make clean
to clean up the local git repo. Runmake ultraclean
to also get rid of the installation of the cross compiler toolchain in/usr/local
.
-
You will need a cross toolchain targeting
i386-linux-musl
onPATH
.https://github.com/richfelker/musl-cross-make is a tool that can build one for you with minimal hassle. Set
TARGET
toi386-linux-musl
. -
Build the prequisites (Linux and Busybox) by running
J=xxx script/build-prereq
, replacingxxx
with the desired build parallelism. -
You will need a hard drive image
hdd.base.img
with an installed copy of MS-DOS on the first partition. -
Run
make
This will produce a new hard drive image
hdd.img
with DOS Subsystem for Linux installed. InvokeC:\doslinux\dsl <command>
to run Linux commands.C:\doslinux
can also be placed on your DOSPATH
for greater convenience.