Different CPU architectures mean that running DOS on Raspberry Pi is not straightforward, but it is not overly complicated either.
FreeDOS[1] may not be unfamiliar to everyone. It is a complete, free, and DOS-compatible operating system that can run some older DOS games or commercial software, and can also be used to develop embedded applications. Any program that can run on MS-DOS can also run on FreeDOS.
As the initiator and project coordinator of FreeDOS, many users ask me as an expert. The most common question I get is: “Can FreeDOS run on Raspberry Pi?”
This question is not surprising. After all, Linux runs well on Raspberry Pi, and compared to Linux, FreeDOS is an older operating system that consumes fewer resources, so why can’t FreeDOS run on Raspberry Pi?
Simply put, due to the CPU architecture, FreeDOS cannot run independently on Raspberry Pi. Like other DOS-like systems, FreeDOS requires an Intel x86 architecture CPU and BIOS to provide basic runtime services. Raspberry Pi runs on an ARM architecture CPU, which is not binary compatible with Intel CPUs and has no BIOS. Therefore, Raspberry Pi does not support FreeDOS at the hardware level.
However, FreeDOS can still run on Raspberry Pi through a PC emulator, although there may be some shortcomings, it is still a viable method to run FreeDOS on Raspberry Pi.
What about DOSBox?
Some may ask: “Why not use DOSBox?” DOSBox is an open-source, cross-platform x86 emulator that can also be used on Linux. It provides a DOS-like runtime environment for applications, especially games, so if you just want to play DOS games, DOSBox is a good choice. However, in the public’s perception, DOSBox is specifically designed for DOS games, and its performance is average when running other DOS applications.
For most people, this is just a matter of personal preference. I prefer to use FreeDOS to run DOS games and other programs; a complete DOS system offers me better flexibility and control compared to DOSBox. I only use DOSBox to play games, while I choose the complete FreeDOS for other purposes.
Installing FreeDOS on Raspberry Pi
QEMU[2] (Quick EMUlator) is an open-source virtual machine software that can run DOS systems on Linux. Many popular Linux distributions come with QEMU pre-installed. QEMU can also run on my Raspberry Pi’s Raspbian system, and below are some screenshots of me using QEMU on Raspberry Pi Raspbian GNU/Linux 9 (Stretch)[3].
Last year, when I wrote an article about how to run DOS programs on Linux[4], I used QEMU, and the steps to install and run FreeDOS on Raspberry Pi using QEMU are basically no different from those on other GNOME-based systems.
In QEMU, you need to set up a virtual machine by adding various components. First, specify a virtual disk image for installing and running DOS, and create a virtual disk image using the qemu-img
command. For FreeDOS, you don’t need a large space, so I created a 200MB virtual disk:
qemu-img create freedos.img 200M
Unlike PC emulators like VMware or VirtualBox, using QEMU requires setting up a virtual machine by adding various components. Although it can be a bit cumbersome, it is not difficult. I used the following parameters to install FreeDOS on Raspberry Pi using QEMU:
qemu-system-i386 -m 16 -k en-us -rtc base=localtime -soundhw sb16,adlib -device cirrus-vga -hda freedos.img -cdrom FD12CD.iso -boot order=d
You can find a complete introduction to these commands in my other articles[4]. In simple terms, the above command specifies an Intel i386-compatible virtual machine, allocates 16MB of memory, sets an English keyboard, a real-time clock based on system time, a sound card, a music card, and a VGA card. The file freedos.img
is specified as the first hard drive (C:
), and the FD12CD.iso
image is used as the CD-ROM (D:
) drive. QEMU is set to boot from the D:
CD-ROM.
You just need to follow the prompts to easily install FreeDOS 1.2. However, since the microSD card is relatively slow when facing a large amount of I/O, the installation of the operating system takes a long time.
Running FreeDOS on Raspberry Pi
Your performance depends on which type of microSD card you use. I use a SanDisk Ultra 64GB microSDXC UHS-I U1A1, where the U1 model is specifically designed to support 1080p video recording (such as GoPro), and its minimum serial write speed can reach 10MB/s. In contrast, the V60 model is dedicated to 4K video recording, with a minimum continuous write speed of 60MB/s. If your Raspberry Pi uses a V60 microSD card or even a V30 (which can reach 30MB/s), you will noticeably see that its I/O performance is better than mine.
Once FreeDOS is installed, you can boot directly from C:
. Just specify the boot order for QEMU with the following command:
qemu-system-i386 -m 16 -k en-us -rtc base=localtime -soundhw sb16,adlib -device cirrus-vga -hda freedos.img -cdrom FD12CD.iso -boot order=c
As long as FreeDOS is installed on the QEMU of Raspberry Pi, there will be no noticeable performance issues. For example, games usually load maps, monsters, sounds, and other data at the start of each level. Although this content takes some time to load, there is no noticeable performance issue during normal gameplay.
FreeDOS 1.2 comes with many games and other applications that can be installed using the FDIMPLES
package manager. My favorite in FreeDOS 1.2 is a space shooter game called WING, which reminds me of the classic arcade game Galaga (WING is a recursive acronym for Wing Is Not Galaga).
As-Easy-As is one of my favorite DOS applications; as a popular spreadsheet program in the 1980s and 1990s, it has powerful capabilities similar to those of Lotus 1-2-3 and now Microsoft Excel and LibreOffice Calc. As-Easy-As and Lotus 1-2-3 both save data as WKS files, which the new versions of Microsoft Excel can no longer read, while LibreOffice Calc may support it depending on compatibility. Given that the initial version of As-Easy-As was shareware, TRIUS still provides activation codes[5] for As-Easy-As 5.7 for free.
I also really like the GNU Emacs editor; FreeDOS also comes with a text editor called Freemacs, which is a class Emacs editor. It is more powerful than FreeDOS’s default FreeDOS Edit editor and provides an experience similar to GNU Emacs. If you need it, you can install it through the FDIMPLES
package manager in FreeDOS 1.2.
Yes, you might really be able to run DOS on Raspberry Pi
Even though Raspberry Pi does not support DOS at the hardware level, DOS can still run on Raspberry Pi with the help of emulators. Thanks to the QEMU PC emulator, some classic DOS games and DOS applications can run on Raspberry Pi. Performance may be slightly affected when executing disk I/O, especially during intensive operations (such as writing a large amount of data). Once you use QEMU and install FreeDOS in the virtual machine, you can enjoy classic DOS programs to your heart’s content.
via: https://opensource.com/article/18/3/can-you-run-dos-raspberry-pi
Author: Jim Hall[7] Translator: HankChow Proofreader: wxy
This article is originally compiled by LCTT and honorably presented by Linux China
Leave a Comment
Your email address will not be published. Required fields are marked *