[maemo-developers] Java acceleration/Jazelle

From: pancake pancake at youterm.com
Date: Sun Jul 1 02:08:04 EEST 2007
On Sat, 30 Jun 2007 23:36:23 +0100
Simon Pickering <S.G.Pickering at bath.ac.uk> wrote:

> The next question is how to implement the undefined instruction 
> exception handler. Is 0x00000004 (or optionally 0xFFFF0004) writable (I 
> need to write some test code really) from a user program? Assuming it 
> is, then it should be reasonably straightforward to write an exception 
> handler and to use this to branch to some code to handle the 
> un-implemented Java instructions. If it's not possible to write to this 
> memory, how do programs like gdb hook exceptions? Have I missed some 
> unseen stumbling-block here?

GDB doesn't handles exceptions because they are mapped as signal at kernel
level. This is a posix abstraction. Unexpected ones are handled as
'Segmentation Fault'.

Exceptions must be handled at ring0. You should compile a new kernel.
No idea if is easy to do the same into a kernel module, but you can
directly write assembly in /dev/mem into the interrupt vector and
launch these new syscalls to trigger your snippets.

I have never hooked an exception on ARM or Linux, so I should probably
need to read more kernel :)

> I seem to remember seeing a list of those instructions that are handled 
> by the hardware, does anyone have a link? (though obviously writing a 
> piece of code to interate through and see which cause exceptions is 
> quite possible).

Take a look here:

  http://www.gelato.unsw.edu.au/lxr/source/arch/arm/mm/fault.c

  --pancake

More information about the maemo-developers mailing list