Welcome, Guest. Please login or register.

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

Description:

0 Members and 1 Guest are viewing this topic.

Offline takemehomegrandma

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2990
    • Show all replies
Re: Is It Emulation or Not -- the Dilemma
« on: October 15, 2012, 11:14:05 AM »
Quote from: danbeaver;711325
OK,

Here is the thread, so go at it: When you run software written for one computer (let us say an Amiga) on another computer (for instance a PC, MAC, or DEC PDP 11/40), what is it?


Depends.

If you run software written for Amiga on a Mac using MorphOS, which provides the complete Amiga environment and API's (minus Amiga custom chips etc) fully native on the Mac hardware, then it's not emulation, the software is being run native. The Amiga apps are scheduled by the same scheduler as those compiled directly for MorphOS, they all share the same resources, the same memory space, the same signalling system. There is no difference from an Amiga program and a MorphOS program in the way they are treated/handled, they all have full access to everything, they are both running directly on top of the OS (no layer in between), which is running directly on top of the HW. Everything is fully native!

If you run the Amiga software on a Mac using UAE sitting on top of the native environment, then it will run boxed in an emulated environment. UAE is software that tries to mimic the Amiga hardware, and the Amiga applications are then executed by that piece of SW inside its own box, shielded from the native system that lies underneath it.

On MorphOS you generally don't need to use emulators to run Amiga software. Games/apps that access Amiga custom chips directly (instead of going through the OS) will not run without an emulator like UAE though.

Quote from: desiv;711335
So, by "natively," you mean PPC opcodes only running on a PPC system.
Yep, that's native.
68k opcodes running on a PPC?  There's some level of emulation.


PPC opcodes running on a PPC system, is running native.

If you have a 68k program and you recompile it into being PPC instead, then you will have PPC opcodes running on a PPC system, fully native.

Both the above is how MorphOS does it. In other words, fully native.

If you on the other hand constructs a piece of program with the aim to mimic a physical 68k CPU through SW and run 68k opcodes using that, then you would have emulation. Just like a real CPU, it would have a Program Counter pointing to the next in line 68k opcode to be executed, it would have routines to deal with that opcode and all the others (instruction set), it would have the D0-D7 data registers and the A0-A6 address registers to be used by these opcodes, it would have the status register (signalling "overflow", etc), and it would have a chunk of "system RAM" allocated in a box where the 68k application(s) and their data resides, that this "CPU" can access. When one opcode is executed, registers are altered, "system RAM" is altered, the Program Counter in this "virtual CPU" increases to point to the next opcode in line. Since it's the 68k opcodes (unchanged) that are actually being executed, by a program that simulates a physical 68k CPU, it is emulation. The emulator itself would run native on the system, but the 68k code inside it would be emulated.

:)
MorphOS is Amiga done right! :)
 

Offline takemehomegrandma

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2990
    • Show all replies
Re: Is It Emulation or Not -- the Dilemma
« Reply #1 on: October 15, 2012, 06:31:41 PM »
Quote from: OlafS3;711544
From the view of a user it is not so important if it runs "emulated" (UAE) or native. UAE running on modern hardware is pretty fast and you do not have any problems regarding speed. Of course is the integration of 68k in MorphOS (and AmigaOS) a nice thing because you can mix 68k and PowerPC (and add f.e. Arexx what is not possible when running 68k as sandbox). On the other hand it is not possible outside PPC so it is difficult to change the platform and you have to stay on PPC forever. So both concepts have advantage and disadvantages.


Well, when all applications are running fully native (both Amiga and MorphOS), driven by the same scheduler, sharing the same memory space and system resources, then you can use tools like Snoopium for instance, data can be shared, and you can have various apps collaborating and working together (ARexx for instance) in a way that is not possible when running the Amiga apps under emulation.  

Running the 68k Amiga apps in an emulation sandbox like UAE is faster and easier to implement than having it native though, and UAE emulates the entire Amiga HW which makes it possible to run old apps and games that aren't really system friendly. It's not quite the same though, it's more like having two parallel systems in one.

However, when MorphOS migrates away from the PPC and maybe starts implementing none-Amiga features like true SMP, true MP, true 64-bit, etc, then this approach will probably the the only way.

:)
MorphOS is Amiga done right! :)
 

Offline takemehomegrandma

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2990
    • Show all replies
Re: Is It Emulation or Not -- the Dilemma
« Reply #2 on: October 15, 2012, 06:34:16 PM »
Quote from: desiv;711556
er..  OK..  Not sure why anyone would ever do that ..  But thanks for that... :crazy:


Why? Because you for some reason would want to recreate a working model of some hardware using software. Emulation! In this case some kind of a "virtual" 68k CPU.

Quote
Obviously, if the option is available to re-compile, that's great.  But it's frequently not the option.


That is de-facto what MorphOS does before running an Amiga 68k app (or dynamically while running). Not from sources obviously, but from binaries. No 68k opcodes are being executed, they are all PPC native, running natively on the OS, which runs native on the HW.

Quote
However, the question about the different emulation layers in MorphOS has been answered already here..


Indeed, if you want to explore the joys of emulation in MorphOS, you have numerous options; like UAE, C64, Sega systems, MAME, etc, etc.

However, if you just want to run none-HW-banging Amiga apps on MorphOS, then there is no need for emulation.

:)
MorphOS is Amiga done right! :)
 

Offline takemehomegrandma

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2990
    • Show all replies
Re: Is It Emulation or Not -- the Dilemma
« Reply #3 on: October 15, 2012, 06:34:57 PM »
@danbeaver

Somehow I just *knew* that someone would boil the "emulation" issue down to trade marks! :lol:

