← Back to context

Comment by nikanj

6 hours ago

” It is impressive to see Quake run at full speed knowing that Windows 95 runs DOS executable in a virtual machine. My guess is that, in full screen, memory writes and reads to the VGA are given direct access to the hardware to preserve performances”

Virtual x86 mode had little to do with what we nowadays think of when someone says ”virtual machine”

Arguably it had a great deal to do with what we think of as a "virtual machine."

Virtual 8086 remapped all opcodes and memory accesses to let a program pretend to be on a single, real-mode 8086 when in reality it was one of many programs running in protected mode on a newer chip

AMD-V and whatever the Intel counterpart is do the almost exactly the same thing: re-map all ia32 and amd64 instructions and memory accesses to let a program pretend to be doing ring 0 stuff on an x86 box, when in reality it is one of many programs running with fewer privileges on a newer chip

There are a few more wrinkles in the latter case -- nested page tables, TLB, etc -- but it is the same idea from the viewpoint of the guest.

Not entirely related but Quake had a VM though, executing scripts written in QuakeC[0] which would drive the AI, game events, etc.

[0]: https://en.wikipedia.org/wiki/QuakeC

  • But your link says that QuakeC was a compiled language

    • QuakeC was compiled into QuakeVM bytecode, which made all modes and logic portable between platforms without having to recompile things everytime, unlike what had to be done for Quake 2 (which was 100% native code).

      This hurt performance a bit but in the longer term benefited the modding scene massively.

    • It's compiled into bytecode, so it still requires a VM / bytecode interpreter (whatever you want to call it).