Welcome, Guest. Please login or register.

Author Topic: Coldfire - Binary Compatible  (Read 21673 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline shoggoth

  • Full Member
  • ***
  • Join Date: Dec 2004
  • Posts: 223
    • Show all replies
Re: Coldfire - Binary Compatible
« on: February 01, 2008, 09:24:27 AM »
Perfect 68k compatibility on a ColdFire-machine won't happen, though question is if it's possible to make things compatible enough for a certain type of user. On the Atari platform, people are experimenting with running TOS and FreeMiNT on ColdFire evaluation boards.

Link: http://pagesperso-orange.fr/didierm/ct60/ctpci.htm

So far, success is limited to booting a (very) simple OS installation with a few applications running. He's using CF68KLib to get things running to a certain degree. The MyAES GUI runs natively on the ColdFire (not shown on the page though). Even though this setup is extremely limited, I'd like to view it as a proof of concept.

A ColdFire-based system would have to deal with the following scenarios:

1. Applications which work right away
 
2. Applications which doesn't work, but can be recompiled or patched

3. Applications which can't be patched and won't work

4. Games and stuff

The first case (1) is covered just by implementing CF68KLib in the system. Performance range from really fast to so-so depending on the use of unimplemented instructions. The second (2) case is dealt with by recompiling applications, manually patching stuff, or using PortASM (to a certain degree, at least).

The third case (3) is covered by a fallback approach. If everything else fails - you emulate the whole CPU for that particular process. I've personally done some experiments with this based on the CPU-emulator from CaSTaway, and while the raw processing performance is pretty bad (~8-16Mhz 68000 on a 100Mhz 68060), all OS functions etc. runs natively at full speed, giving the impression of a much faster machine. In some cases it was even difficult to spot the difference in performance between a "native" and "emulated" process. Also, in practice, an emulated process doesn't steal much CPU time from the rest of the system, since applications tend to spend most of their time waiting for input etc (and thus releases control to the OS, effecitvely pausing the emulation).

The last case (4) needs complete emulation of the whole system. CaSTaway runs at between 50-200% relative performance (8Mhz Atari ST) on a 100Mhz 68060. It doesn't offer perfect compatibility (well, and atm it usually hangs the system after a while), but again - it's a proof of concept. I know the Amiga is much trickier to emulate though.

I've ordered a ColdFire EVB myself and hope to get some "real" numbers later on.

I imagine a ColdFire clone could be successful for a certain type of user (like me - using coding GCC, ICQ, IRC, simple browsing, listening to MP3:s etc.), but users looking for games and demo compatibility should probably look at emulators instead.
 

Offline shoggoth

  • Full Member
  • ***
  • Join Date: Dec 2004
  • Posts: 223
    • Show all replies
Re: Coldfire - Binary Compatible
« Reply #1 on: February 02, 2008, 07:34:49 AM »
Quote

Donar wrote:
Quote
I don't understand the question. The coldfire is not suitable to the amiga...

The Coldfire can behave like an 680x0 without MMU and FPU, if you build the right CF68klib from MicroAPL which then sets up a Virtual Machine on the CF. At least that is what the CF68klib manual says.


Almost. Some instructions cannot be emulated, since they behave differently in the ColdFire. That's what the CF68klib manual says.

Quote

Problem would be:
Getting the CF on the Amiga Bus.
I think you need an MMU for setting this kind of extension up.
No FPU support.


You don't need an MMU to get the CF68klib up and running. It uses the illegal instruction vector to implement missing instructions.
 

Offline shoggoth

  • Full Member
  • ***
  • Join Date: Dec 2004
  • Posts: 223
    • Show all replies
Re: Coldfire - Binary Compatible
« Reply #2 on: February 03, 2008, 12:47:36 AM »
Quote

If i read page 10 onward of the manual correctly, which is about "Supervisor mode", that is only true for a CF68klib build for "User mode" :-P


Donar, had you read the documentation properly you'll also know that not all instructions can be trapped and emulated. :-P :-P :-P :-P :-P

Read the ColdFire reference documentation and/or chapter 5 in the CF68KLib docs.

Quote

I was told that you need the MMU for setting up an expansion card for the Amiga with eg 68060 or CF. That's why i was nosy about having an MMU in the ChipSet.


Well, I don't know about that, but I do know that CF68klib in itself doesn't need an MMU to get up and running.
 

Offline shoggoth

  • Full Member
  • ***
  • Join Date: Dec 2004
  • Posts: 223
    • Show all replies
Re: Coldfire - Binary Compatible
« Reply #3 on: February 03, 2008, 12:54:47 AM »
Quote

No problems with the different supervisor mode model, as the 68k one is emulated. And as it is not mentioned otherwise (as it is on the paragraph about user mode) it seems that also the differently implemented CF/68k instructions return the proper result!?


CF68KLib can only emulate instructions which are trapped by the ColdFire. If the instruction in question doesn't cause and illegal instruction, it won't be trapped, hence not emulated. User Mode or Supervisor Mode library doesn't matter.

Are you a coder, Donar?
 

Offline shoggoth

  • Full Member
  • ***
  • Join Date: Dec 2004
  • Posts: 223
    • Show all replies
Re: Coldfire - Binary Compatible
« Reply #4 on: February 03, 2008, 10:32:46 AM »

Quote

I only find it strange that in the user mode paragraph it is mentioned explicitly that the differently implemented instructions will not work, and in the supervisor mode paragraph there is no word about it.


The user mode version only emulate the missing instructions. If you try to run your OS using this one, you'll get trouble not only due to the instructions that differ, but also due to the differences in the supervisor execution model. The supervisor mode version attempts to remedy the latter.

Quote

 It sounds like the library will set up an full 680x0 Emulator (without MMU/FPU) on the Coldfire but maybe i interprete in the text what i want to be true :lol:  
No, but i think i can read...  :-)


Well, no offence intended, but read the remainder of the document. That's just a section in the introduction chapter.

Having said that, I don't think you're necessarily on the wrong track. For full compatibility, you'll have to emulate every single instruction. That will be slow on a ColdFire. On the other hand, some apps may run perfectly using CF68KLib - or - can be patched or recompiled to do so. And they't  run fast.