A minimalist "Linux From Scratch" style OS with a custom-written, nostalgic DOS-like shell.
https://github.com/minhmc2007/TinyDOS
Imagine booting a modern Linux kernel directly into a nostalgic MS-DOS-like environment. That's TinyDOS.
This is an educational project that explores the fundamentals of a Linux system. By stripping away the complexities of modern distributions, we are left with the bare essentials: a bootloader, a kernel, a minimal userspace, and our own shell.
The heart of the project is the custom init.c shell, which provides a classic command-line experience on top of a powerful, modern Linux kernel.
Here's what a typical session looks like. Notice how you can use both built-in DOS commands and standard Linux utilities from BusyBox.
MyTinyDOS v0.0.1 - (c) 2025
C:\> ver
MyTinyDOS Shell [Version 0.0.1 (2025)]
Running on Linux 6.15.2-tinyDOS (x86_64)
C:\> dir
Directory of C:\
01/01/1970 12:00 AM <DIR> .
01/01/1970 12:00 AM <DIR> ..
01/01/1970 12:00 AM <DIR> bin
01/01/1970 12:00 AM <DIR> dev
01/01/1970 12:00 AM <DIR> etc
...
C:\> md my_stuff
C:\> cd my_stuff
C:\MY_STUFF> echo Hello from TinyDOS > test.txt
C:\MY_STUFF> type test.txt
Hello from TinyDOS
C:\MY_STUFF> ls -l
-rw-r--r-- 1 root root 21 Jan 1 12:02 test.txt
C:\MY_STUFF> exit
Shutting down system...
[ OK ] Reached target Power-Off.
- Custom Linux Kernel: Runs on a custom-configured
6.15.2-tinyDOSkernel. - BusyBox Userspace: Provides a rich set of essential Unix utilities (
ls,vi,mount,free, etc.) in a single binary. - DOS-like
initShell: The entire user experience is managed byinit.c, a custom C program that acts as both the system'sinitprocess (PID 1) and the user's shell. - ISOLINUX Bootloader: Boots from a simple, standard ISO file.
- Automated Build: A single script handles the entire build process.
The custom shell implements many classic commands internally. For anything else, it passes the command to the underlying BusyBox environment.
| Command | Description |
|---|---|
? / HELP |
Shows this command reference. |
ABOUT |
Shows author information. |
VER |
Shows TinyDOS and Linux kernel version information. |
CLS |
Clears the screen. |
ECHO [msg] |
Displays a message to the screen. |
DIR [path] |
Lists the contents of a directory in DOS format. |
CD/CHDIR [path] |
Changes or displays the current directory. |
MD/MKDIR [path] |
Creates a new directory. |
RD/RMDIR [path] |
Removes an empty directory. |
TYPE [file] |
Displays the content of a text file. |
COPY [src] [dst] |
Copies a single file. |
XCOPY [src] [dst] |
Recursively copies files and directories. |
DEL/ERASE [file] |
Deletes a file. |
REN/MOVE [src] |
Renames or moves a file or directory. |
EDIT [file] |
Opens the file in MiniEdit, TinyDOS's C text editor. |
REBOOT |
Restarts the system. |
EXIT/SHUTDOWN |
Powers off the system. |
TinyDOS includes an edit command, which launches the built-in text editor called MiniEdit.
MiniEditis a C text editor inspired by the best features of both Vim and Nano.- You can think of it as: miniedit = Vim + Nano.
- It’s simple to use for beginners (like Nano), but also provides efficient navigation and editing shortcuts (like Vim).
- For a detailed look at its implementation and features, see
miniedit.c.
To open MiniEdit, simply run:
edit filenameThis opens or creates the file filename in MiniEdit.
Explore and enjoy efficient text editing in TinyDOS!
Building and running TinyDOS is incredibly simple thanks to the automated build script.
You'll need a standard Linux build environment and QEMU. On Debian/Ubuntu, you can install them with:
sudo apt-get update
sudo apt-get install build-essential git qemu-system-x86 xorriso bc libelf-dev libssl-devThe build.sh script does everything for you: it downloads sources, compiles the kernel and BusyBox, builds the init program, and generates the final bootable ISO.
git clone https://github.com/minhmc2007/TinyDOS.git
cd TinyDOS
bash build.shThe script will create bootable.iso. You can run it with QEMU:
qemu-system-x86_64 -cdrom bootable.isoUnderstanding the architecture is key to the project's purpose.
- Boot:
ISOLINUXboots the system from the ISO. - Kernel: It loads the custom
bzImageLinux kernel into memory. - Initramfs: The kernel mounts a minimal initial RAM disk which contains the BusyBox binary and our custom
initprogram. - Init: The kernel executes
/sbin/init(our C program) as the first process (PID 1). - Shell: Our
initprogram starts, prints the welcome message, and gives you theC:\>prompt.
The build.sh script automates the entire "Linux From Scratch" style workflow:
- It compiles
init.cinto a static binary. - It constructs an
initramfs(initial RAM filesystem) containing the necessary directory structure (/bin,/sbin,/dev, etc.) and populates it with BusyBox and ourinitprogram. - Finally, it packages the kernel and the
initramfsinto a bootabletinydos.isousingxorriso.
Contributions make the open-source community an amazing place to learn and create. Any contributions you make are greatly appreciated. Please fork the repo and create a pull request!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the GNU GENERAL PUBLIC License 3. See the LICENSE file for more information.
- The Linux From Scratch project for being the ultimate guide.
- The developers of BusyBox, the Linux Kernel, and SYSLINUX.
- Everyone who loves the nostalgia of the command line.
