0

Writing emulators has always fascinated me. Now I want to write an emulator for an IBM PC and run MS-DOS on it (I've got the floppy image files).

I have good experience in C++ and C and basic knowledge of assembler and the architecture of a CPU. I also know that there are thousands of emulators out there doing exactly what I want to do, but I'd be doing this for pure joy only.

  • How much work do I have to expect? (If my goal is to boot DOS and create a text file with it, all emulated)

  • What CPU should I emulate ? Where can I find documentation on how the machine code is organized and which opcodes mean what, so I can unpack and execute them correctly with my emulator?

  • Does MS-DOS still run on the newest generations of processors? Would it theoretically be able to natively run on a 64-bit AMD Phenom 2 processor w/ a modern mainboard, HDD, RAM, etc.?

  • What else, besides emulating the CPU, could be an important factor (in terms of difficulty)? I would only aim for outputting / inputting text to the system via the host system's console, no sound or other more advanced IO etc.

  • Have you written an emulator yet? What was your first one for? How hard was it? Do you have any special tips for me?

Thanks in advance

4

2 回答 2

2

要知道你的模拟器需要什么来运行 DOS,我认为最好的地方是转向重新实现 DOS 克隆的FreeDOS项目。通过研究源代码,您应该能够提出需求列表。

关于操作码,您可以查阅X86 Opcode and Instruction Reference或 Intel 文档。您还应该考虑使用最新的处理器功能进行虚拟化。

DOS 应该仍然能够启动现代 PC,但可能无法使用大部分硬件(由于缺少驱动程序,或“操作系统”的固有限制)。

如果你想完全模拟一台能够运行 MS-DOS(或克隆)的 PC,我认为你必须:

  • 解码和解释操作码
  • 模拟内存控制器
  • 模拟 BIOS 和 VGA BIOS
  • 实现所需的 BIOS 系统调用

免责声明:我没有写模拟器。

于 2011-01-03T12:39:19.493 回答
-2

由于 MSDOS 是纯 16 位代码,它不能在本机的 64 位处理器上运行。

于 2011-01-03T13:26:42.723 回答