Calling function from address

Micha M. kernelnewbies at mail.i88.de
Wed Jun 8 06:50:57 EDT 2011


On Wed, Jun 08, 2011 at 04:52:14PM +0700, Mulyadi Santosa wrote:
> On Wed, Jun 8, 2011 at 03:47, Micha M. <kernelnewbies at mail.i88.de> wrote:
> > Hi!
> >
> >
> > Is it possible to call a function that is somewere in the physical-address
> > space? So I'd like to jump to a certain physical address, execute the code
> > there and then return to my kernel module.
> > I already tried to ioremap that address and cast the new address to a
> > funtion pointer and then call the function, but there where some page
> > faults.
> 
> Interesting, and after page fault....the code is still not executed?
> 
> what code(s) do you call? user mode? kernel mode?

I don't think that the code was executed. There was a kernel Ooops direct
after the page fault and a register dump was printed. The code I what to
call is located in ROM and is mapped to the physical address space. 
Is it possible to configure the kernel to ignore certain address areas and
allow calls to that space?

And that code needs to be executed from that place, since it contains
pointer in the physical address space. (s oremapping won't work because
there are absolute jumps in that function I'd like to call)

The only solution I kan think of at the moment is to solve it somehow in
assembly. But I don't know how...


regards,

#micha

-- 
/* To err is human; to really fuck things up requires the root password */



More information about the Kernelnewbies mailing list