TONT 31073 在 x86 系统上使用尤达大师(Yoda)可能对您系统的健康有害

原文地址:https://devblogs.microsoft.com/oldnewthing/20060525-04/?p=31073

In former times very cross-platform NTVDM was. If you view NTVDM.EXE in a hex editor, you’ll find the message “Using Yoda on an x86 may be hazardous to your systems’ health” buried inside it.

很久以前,NTVDM 的跨平台程度是非常高的。如果你在十六进制编辑器里查看 NTVDM.EXE 的内容,你会看到里面藏着这么一句话:“在 x86 系统上使用尤达大师可能对您系统的健康有害”。

Yoda was the name of the internal debugger that was used to debug the MS-DOS emulator, also known as the Virtual DOS Machine or VDM. (Buried inside the Yoda source code are such wonderful variables as “luke” and “chewy”.)

Yoda 是用来调试 MS-DOS 模拟器的内部调试器的名字,MS-DOS 模拟器又称作 DOS 虚拟机(VDM)。(在 Yoda 的源代码里还深藏着其它妙妙的变量名,比如 luke 和 chewy(译注:都是《星球大战》梗))。

The Intel 80386 has a mode known as “Virtual-8086 mode” or just “V86 mode” wherein the CPU ran as if it were an 8086, except that if the program did anything interesting like issue a privileged instruction, call a software interrupt, or fault, control would return to the protected-mode supervisor for handling. (Win386 used this same CPU mode to support multiple MS-DOS sessions.)

Intel 80386 处理器有个“虚拟 8086 模式”(或者简称为 V86 模式),在此模式下,CPU 将按照 8086(实模式)的方式运行,不过只要有程序试图执行如特权指令、软件中断或出错之类的行为,就会返回到保护模式的管理之下来处理这一切。(Win386 也使用这一 CPU 模式来支援多个 MS-DOS 会话。)

When running on an 80386-class processor, NTVDM used this mode to do its emulation, making the CPU do the heavy lifting of decoding instructions and emulating them, which took place at very close to full speed. On the other hand, NTVDM on the non-x86 processors (Alpha, PPC, MIPS, etc.) had to implement an entire 8086 emulator, with all the decoding and execution performed in software. Yoda was the debugger you used if you needed to debug the emulator.

当运行在 80386 级的处理器上时,NTVDM 使用虚拟 8086 模式来进行模拟工作,让 CPU 来承担解码指令、模拟行为之类的繁重工作,并且基本上可以全速运行。但另一方面,在非 x86 处理器上(如 Alpha、PPC、MIPS 等等)就要实现一整个 8086 模拟器,对指令的解码和执行工作完全依赖软件模拟。Yoda 就是那个用来调试这个模拟器的调试器。

And that’s why NTVDM has a message warning you not to use Yoda on an x86. Because on an x86, there is no instruction emulator. There is nothing to debug.

这就是为什么 NTVDM 里有一条警告不要在 x86 系统上使用 Yoda 的原因——在 x86 系统上并没有一个 x86 指令模拟器的存在,么得调试工作可做。

(My thanks to Andrew McLaren and Tony Gaston for providing historical background.)

(感谢 Andrew McLaren 和 Tony Gaston 提供历史背景信息。)

注:请不要在评论内容的任何位置出现链接,否则您的评论将被自动移入回收站,且永远不会被复审。

Please do not put any link anywhere in your comment, or it will be automatically deleted and never be reviewed.

1 条评论

  1. 超级想吐嘈英语语系是不是早就完蛋了,词荒也太严重了,啥玩意都叫虚拟机(Virtual Machine),DOS虚环境叫DOS虚拟机,JAVA环境叫JAVA虚拟机,Apache子站叫虚拟机,Docker容器也叫虚拟机。

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注