Translated

This commit is contained in:
2021-11-22 20:07:54 +08:00 committed by GitHub
parent ef80c5adb6
commit 310d66d9a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 162 additions and 158 deletions

View File

@ -1,158 +0,0 @@
[#]: subject: (Install FreeDOS without the installer)
[#]: via: (https://opensource.com/article/21/6/install-freedos-without-installer)
[#]: author: (Jim Hall https://opensource.com/users/jim-hall)
[#]: collector: (lujun9972)
[#]: translator: (robsean)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Install FreeDOS without the installer
======
Here's how to set up your FreeDOS system manually without using the
installer.
![FreeDOS fish logo and command prompt on computer][1]
Most people should be able to install FreeDOS 1.3 RC4 very easily using the installer. The FreeDOS installer asks a few questions, then takes care of the rest—including making space for FreeDOS and making the system bootable.
But what if the installer doesn't work for you? Or what if you prefer to set up your FreeDOS system _manually_, without using the installer? With FreeDOS, you can do that too! Let's walk through the steps to install FreeDOS without using the installer. I'll do all of these steps using the QEMU virtual machine, using a blank hard drive image. I created a one hundred megabyte ("100M") hard drive image with this Linux command:
```
`$ qemu-img create freedos.img 100M`
```
I downloaded the FreeDOS 1.3 RC4 installation LiveCD as FD13LIVE.iso, which provides a "live" environment where I can run FreeDOS, including all the standard tools. Most users also use the LiveCD to install FreeDOS with the regular installer, but here I'll only use the LiveCD to install FreeDOS using individual commands from the command line.
I started the virtual machine with this rather long QEMU command, and selected the "Use FreeDOS 1.3 in Live Environment mode" boot menu entry:
```
`$ qemu-system-x86_64 -name FreeDOS -machine pc-i440fx-4.2,accel=kvm,usb=off,dump-guest-core=off -enable-kvm -cpu host -m 8 -overcommit mem-lock=off -no-user-config -nodefaults -rtc base=utc,driftfix=slew -no-hpet -boot menu=on,strict=on -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on -hda freedos.img -cdrom FD13LIVE.iso -device sb16 -device adlib -soundhw pcspk -vga cirrus -display sdl -usbdevice mouse`
```
![manual install][2]
Select "Use FreeDOS 1.3 in Live Environment mode" to boot the LiveCD
(Jim Hall, [CC-BY SA 4.0][3])
That QEMU command line includes a bunch of options that may seem confusing at first. You configure QEMU entirely with command-line options, so there is a lot to examine here. But I'll briefly highlight a few important options:
* `-m 8:` Set the system memory ("RAM") to 8 megabytes
* **`-boot menu=on,strict=on:`** Use a boot menu, so I can select if I want to boot from the CD-ROM image or the hard drive image
* **`-hda freedos.img`:** Use **freedos.img** as the hard drive image
* `-cdrom FD13LIVE.iso:`Use **FD13LIVE.iso** as the CD-ROM image
* **`-device sb16 -device adlib -soundhw pcspk`:** Define the machine with a SoundBlaster16 sound card, AdLib digitial music card, and PC speaker emulation (these are useful if you want to play DOS games)
* **`-usbdevice mouse`:** Recognize the user's mouse as a USB mouse (click in the QEMU window to use the mouse)
### Partition the hard drive
You can use FreeDOS 1.3 RC4 from the LiveCD, but if you want to install FreeDOS to your computer, you'll first need to make space on the hard drive. This requires creating a _partition_ with the FDISK program.
From the DOS command line, type `FDISK` to run the _fixed disk_ setup program. FDISK is a full-screen interactive program, and you only need to type a number to select a menu item. From the main FDISK menu, enter "1" to create a DOS partition on the drive, then enter "1" on the next screen to create a _primary_ DOS partition.
![using fdisk][4]
Select "1" to create a partition
(Jim Hall, [CC-BY SA 4.0][3])
![using fdisk][5]
Select "1" on the next menu to make a primary partition
(Jim Hall, [CC-BY SA 4.0][3])
FDISK asks you if you wish to use the full size of the hard disk to create the partition. Unless you need to share space on this hard drive with another operating system, such as Linux, you should answer "Y" to this prompt.
After FDISK creates the new partition, you'll need to reboot before DOS can recognize the new partition information. Like all DOS operating systems, FreeDOS identifies the hard drive information only when it boots up. So if you create or delete any disk partitions, you'll need to reboot so FreeDOS recognizes the changed partition information. FDISK reminds you to reboot, so you don't forget.
![using fdisk][6]
You need to reboot to recognize the new partition
(Jim Hall, [CC-BY SA 4.0][3])
You can reboot by stopping and restarting the QEMU virtual machine, but I prefer to reboot FreeDOS from the FreeDOS command line, using the FreeDOS Advanced Power Management (FDADPM) tool. To reboot, type the command `FDADPM /WARMBOOT` and FreeDOS reboots itself.
### Formatting the hard drive
After FreeDOS restarts, you can continue setting up the hard drive. Creating the disk partition was "step 1" in this process; now you need to make a DOS _filesystem_ on the partition so FreeDOS can use it.
DOS systems identify "drives" using the letters `A` through `Z`. FreeDOS recognizes the first partition on the first hard drive as the `C` drive, and so on. You often indicate the drive with the letter and a colon (`:`) so the new partition we created above is actually the `C:` drive.
You can create a DOS filesystem on the new partition with the FORMAT command. This command takes a few options, but we'll only use the `/S` option to tell FORMAT to make the new filesystem bootable—the "S" means to install the FreeDOS "System" files. Type `FORMAT /S C:` to make a new DOS filesystem on the `C:` drive.
![formatting the disk][7]
Format the partition to create the DOS filesystem
(Jim Hall, [CC-BY SA 4.0][3])
With the `/S` option, FORMAT will run the SYS program to transfer the system files. You'll see this as part of the output from FORMAT:
![formatting the disk][8]
FORMAT /S will use SYS to make the disk bootable
(Jim Hall, [CC-BY SA 4.0][3])
### Installing software
Having created a new partition with FDISK and a new filesystem with FORMAT, the new `C:` drive is basically empty. At this point, the `C:` drive only contains a copy of the kernel and the `COMMAND.COM` command-line shell. To do anything useful with the new disk, we need to install software on it. This is the last step for the manual install process.
The FreeDOS 1.3 RC4 LiveCD contains all of the software you might want to install on the new system. Each FreeDOS program is available as a separate "package," which is really just a Zip archive file. The packages that set up the standard DOS environment are stored in the `BASE` directory, under the `PACKAGES` directory on the LiveCD.
You could install the packages by "unzipping" each of them to the hard drive, one at a time. With 62 individual packages in the "Base" group, installing each package individually would take a very long time. However, you can run a one-line `FOR` "loop" command to "unzip" each program. Then FreeDOS can "unzip" all of the packages for you.
The basic usage of the `FOR` loop indicates a single-letter variable (let's use `%F`) that FreeDOS uses to "fill in" the filename later. The `FOR` also requires a list of files in brackets and the command that it should run against each of the files. The syntax to unzip a list of Zip files looks like this:
```
`FOR %F IN (*.ZIP) DO UNZIP %F`
```
This extracts all of the Zip files into the current directory. To extract or "unzip" the files into a different location, use the `-d` ("destination") option at the end of the `UNZIP` command line. For most FreeDOS systems, you will want to install the software packages to the `C:\FDOS` directory:
![installing the software][9]
Unzip all of the Base packages to finish installing FreeDOS
(Jim Hall, [CC-BY SA 4.0][3])
FreeDOS takes care of the rest, installing all 62 packages to your system. This may take several minutes because DOS can be slow when working with lots of individual files—and this command needs to extract 62 Zip files. The installation process would run a lot faster if we used a single `BASE.ZIP` archive file, but using packages provides more flexibility in what software you might want to install versus what you choose to leave out.
![installing the software][10]
After installing all the Base packages
(Jim Hall, [CC-BY SA 4.0][3])
After you've installed everything, reboot your system with `FDADPM /WARMBOOT`. Installing manually means your new FreeDOS system won't have the usual `FDCONFIG.SYS` configuration file, so FreeDOS will assume a few typical default values when it starts up. Without the `AUTOXEC.BAT` file, FreeDOS also prompts you for the time and date.
![rebooting FreeDOS][11]
Rebooting FreeDOS after a manual install
(Jim Hall, [CC-BY SA 4.0][3])
Most users should be able to use the more user-friendly process to install FreeDOS on a new computer. But if you want to install it yourself the "old school" way, you can also run the installation steps manually. This can provide some additional flexibility and control because you install everything yourself. And now you know how to do it.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/6/install-freedos-without-installer
作者:[Jim Hall][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jim-hall
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/freedos-fish-laptop-color.png?itok=vfv_Lpph (FreeDOS fish logo and command prompt on computer)
[2]: https://opensource.com/sites/default/files/uploads/manual-install3.png (Select "Use FreeDOS 1.3 in Live Environment mode" to boot the LiveCD)
[3]: https://creativecommons.org/licenses/by-sa/4.0/
[4]: https://opensource.com/sites/default/files/uploads/manual-install6.png (Select "1" to create a partition)
[5]: https://opensource.com/sites/default/files/uploads/manual-install7.png (Select "1" on the next menu to make a primary partition)
[6]: https://opensource.com/sites/default/files/uploads/manual-install10.png (You need to reboot to recognize the new partition)
[7]: https://opensource.com/sites/default/files/uploads/manual-install13.png (Format the partition to create the DOS filesystem)
[8]: https://opensource.com/sites/default/files/uploads/manual-install14.png (FORMAT /S will use SYS to make the disk bootable)
[9]: https://opensource.com/sites/default/files/uploads/manual-install18.png (Unzip all of the Base packages to finish installing FreeDOS)
[10]: https://opensource.com/sites/default/files/uploads/manual-install24.png (After installing all the Base packages)
[11]: https://opensource.com/sites/default/files/uploads/manual-install28.png (Rebooting FreeDOS after a manual install)

View File

@ -0,0 +1,162 @@
[#]: subject: (Install FreeDOS without the installer)
[#]: via: (https://opensource.com/article/21/6/install-freedos-without-installer)
[#]: author: (Jim Hall https://opensource.com/users/jim-hall)
[#]: collector: (lujun9972)
[#]: translator: (robsean)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
不使用安装程序安装 FreeDOS
======
这里是如何在不使用安装程序的情况下来手动设置你的 FreeDOS 系统。
![FreeDOS fish logo and command prompt on computer][1]
大多数的人应该能够使用安装程序来非常容易地安装 FreeDOS 1.3 RC4 。FreeDOS 安装程序会先询问几个问题,然后处理剩余的工作—包括为 FreeDOS 制作安装空间和使系统可启动。
但是,如果安装程序不适合你怎么办?或者,你更喜欢 _手动_ 设置你的 FreeDOS 系统,而不喜欢使用安装程序怎么办?使用 FreeDOS ,你也可以做到这些!让我们在不使用安装程序的情况下逐步走完安装 FreeDOS 的步骤。我将使用 QEMU 虚拟机的一个空白的硬盘驱动器镜像来完成所有的步骤。我使用这个 Linux 命令来创建了一个 100 MB 的硬盘驱动器镜像:
```
`$ qemu-img create freedos.img 100M`
```
我下载了 FreeDOS 1.3 RC4 的 LiveCD ,并将其命名为 FD13LIVE.iso ,它提供了一个 "live" 环境,我可以在其中运行 FreeDOS ,包括所有的标准工具。大多数用户也使用 LiveCD 自带的常规安装程序来安装 FreeDOS 。但是,在这里我将仅使用 LiveCD ,并从其命令行中使用某些类型的命令来安装 FreeDOS 。
我使用这个相当长的 QEMU 命令来启动虚拟机,并选择 "Use FreeDOS 1.3 in Live Environment mode" 启动菜单项:
```
`$ qemu-system-x86_64 -name FreeDOS -machine pc-i440fx-4.2,accel=kvm,usb=off,dump-guest-core=off -enable-kvm -cpu host -m 8 -overcommit mem-lock=off -no-user-config -nodefaults -rtc base=utc,driftfix=slew -no-hpet -boot menu=on,strict=on -sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,resourcecontrol=deny -msg timestamp=on -hda freedos.img -cdrom FD13LIVE.iso -device sb16 -device adlib -soundhw pcspk -vga cirrus -display sdl -usbdevice mouse`
```
![manual install][2]
选择 "Use FreeDOS 1.3 in Live Environment mode" 来启动 LiveCD
(Jim Hall, [CC-BY SA 4.0][3])
这个 QEMU 命令行包含大量的选项,乍看可能会让你迷糊。因为你完全使用命令行选项配置 QEMU ,所以在这里有很多东西需要审查。但是,我将简单地重点说明几个重要的选项:
* `-m 8:` 设置系统存储器 ("RAM") 为 8 MB
* **`-boot menu=on,strict=on:`** 使用一个启动菜单,这样,我可以选择从 CD-ROM 镜像或硬盘驱动器镜像启动
* **`-hda freedos.img`:** 使用 **freedos.img** 作为硬盘驱动器镜像
* `-cdrom FD13LIVE.iso:` 使用 **FD13LIVE.iso** 作为 CD-ROM 镜像
* **`-device sb16 -device adlib -soundhw pcspk`:** 定义计算机带有一个 SoundBlaster16 声卡AdLib 数字音乐卡PC 扬声器模拟器 (如果你想玩 DOS 游戏的话,这些模拟器是很有用的)
* **`-usbdevice mouse`:** 将识别用户的鼠标为一个 USB 鼠标 (在 QEMU 窗口中单击以使用鼠标)
### 对硬盘驱动器进行分区
你可以从 LiveCD 使用 FreeDOS 1.3 RC4 ,但是,如果你想安装 FreeDOS 到你的计算机中,你需要先在硬盘驱动器上制作安装空间。这需要使用 FDISK 程序来创建一个 _分区_ 。
从 DOS 命令行中,输入 `FDISK` 来运行 _fixed disk_ 设置程序。FDISK 是一个全屏交互式程序,你只需要输入数字来选择菜单项。从 FDISK 的主菜单中,输入 "1" 来在驱动器上创建一个 DOS 分区,然后在接下来的屏幕上输入 "1" 来创建一个 _主_ DOS 分区。
![using fdisk][4]
选择 "1" 来创建一个分区
(Jim Hall, [CC-BY SA 4.0][3])
![using fdisk][5]
在接下来的菜单上选择 "1" 来制作一个主分区
(Jim Hall, [CC-BY SA 4.0][3])
FDISK 会询问你是否想要使用全部的硬盘空间大小来创建分区。除非你需要在这个硬盘驱动器上和另外一个操作系统 (例如 Linux ) 共享硬盘空间,否则,对于这个提示,你应该回答 "Y" 。
在 FDISK 创建新的分区后,在 DOS 能够识别新的分区信息前,你将需要重新启动 DOS 。像所有的 DOS 操作系统一样FreeDOS 仅在其启动时识别硬盘驱动器信息。因此,如果你创建或删除任何的磁盘分区的话,你都将需要重新启动 FreeDOS 只有这样做FreeDOS 才能识别到更改的分区信息。FDISK 会提醒你重新启动,因此,你是不会忘记的。
![using fdisk][6]
你需要重新启动以 recognize 新的分区
(Jim Hall, [CC-BY SA 4.0][3])
你可以通过停止或重新启动 QEMU 虚拟机来重新启动 FreeDOS但是我更喜欢在 FreeDOS 命令行中使用 FreeDOS 的高级电源管理 (FDADPM) 工具来重新启动 FreeDOS 。为了重新启动,输入命令 `FDADPM /WARMBOOT` FreeDOS 将自动重新启动。
### 对硬盘驱动器进行格式化
在 FreeDOS 重新启动后,你可以继续
硬盘驱动器。创建磁盘分区是这个过程的"第一步";现在你需要在分区上创建一个 DOS _文件系统_ ,以便 FreeDOS 可以使用它。
DOS 系统使用字母 `A` 到 `Z` 来识别"驱动器"。FreeDOS 将识别第一个硬盘驱动器的第一个分区为 `C` 驱动器,依此论推。你经常使用字母和一个冒号 (`:`) 来表示驱动器,因此我们在上面创建的新分区实际上是 `C:` 驱动器。
你可以在新的分区上使用 FORMAT 命令来创建一个 DOS 文件系统。这个命令带有一些选项,但是,我们将仅使用 `/S` 选项来告诉 FORMAT 来使新的文件系统可启动— "S" 意味着安装 FreeDOS "系统" 文件。输入 `FORMAT /S C:` 来在 `C:` 驱动器上制作一个新的 DOS 文件系统。
![formatting the disk][7]
格式化分区来创建 DOS 文件系统
(Jim Hall, [CC-BY SA 4.0][3])
使用 `/S` 选项FORMAT 将运行 SYS 程序来
transfer
系统文件。你将看到这是从 FORMAT 输出的一部分:
![formatting the disk][8]
FORMAT /S 将使用 SYS 来使磁盘可启动
(Jim Hall, [CC-BY SA 4.0][3])
### 安装软件
在使用 FDISK 创建了一个新的分区,并使用 FORMAT 创建了一个新的文件系统后, 新的 `C:` 驱动器基本上是空的。此时,`C:` 驱动器仅包含一份内核和 `COMMAND.COM` 命令行 shell 的副本。为使新的磁盘可以执行一些有用的操作,我们需要在其上安装软件。这是手动安装过程的最后步骤。
FreeDOS 1.3 RC4 LiveCD 包含所有的你可能希望在新的系统上所要安装的软件。每个 FreeDOS 程序都是一个单独的 "软件包" ,它实际上只是一个 Zip 档案文件。建立标准 DOS 环境的软件包存储在 LiveCD 上 `PACKAGES` 目录下 `BASE` 目录之中。
你可以一次一个的将其中的每一个软件包都 "解压缩" 到硬盘驱动器来完成安装。在 "Base" 组中有 62 个单独的软件包,如果每次安装一个软件包,这可能会花费非常多的时间。不过,你可以运行一个只有一行的 `FOR` "循环" 命令来 "unzip" 每个程序。接下来 FreeDOS 可以为你 "解压缩" 所有的软件包。
`FOR` 循环的基本用法中提及的一个单个字母变量 (让我们使用 `%F`) 稍后FreeDOS 将使用该字母变量来 "填充" 文件名称。`FOR` 还需要括号中的一个文件列表,这个命令会对每个文件都运行一次。用来解压一系列的 Zip 文件的语法看起来像这样:
```
`FOR %F IN (*.ZIP) DO UNZIP %F`
```
这将提取所有的 Zip 文件到当前目录之中。为提取或 "unzip" 文件到一个不同的位置,在 `UNZIP` 命令行结尾处使用 `-d` ("目的地") 选项。对于大多数的 FreeDOS 系统来说,你应该安装软件包到 `C:\FDOS` 目录中:
![installing the software][9]
解压缩所有的基本软件包来完成安装 FreeDOS
(Jim Hall, [CC-BY SA 4.0][3])
FreeDOS 会处理剩余的工作,安装所有的 62 个软件包到你的系统之中。这可能会花费几分钟的时间,因为 DOS 在处理很多单个的文件时会很慢—这个命令需要提取 62 个 Zip 文件。如果我们使用单个的 `BASE.ZIP` 档案文件的话,安装过程可能会运行地更快,但是使用软件包的话,在你选择想要安装或不安装软件包时会提供更多的灵活性。
![installing the software][10]
在安装所有的基本软件包后
(Jim Hall, [CC-BY SA 4.0][3])
在我们安装完所有的东西后,使用 `FDADPM /WARMBOOT` 来重新启动你的系统。手动安装意味着你的新 FreeDOS 系统没有常见的 `FDCONFIG.SYS` 配置文件,因此,当 FreeDOS 在启动时,它将假设一些典型的默认值。即使没有 `AUTOXEC.BAT` 文件FreeDOS 也会提示你时间和日期。
![rebooting FreeDOS][11]
在手动安装后,重新启动 FreeDOS
(Jim Hall, [CC-BY SA 4.0][3])
大多数的用户应该能够使用比较用户友好的过程来在一台新的计算机上安装 FreeDOS 。但是如果你想自己使用"古老的"方法来安装它,那么你可以手动运行安装步骤。这会提供一些额外的灵活性和控制权,因为是你自己安装的一切。现在你知道如何安装它了。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/6/install-freedos-without-installer
作者:[Jim Hall][a]
选题:[lujun9972][b]
译者:[robsean](https://github.com/robsean)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jim-hall
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/freedos-fish-laptop-color.png?itok=vfv_Lpph (FreeDOS fish logo and command prompt on computer)
[2]: https://opensource.com/sites/default/files/uploads/manual-install3.png (Select "Use FreeDOS 1.3 in Live Environment mode" to boot the LiveCD)
[3]: https://creativecommons.org/licenses/by-sa/4.0/
[4]: https://opensource.com/sites/default/files/uploads/manual-install6.png (Select "1" to create a partition)
[5]: https://opensource.com/sites/default/files/uploads/manual-install7.png (Select "1" on the next menu to make a primary partition)
[6]: https://opensource.com/sites/default/files/uploads/manual-install10.png (You need to reboot to recognize the new partition)
[7]: https://opensource.com/sites/default/files/uploads/manual-install13.png (Format the partition to create the DOS filesystem)
[8]: https://opensource.com/sites/default/files/uploads/manual-install14.png (FORMAT /S will use SYS to make the disk bootable)
[9]: https://opensource.com/sites/default/files/uploads/manual-install18.png (Unzip all of the Base packages to finish installing FreeDOS)
[10]: https://opensource.com/sites/default/files/uploads/manual-install24.png (After installing all the Base packages)
[11]: https://opensource.com/sites/default/files/uploads/manual-install28.png (Rebooting FreeDOS after a manual install)