Page 1 of 1

Module usage after loading problem

Posted: Sun May 18, 2008 12:25 pm
by piranha
I have a module loader function, and a test module (hard drive function).
It sets a syscall to a function inside the module and exits. I call the syscall from the main kernel function after the module is loaded, and it calls the correct address (I think) but then it pagefaults, even when the syscall handler has nothing but a for(;;); function.

I looked at the page fault EIP and:
It calls: 0xC0185089
The EIP of the pagefault is: 0xC087FFC9.

The part of actually calling the syscall has the correct address.
The modules is set in mapped memory (with kmalloc()), and is initialized.
The message says "Calling..." and then nothing happens for a second, and then it pagefaults.
And, the the module is loaded to a specific address and the syscall register takes that offset into accout.
I have been trying things for a month, and it don't seem to work.

Can you help?
-JL

Posted: Mon May 19, 2008 1:49 am
by JamesM
Have you memory dumped the starting EIP to check that there's actually valid instructions there, and not junk?

Posted: Mon May 19, 2008 4:40 am
by thepowersgang
The problem may be that there is a loop that is overrunning a buffer, hence the delay before the PF. Not meaning to sound patronizing, but have you tried placing a print call at the beginning of the module code?

Posted: Mon May 19, 2008 7:36 pm
by piranha
During the loading call?
I know that works, I've tested it several times.

It's when I do something with the module after I load it that it dies.

-JL