"If programs are running on an Amiga(TM) gear, it's 'native', if not, it's 'emulated'." :insane:

:lol:
MorphOS is Amiga done right! :)
 

Offline takemehomegrandma

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2990
    • Show all replies
Re: Is It Emulation or Not -- the Dilemma
« Reply #4 on: October 16, 2012, 01:30:42 AM »
Quote from: Iggy;711597
The only time MorphOS is not using emulation is when its running all native code.


Iggy,

1) Reimplementation != Emulation.

What MorphOS does, is reimplementing the whole Amiga API *natively* on HW that isn't Amiga HW. No need for emulation there. As Itix said, you don't need an emulator to run Windows on Linux through WINE (Wine Is Not an Emulator).  It's the same thing here, MorphOS provides its own native Amiga API environment.

2) Recompiling/translating programs != Simulating HW through SW/Emulation.

Big and important difference there.

The 68k Amiga programs are fully translated into native PPC code (which involves more than some 1to1 opcode conversion, it's a lot more complex, programs are de-facto rewritten). Sure, many emulators use opcode translation as part of the package, but that is only one component, and that component isn't emulation although part of an emulator, it's a translator (either JIT or runtime). Emulation is to mimic HW using SW, perhaps with accompanying SW (like ROM's, etc) to make it "run". Recompilation/translation is a different matter, and calling this "it's only about semantics" is to call the difference between apple and oranges "semantic" as well.

3) There is no difference between Amiga programs and what you call "native code on MorphOS", it's *all* equally native when executed, it's all using the native system API, it's all sharing the system resources, all libs, all devices (heck, those devices and libraries could even be "68k"), it's all sharing the messaging system, the scheduler, the memory, there is no difference whatsoever, no "box", no "layer", no emulated hardware. Everything executed is PPC, everything is treated the same, everything is using the same native OS, running natively on the HW. On MorphOS, Amiga applications = MorphOS applications. No difference!

This whole thread stems from another discussion, in which someone said: "MorphOS runs 68k code in an emulation layer just like AROS". This is where this discussion comes from. And it's not true at all.

4) The only time MorphOS *is* using emulation, is when you use UAE to emulate an Amiga (or C64, or whatever). MorphOS itself doesn't emulate an Amiga, it reimplements it at an OS level, providing its own, fully native API environment, and all Amiga/MorphOS applications use that directly, and in exactly the same way; as PPC binaries.
MorphOS is Amiga done right! :)
 

Offline takemehomegrandma

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2990
    • Show all replies
Re: Is It Emulation or Not -- the Dilemma
« Reply #5 on: October 16, 2012, 10:04:42 AM »
Quote from: Iggy;711642
After all, you translating non-native code to PPC instructions.


The "non-native" code (as you choose to put it) is actually built to utilize the native API that is MorphOS (even if the program was compiled in 1995 when MorphOS didn't even exist), the only thing happening prior to execution (no 68k opcodes are being executed, there simply is no emulator present for doing that), is changing its opcode stream into another format which is more like recompiling SW than running a program that mimics HW in SW and having your apps run by that program, inside its emulated box. These are two separate things, and only the first is happening!

Rebuilding one piece of SW into a different piece of SW (that does the same thing, using the same native Amiga API's, but by using a new set of opcodes), is per definition not the same thing as trying mimic HW through a SW emulator. I don't understand why some people are so keen on mixing these two concepts together? Is it because opcode translators can be a component of an emulator package that they get confused?

MorphOS does not emulate an Amiga, it re-implements it, and Trance does not really emulate a 68k CPU, it eliminates the need of one, by recompiling the 68k opcode streams into native PPC ones that can be executed natively on the native OS running natively on the HW, just like any other PPC code running on the OS, with no difference whatsoever. Had an 68k emulator been in MorphOS (which the OS doesn't have), a "virtual CPU" so to say, it would be something in the lines of the bottom paragraphs in post 60, and then it could only happen if it's run on top of the OS inside an extra "emulation box" of its own and all 68k apps running inside that box (kind of like in UAE), because otherwise it would be like a multi-CPU system and that can't really happen in an good/easy way on Amiga, only in a way similar to PowerUP or AMP, which is kind of ugly. And it's not there in MorphOS anyway. On MorphOS, all applications are run as PPC, sharing the same memory space, the same system resources, the same scheduler, etc. They are all the same.

Trance is not a 68k emulator, it's a 68k eliminator...
MorphOS is Amiga done right! :)
 

Offline takemehomegrandma

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2990
    • Show all replies
Re: Is It Emulation or Not -- the Dilemma
« Reply #6 on: October 16, 2012, 11:13:30 AM »
Quote from: danbeaver;711682
Quote from: itix;711680
Quote from: danbeaver;711585
Thank you, you have finally agreed with us!  MorphOS is an emulation layer allowing Amiga software to run on non-Amiga hardware.
Wrong. It has a compatibility layer to run Amiga software natively.
Yes you could call the emulation code a "compatibility layer;" works fine for me

I think a more correct description of "compatibility layer" would be something in the lines of: "A fully native, fully binary-compatible re-implementation of the full AmigaOS 3.1 API with extensions/additions like CGX, MUI, AHI, etc".

In other words: MorphOS.

:lol:
« Last Edit: October 16, 2012, 11:50:59 AM by takemehomegrandma »
MorphOS is Amiga done right! :)
 

Offline takemehomegrandma

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 2990
    • Show all replies
Re: Is It Emulation or Not -- the Dilemma
« Reply #7 on: October 16, 2012, 11:30:33 AM »
Quote from: OlafS3;711688
@takemehomegrandma

What a surprise... MorphOS? :-)


:)
MorphOS is Amiga done right! :)