On Mon, 30 Apr 2012 15:30:42 -0700 (PDT), Gerph <
ge...@gerph.org>
wrote:
> the new set state indicates that the application/API/whatever
> understands a newer state of affairs.
Workable, yes. ;-)
> I like the way you're telling a guy that works at ARM outright what
> you can't do.
It's called being audacious. Or maybe being a prick. Your choice. The
thing that worries me is that it seems that behaviour of unaligned
loads seems to change not only depending upon processor family, but
also upon implementation (if I read the ARM ARM correctly, the memory
system is as much of an influence as the processor itself?). I fear
this could lead to a heck of a lot of baggage in sorting out what
went wrong, what sort of ARM device it is, and then what to do about
it.
> indicates that you want unaligned loads to abort and you fix them up
> to behave in the manner that the currently active context expects
Indeed, my suggestion was to trap aborts - it is pretty much
impossible to modify the program (it isn't safe to poke in a branch
to a special handler on top of LDRs as it may screw up R14, etc), and
a full blown emulation is silly when it's an ARM pretending to be an
ARM, why? Why!? So waiting for an abort is the only logical option.
Though, it is worth asking if different ARMs/MMUs handle things the
same way if they *don't* abort? It seems we're straying into the
realms of "implementation defined" here.
> The use of unaligned operations will be the exception, not the norm,
> and so you can trust that the speed won't be too cripplingly hit by
I'm not sure - I recall reading that one of ROOL's compiler mods was
to provide a command line option to specify if unaligned accesses
were to be used, or not, and to make not the default.
This implies at one stage the compiler may well have used unaligned.
For what, to pack structs to remove padding wastage? This is
speculation, compiled code doesn't read well. ;-) But something must
have done it at some point to lead to that alteration.
> No faffing with scanning code. No trapping of all memory accesses.
No
> full scale emulation. You're only hooking into the abort handling
code
> that already exists to fix up other cases, so a lot of your
framework
That's the most logical approach, certainly.
> Uh... It's a question that has no relevance to the issue of handling
> alignment issues, surely ?
Could you have patched up RISC OS to work in a 32 bit world with only
the binary to work with? It's a lot more involved than simply getting
rid of the 'S' and '^' (I'll leave you to reply with your favourite
horror story...). If the sources are available (and, with due
consideration to getting them to actually build a working product),
updating a program will become a lot more viable. It might be a
compiler flag, it might be a newer library, it might be stepping
through a lot of badly commented assembler. Each case is different.
You know, I think it would be cool to run Zarch on newer hardware. My
first memory of RISC OS was plugging in my A3000 and firing up
!Lander. I would be willing to have a crack at making it compatible
with modern kit. I can imagine it'd be painful, it's from the days
when it was normal to nuke the caches and RMKill everything in sight.
But I think it'd be a nice introduction to something like the
RaspberryPi. It is simple yet rather addictive. But from a binary? No
thanks!
Best wishes,
Rick.