Welcome, Guest. Please login or register.

Author Topic: Is It Emulation or Not -- the Dilemma  (Read 14838 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Is It Emulation or Not -- the Dilemma
« on: October 15, 2012, 10:48:58 PM »
Quote from: itix;711379
Correction: ShapeShifter doesnt emulate Mac OS. It only emulates run time environment for Mac OS so it thinks it is running on a real Mac.

It should be possible re-implement Mac OS API on Amiga and run Mac OS binaries without emulation.


Shapeshifter is an interesting case. Back in the day, we called it an emulator because it "emulated" another system but in hindsight, it wasn't that clear cut. In today's parlance, I guess it could be viewed as an example of paravirtualization. Both the guest and host OS is patched in places by shapeshifter in order to make things work, but beyond intercepting traps, hardware calls and some patched guest OS functions, the binary code for both the MacOS and the executables running on it are basically running "natively" on the 68K processor in the Amiga.

If said patching were not necessary, then it would be straightforward virtualization.
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Is It Emulation or Not -- the Dilemma
« Reply #1 on: October 16, 2012, 11:52:59 PM »
Reading over the recent posts, I always thought Trance under MorphOS was a hotspot* JIT emulation?

*That is to say, 68K opcodes are executed by an interpretive emulator for code that is not compute bound or needs to react with minimal latency (eg interrupts and the like) and that internal profiling reveals those sections of code which require dynamic recompilation?

Or is all 68K code (re)compiled to PPC and cached as it is encountered rather than just performance critical code?
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Is It Emulation or Not -- the Dilemma
« Reply #2 on: October 17, 2012, 12:06:30 AM »
Quote from: itix;711684
Good point. As I have understood the definition, a paravirtualization requires support from the guest OS. But there is not much emulation either -- on the other hand MacOS binaries are not executed natively in AmigaOS.


Shapeshifter had to patch the host OS to remap the lower 4K but I seem to recall it also patched some parts of the guest OS, depending on the ROM versions in use (I could be wrong about that, it's been a long time) and certain ROM versions wouldn't work well or at all.

Quote
On my XP I have got AROS on Virtual PC and Linux on VMware. Neither systems are emulated but I am not running Linux or AROS executables natively on XP either. After all Shapeshifter is not very far away from a virtual machine.


Such virtualization is basically a "new" term for an idea that's been around for a long time. Certainly IBM had it many decades ago. Popek and Goldberg identified the minimal requirements for hardware that could be "virtualized" through the strict separation of instructions into those that are purely user mode and those that can alter sensitive parts of the processor. We were lucky, the vanilla 68000 was close, but the move to/from SR being unprivileged was the killer there. That was fixed in the 68010, along with the ability to relocate the VBR. Those features allow you to write traps for pretty much anything privileged and trick an entire OS into thinking it's running on something it isn't.
int p; // A