此文章由原博客迁移而来。

原文地址:https://blog.betaworld.cn/311

原作者:BetaRookie

以下为本文正文部分。

311-1-MS-DOS-1.25-Image.png

在 MS-DOS 3.20 之前,Microsoft 从未直接分发 MS-DOS。相反,他们向 OEM 发送 OEM 适配套件(OAK),OEM 向公众发布其定制版本的 MS-DOS。IBM 也可以被视为 OEM,他们定制的 MS-DOS 被称为 PC-DOS。大多数 OEM 的产品都有自己的版权信息,有些产品与 PC 不兼容。因此,在 MS-DOS 3.20 之前,如果您使用 IBM PC,则通常使用 IBM 的 PC-DOS,否则使用 OEM 的定制 MS-DOS。

MS-DOS 和 PC-DOS 有什么区别?在 DOS 源代码中,您可以看到 IBMVERMSVER 开关 – 您可以打开 MSVER 和关闭 IBMVER 来构建 MS-DOS,反之亦然。PC-DOS 和 MS-DOS 的主要区别在于:不同的版权信息、不同的转义序列表、不同事物的不同分隔符以及 PC-DOS 的默认驱动器是 A

如果我想在 IBM PC 上使用 MS-DOS 怎么办?我们知道 PC-DOS 是 IBM 定制的 MS-DOS 版本,因此我们可以借用 PC-DOS 的一些代码,使用 MS-DOS OAK 创建 MS-DOS 1.25 的通用版本。对于 MS-DOS 1.25,OEM 必须写 DOS BIOS、引导扇区和 OEM FORMAT 模块。

对于 DOS BIOS,我们只需将 PC-DOS 的 IBMBIO.COM 重命名为 IO.SYS 即可。对于引导扇区,我们可以修补 PC-DOS 以加载 IO.SYSMSDOS.SYS,而不是 IBM 的 IBMBIO.COMIBMDOS.COMOEM FORMAT 模块有点难,因为 IBM 将其与 Microsoft 的 FORMAT 模块的 PC-DOS 版本相链接。我们需要将其与微软的 FORMAT 模块的 MS-DOS 版本相链接,因此我们必须首先从 PC-DOS 的 FORMAT.COM 中提取 OEM 模块。完成后,我们可以将其与 Microsoft 的 FORMAT 模块链接,生成 MS-DOS 的 FORMAT.COM

现在,我们已经准备好了所有 OEM 组件,是时候将 MS-DOS 1.25 的通用 PC 兼容版本组装起来了。由于许多 OEM 将 Microsoft 的开发软件与 MS-DOS 一并发布,我们可以假设 MS-DOS 1.25 应该有两个磁盘,一个带有 MS-DOS,另一个带有开发程序。然后,我们将 DOS BIOS、DOS 内核和所有独立组件从 Microsoft 的 OAK 添加到第一个磁盘,并将 Microsoft 的开发程序添加到第二个磁盘。然后我们就完成了!

311-2-MS-DOS-1.25-Demo-01.png

311-3-MS-DOS-1.25-Demo-02.png

311-4-MS-DOS-1.25-Demo-03.png

311-5-Generic-MS-DOS-1.25.zip

感谢我同事的翻译,下页是英文原文 :

311-1-MS-DOS-1.25-Image.png

Prior to MS-DOS 3.20, Microsoft never directly distributed MS-DOS. Instead, they sent out OEM Adaptation Kits (OAKs) to OEMs, and OEMs release their customized versions of MS-DOS to the general public. IBM can also be considered as an OEM, their customized MS-DOS is called PC-DOS. Most OEM copies include their custom brandings and some are not PC-compatible. So before MS-DOS 3.20, if you use the IBM PC, then generally you use IBM’s PC-DOS, otherwise you use your OEM’s customized MS-DOS.

What are the differences between MS-DOS and PC-DOS? In the DOS source code, you can see IBMVER and MSVER switches – you turn on MSVER and turn of IBMVER to build MS-DOS, vice versa for PC-DOS. Main differences between PC-DOS and MS-DOS are – different copyright messages, a different escape sequence table, different delimiters for various things and the default drive being A: for PC-DOS.

What if I want to use MS-DOS on an IBM PC? We know that PC-DOS is a customized version of MS-DOS by IBM, so we can borrow some code from PC-DOS to create a generic version of MS-DOS 1.25 using the MS-DOS OAK. For MS-DOS 1.25, the OEM must write the DOS BIOS, the boot sector and the OEM FORMAT module.

For the DOS BIOS, we can simply take PC-DOS’s IBMBIO.COM and rename it to IO.SYS. For the boot sector, we can patch PC-DOS’ to load IO.SYS and MSDOS.SYS instead of IBM’s IBMBIO.COM and IBMDOS.COM. The OEM FORMAT module is a bit hard, because IBM linked it against the PC-DOS version of Microsoft’s FORMAT module. We need to link it against the MS-DOS version of Microsoft’s FORMAT module, so we must extract the OEM module from PC-DOS’ FORMAT.COM first. Once that is done, we can then link it against Microsoft’s FORMAT module to produce FORMAT.COM for MS-DOS.

Now we have all OEM components ready, it is time to put together a generic PC-compatible version of MS-DOS 1.25. Since a lot of OEMs distributed Microsoft’s development utilities with MS-DOS, we can assume MS-DOS 1.25 should have 2 disks, one with MS-DOS and the other with development utilities. We then add the DOS BIOS, DOS kernel and all standalone components from Microsoft’s OAK to the first disk, and Microsoft’s development utilities to the second disk. And… we’re all done!

311-2-MS-DOS-1.25-Demo-01.png

311-3-MS-DOS-1.25-Demo-02.png

311-4-MS-DOS-1.25-Demo-03.png

311-5-Generic-MS-DOS-1.25.zip

标签: DOS, MS-DOS, PC-DOS