platon42 wrote:
@jdiffend:
Sorry to interfere, but I'd suggest you check Harry 'Piru' Sintonens background and references before you continue to doubt the things he says. I suppose only a hand full of people (if any) know more about the amiga internals than Piru.
Nobody is infallable and it's pretty obviouse he favors some CPU besides the Coldfire.
Piru has obviously done a lot with the miggy from some of the posts I've read elsewhere but I disagree with him for a reason. I spent a lot of time looking at what would be required to do this.
FWIW, I have a background with the Amiga, software engineering, embedded systems and hardware. My opinions are based on experience and research.
And no, there is *no* way to find out if a word in a data or code section is code or data -- other than doing a full CPU emulation and stepping through the code that's reached (and still this will not yield the sections that contain dead or exceptional code). Though there are code and data hunks in an executable, nothing ever has prevented a coder to mix the contents at his will.
It was a simplistic cheap shot but it has some bearing on the discussion even if it wasn't totally valid.
Yes it's true you can have data in code segments. You can also put code in data segments if you really want. Since you are scanning code blocks it's more likely to accidently patch what you think is one instruction but is actually a combination of two others.
That's the possibilities. However, reality has a few things in our favor so you don't have to identify it as code or data. This has more to do with odds of failure than possibility it will fail. It will always be possible for a patcher to fail.
Remember, I'm also talking specificly about the math instructions that are legal but with different behavior. Also remember than not all math instructions will need to be patched. Trappable instructions don't need patched. Those conditions mean there are a pretty limited number instructions that may need patched to begin with.
This also has a lot to do with the general nature of code and data. If you look through a data segment you'll see a lot of zeros, $ff, $0f... stuff like that at random intervals. The odds of a data pattern in a code block matching one of the math instructions in a legal manner is very low but certainly possible.
The odds of it being followed by data matching a legal branch on condition code instruction (the conditions where it actually needs patched) is even lower.
If you decode a couple more instructions in the sequence to see if they are legal then the odds of failure are lower still.
If you look through the bytes making up a progrom you will also notice that you may find instructions made up from part of the bytes of two instructions. However, it's usually soon followed by an illegal instruction as well. You will also notice frequently used sequences of bytes. Since compiler output is pretty consistant it should make it easier to identify safely patchable sequences of code. Assembly would be less predictable and may suffer a higher failure rate.
Code in a data segment will cause this to fail. If a game loads in some code specific to a level as data or from a data file it would never be patched. But then I said games would be a problem.
This kind of patcher isn't about making ALL software work, it's about making the MOST software work for the least effort. The more intelligence you add to the patcher the more reliable it will be.
And also with my own technical background, I don't see how a ColdFire board could ever *work* (regardless of the performance) without full CPU emulation, especially regarding those non-compatible instructions with different behaviour or side-effects, that cannot be trapped and then emulated on the fly.
I never said you wouldn't need full emulation for some software. Games will probably require it since many have compatibility issues anyway.
The instructions that can't be trapped but have different behavior are exactly what I was talking about patching.
My conclusion is: The Dragon is never going to work in an amiga system, or, if it does, it would be using full CPU emulation (possibly with JIT?*), and hence, unbearably slow -- much slower than an MC68060/040.
I'm commenting strictly on the feasability of using the Colfire 4e attached to an Amiga... not on the Dragon itself. That gets into design specific details and I have no technical info on the Dragon.
Full emulation without JIT would be slow but remember, you don't have to emulate hardware as well as the CPU and OS calls would be native. JIT would be fast enough to run the real problem software like games which usually required a 68000 or 68ec020.
The emulator would *not* be needed for most software outside of games if someone spent any amount of time working on the patcher.
* I don't think Elbox has technically enough skilled people to write something like a JIT compiler.
That would not surprise me but I don't have any relationship with them so I can't say.
Without any real details about their hardware I wouldn't even want to guess.