Home  >  Article  >  System Tutorial  >  toss! Running DOS on Raspberry Pi

toss! Running DOS on Raspberry Pi

王林
王林Original
2024-07-19 17:23:10995browse

Different CPU architectures mean that running DOS on the Raspberry Pi is not easy, but it’s not that troublesome.

toss! Running DOS on Raspberry Pi

FreeDOS may be familiar to everyone. It is a complete, free and well-compatible operating system for DOS. It can run some older DOS games or commercial software, and can also develop embedded applications. Any program that can run on MS-DOS can run on FreeDOS.

As the initiator and project coordinator of FreeDOS, many users will ask me questions as an insider. And the question I get asked most often is: "Can FreeDOS run on a Raspberry Pi?"

This question is not surprising. After all, Linux can run very well on the Raspberry Pi, and FreeDOS is an older operating system that takes up less resources than Linux. So why can’t FreeDOS run on the Raspberry Pi?

Simply put. Due to the CPU architecture, FreeDOS cannot run independently on the Raspberry Pi. Like other DOS-like systems, FreeDOS requires an Intel x86 architecture CPU and BIOS to provide basic runtime services. The Raspberry Pi runs on an ARM architecture CPU, which is not binary compatible with Intel CPUs and does not have a BIOS. Therefore, Raspberry Pi does not support FreeDOS at the hardware level.

However, you can still run FreeDOS on the Raspberry Pi through a PC emulator. Although this may be slightly insufficient, it is still a method to run FreeDOS on the Raspberry Pi.

How about DOSBox?

Some people may ask: "Why not use DOSBox?" DOSBox is an open source cross-platform x86 emulator that can also be used on Linux. It can provide a DOS-like running environment for application software, especially game software, so If you just want to play DOS games, DOSBox is a good choice. But in the eyes of the public, DOSBox is designed specifically for DOS games, and when it comes to running some other DOS application software, DOSBox only performs mediocrely.

For most people, this is just a matter of personal preference. I like to use FreeDOS to run DOS games and other programs. A complete DOS system allows me to experience better flexibility and controllability than DOSBox. I only use DOSBox for gaming, and otherwise choose full FreeDOS.

Install FreeDOS on Raspberry Pi

QEMU (Quick EMUlator) is an open source virtual machine software that can run DOS systems on Linux systems. Many popular Linux systems come with QEMU. QEMU also runs on my Raspbian system on the Raspberry Pi. Below are some screenshots of me using QEMU on the Raspbian GNU/Linux 9 (Stretch) system on the Raspberry Pi.

I used QEMU last year when I wrote an article about how to run DOS programs in Linux systems. The steps to use QEMU to install and run FreeDOS on the Raspberry Pi are basically the same as on other GNOME-based systems. There is no big difference.

In QEMU you need to build a virtual machine by adding various components. First specify a virtual disk image to install and run DOS, and create a virtual disk image through the qemu-img command. FreeDOS does not require much space, so I only created a 200MB virtual disk:

qemu-img create freedos.img 200M

Unlike PC emulators such as VMware or VirtualBox, using QEMU requires adding various components to build a virtual machine. Although it is a bit troublesome, it is not difficult. I used the following parameters to install FreeDOS using QEMU on the Raspberry Pi:

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. Simply put, the above command specifies an Intel i386-compatible virtual machine and allocates 16MB of memory, an English input keyboard, a real-time clock based on system time, a sound card, a music card, and a VGA card. The file freedos.img is designated as the first hard drive (C:), and the FD12CD.iso image is designated as the CD-ROM (D:) drive. QEMU is configured to boot from the CD-ROM in D:.

You only need to follow the prompts to install FreeDOS 1.2 easily. But since microSD cards are slow when faced with heavy I/O, installing the operating system takes a long time.

Running FreeDOS on Raspberry Pi

你的运行情况取决于使用哪一种 microSD 卡。我用的是 SanDisk Ultra 64GB microSDXC UHS-I U1A1 ,其中 U1 这种型号专用于支持 1080p 的视频录制(例如 GoPro),它的最低串行写速度能够达到 10MB/s。相比之下,V60 型号专用于 4K 视频录制,最低连续写入速度能达到 60MB/s。如果你的树莓派使用的是 V60 的 microSD 卡甚至是 V30(也能达到 30MB/s),你就能明显看到它的 I/O 性能会比我的好。

FreeDOS 安装好之后,你可以直接从 C: 进行启动。只需要按照下面的命令用 -boot order=c 来指定 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=c​

只要树莓派的 QEMU 上安装了 FreeDOS,就不会出现明显的性能问题。例如游戏通常在每一关开始的时候会加载地图、怪物、声音等一系列的数据,尽管这些内容需要加载一段时间,但在正常玩的时候并没有出现性能不足的现象。

FreeDOS 1.2 自带了很多游戏以及其它应用软件,可以使用 FDIMPLES 包管理程序来安装它们。FreeDOS 1.2 里面我最喜欢的是一款叫 WING 的太空射击游戏,让人想起经典的街机游戏 Galaga(WING 就是 Wing Is Not Galaga 的递归缩写词)。

As-Easy-As 是我最喜欢的一个 DOS 应用程序,作为 20 世纪八九十年代流行的电子表格程序,它和当时的 Lotus 1-2-3 以及现在的 Microsoft Excel、LibreOffice Calc 一样具有强大的威力。As-Easy-As 和 Lotus 1-2-3 都将数据保存为 WKS 文件,现在新版本的 Microsoft Excel 已经无法读取这种文件了,而 LibreOffice Calc 视兼容性而定有可能支持。鉴于 As-Easy-As 的初始版本是一个共享软件,TRIUS 仍然为 As-Easy-As 5.7 免费提供激活码。

我也非常喜欢 GNU Emacs 编辑器,FreeDOS 也自带了一个叫 Freemacs 的类 Emacs 的文本编辑器。它比 FreeDOS 默认的 FreeDOS Edit 编辑器更强大,也能带来 GNU Emacs 的体验。如果你也需要,可以在 FreeDOS 1.2 中通过FDIMPLES包管理程序来安装。

是的,你或许真的可以在树莓派上运行 DOS

即使树莓派在硬件上不支持 DOS,但是在模拟器的帮助下,DOS 还是能够在树莓派上运行。得益于 QEMU PC 模拟器,一些经典的 DOS 游戏和 DOS 应用程序能够运行在树莓派上。在执行磁盘 I/O ,尤其是大量密集操作(例如写入大量数据)的时候,性能可能会受到轻微的影响。当你使用 QEMU 并且在虚拟机里安装好 FreeDOS 之后,你就可以尽情享受经典的 DOS 程序了。

The above is the detailed content of toss! Running DOS on Raspberry Pi. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn