Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to run DOS Program in Linux

2025-04-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to run DOS programs in Linux", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn how to run DOS programs in Linux "this article.

The traditional DOS operating system supports many excellent applications: word processing, spreadsheets, games and other programs. But just because an application is too old doesn't mean it's useless.

There are many reasons to run an old DOS application these days. Maybe it's to extract a report from a legacy business application, or to play a classic DOS game, or just because you're curious about "traditional computers." You don't need to dual boot your system to run DOS programs. Instead, you can run them correctly in Linux with the help of a PC emulator and FreeDOS.

FreeDOS is a complete, free, DOS-compatible operating system that you can use to play classic games, run old-fashioned business software, or develop embedded systems. Any program that works in MS-DOS can also run in FreeDOS.

In those days, you installed DOS as an exclusive operating system on a computer. Today, it can be easily installed into a virtual machine running on Linux. QEMU (short for Quick EMUlator) is an open source virtual machine software that runs DOS as a "guest guest" operating system in Linux. Many popular Linux systems include QEMU by default.

With the following four steps, it is easy to run an old DOS program under Linux by using QEMU and FreeDOS.

Step 1: set up a virtual disk

You need a place to install FreeDOS in QEMU, and for that you need a virtual C: drive. In DOS, the letters A: and B: are assigned to the first and second floppy drives, while C: is the first hard drive. Other media, including other hard drives and CD-ROM drives, are assigned D:, E:, and so on.

In QEMU, a virtual disk is an image file. To initialize a file that is used as a virtual C: drive, use the qemu-img command. To create an image file of about 200 MB, type:

Qemu-img create dos.img 200M

Compared with modern computers, 200MB looks very small, but as early as the 1990s, 200MB was very large. It is sufficient to install and run DOS.

Step 2: QEMU option

Unlike PC emulation systems VMware or VirtualBox, you need to "build" your virtual system by adding components to each virtual machine with the QEMU command. Although this may seem laborious, it is actually not difficult. These are the parameters we used to boot FreeDOS in QEMU:

Qemu-system-i386QEMU can emulate several different systems, but to boot to DOS, we need an Intel-compliant CPU. To do this, use the i386 command to start QEMU. -m 16 I like to define a virtual machine that uses 16MB memory. It looks small, but DOS doesn't need a lot of memory to work. In the age of DOS, it is very common for computers to use 16MB or 8MB memory. -k en-us technically, this-k option is not needed because QEMU will set up a virtual keyboard to match your real keyboard (in my case, it is an English keyboard with a standard US layout). But I still like to specify it. -rtc base=localtime each traditional PC device has a real-time clock (RTC) so that the system can keep track of time. I find it the easiest way to set up a virtual RTC to match your local time. -soundhw sb16,adlib,pcspk if you need sound, especially for games, I prefer to define QEMU to support SoundBlaster 16 sound hardware and AdLib music. SoundBlaster 16 and AdLib are very common sound hardware in the DOS era. Some older programs may use PC speakers to make sounds; QEMU can also emulate this. -device cirrus-vga to use images, I like to simulate a simple VGA video card. Cirrus VGA card was a common graphics card at that time, and QEMU could simulate it. -display gtk for virtual display, I set up QEMU to use GTK toolkit, which can put the virtual system into its own window and provide a simple menu to control the virtual machine. -boot order= you can tell QEMU to boot the virtual machine from multiple boot sources. Boot from a floppy drive (typically A: on DOS machines) to specify order=a. Boot from the first hard drive (commonly known as C:) using order=c. Or to use order=d from a CD-ROM drive (which is often allocated as D: in DOS). You can use a combination of letters to specify a specific boot order, such as order=dc to be the first to use the CD-ROM drive, if there is no boot media in the CD-ROM drive, and then use the hard drive.

Show details

Step 3: boot and install FreeDOS

Now that QEMU is set up to run the virtual machine, we need a DOS system to install and boot in that virtual machine. FreeDOS is easy to do this. Its latest version is FreeDOS 1.2, which was released in December 2016.

Download the release version of FreeDOS 1.2 from the FreeDOS website. The FreeDOS 1.2 CD-ROM "standard" installer (FD12CD.iso) runs well on QEMU, so I recommend this version.

Installing FreeDOS is easy. First, tell QEMU to use the CD-ROM image and boot from it. Remember, the first hard drive is a C: drive, so the CD-ROM will appear as a D: drive.

Qemu-system-i386-m 16-k en-us-rtc base=localtime-soundhw sb16,adlib-device cirrus-vga-display gtk-hda dos.img-cdrom FD12CD.iso-boot order=d

As prompted below, you will install FreeDOS in a few minutes.

Starting FreeDOS installation

Select your keyboard layout

Selecting which packages to install

Rebooting after installation

After your installation is complete, close the window and exit QEMU.

Step 4: install and run your DOS application

Once you have installed FreeDOS, you can run various DOS applications in QEMU. You can find old DOS programs online through a variety of archives or other websites.

QEMU provides an easy way to access local files on Linux. For example, you want to share the dosfiles/ folder with QEMU. By using the-drive option, simply tell QEMU to use this folder as the virtual FAT drive. QEMU will access this folder like a hard drive.

-drive file=fat:rw:dosfiles/

Now, you can use the appropriate options to start QEMU, plus an external virtual FAT drive:

Qemu-system-i386-m 16-k en-us-rtc base=localtime-soundhw sb16,adlib-device cirrus-vga-display gtk-hda dos.img-drive file=fat:rw:dosfiles/-boot order=c

Once you boot into FreeDOS, any files you save in the D: drive will be saved to the dosfiles/ folder on Linux. You can easily read this file directly from Linux; however, it is important to note that after starting QEMU, you cannot change the dosfiles/ folder from Linux. When you start QEMU, QEMU builds a virtual FAT table at once. If you add or delete files in the dosfiles/ folder after starting QEMU, the emulator may be confused.

I use QEMU to run some of my favorite DOS programs like this, such as As-Easy-As spreadsheet programs. This is a spreadsheet program that was very popular in the 1980s and 1990s, and it does the same work as today's Microsoft Excel and LibreOffice Calc or the more expensive Lotus 1-2-3 spreadsheet programs. Both As-Easy-As and Lotus 1-2-3 save data as WKS files, which cannot be read by the latest version of Microsoft Excel, but LibreOffice Calc can support it based on compatibility.

As-Easy-As spreadsheet program

I also like to guide FreeDOS to play some favorite DOS games in QEMU, such as the original Doom. These old DOS games are still very interesting to play, and they now run very well on QEMU.

Doom

Heretic

Jill of the Jungle

Commander Keen

QEMU and FreeDOS make it easy to run old DOS programs on Linux. Once you have set up QEMU as a virtual machine emulator and installed FreeDOS, you will be able to run your collection of classic DOS programs on Linux.

The above is all the contents of the article "how to run DOS programs in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report