toss! Running DOS on a Raspberry Pi

The different CPU architectures mean that running DOS on a Raspberry Pi isn't easy, but it's not that much of a hassle.

toss!  Running DOS toss on a Raspberry Pi!  Running DOS on a Raspberry Pi

FreeDOS may not be unfamiliar to everyone. It is a complete, free and DOS-compatible operating system, it can run some older DOS games or commercial software, and can also develop embedded applications. Any program that runs 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: "Will FreeDOS run on a Raspberry Pi?"

This question is not surprising. After all  , Linux  can run well on the Raspberry Pi, and FreeDOS is an older, less resource-intensive operating system than Linux, so why can't FreeDOS run on the Raspberry Pi?

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

However, it is still possible to run FreeDOS on the Raspberry Pi through a PC emulator. Although this may be slightly insufficient, it is also 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 operating environment for application software, especially game software, so if If you just want to play DOS games, DOSBox is a good choice. But in the eyes of the public, DOSBox is designed for DOS games, and in running some other DOS applications, DOSBox is just mediocre.

For most people, it's just a matter of personal preference, I like to use FreeDOS to run DOS games and other programs, a full DOS system allows me to experience better flexibility and control than DOSBox. I only use DOSBox to play games, otherwise I 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 works on Raspbian on my Raspberry Pi, here are some screenshots of my use of QEMU on Raspbian GNU/Linux 9 (Stretch) on my Raspberry Pi.

I used QEMU last year when I wrote an article on how to run DOS programs on a Linux system. The steps to install and run FreeDOS using QEMU on a Raspberry Pi are basically the same as on other GNOME-based systems. What a big difference.

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

qemu-img create freedos.img 200M

Unlike PC emulators like VMware or VirtualBox, using QEMU requires adding various components to build a virtual machine, which is a bit cumbersome, but 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

你可以在我其它的文章中找到这些命令的完整介绍。简单来说,上面这条命令指定了一个英特尔 i386 兼容虚拟机,并且分配了 16MB 内存、一个英文输入键盘、一个基于系统时间的实时时钟、一个声卡、一个音乐卡以及一个 VGA 卡。文件 freedos.img 指定为第一个硬盘(C:),FD12CD.iso 镜像作为 CD-ROM (D:)驱动。QEMU 设定为从 D: 的 CD-ROM 启动。

你只需要按照提示就可以轻松安装好 FreeDOS 1.2 了。但是由于 microSD 卡在面对大量的 I/O 时速度比较慢,所以安装操作系统需要花费很长时间。

在树莓派上运行 FreeDOS

你的运行情况取决于使用哪一种 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 程序了。

via: https://opensource.com/article/18/3/can-you-run-dos-raspberry-pi

Author: Jim Hall Translator: HankChow Proofreading: wxy

This article is originally compiled by LCTT, and launched by Linux China

The original text comes from: https://www.linuxprobe.com/raspberry-pi-freedos.html

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325859240&siteId=291194637