Re: Iterating through all the processes in a module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2012/2/22 Ezequiel García <elezegarcia@xxxxxxxxx>:
> Hi Arokux,
>
> On 2/22/12, Arokux B. <arokux@xxxxxxxxx> wrote:
>> Having my code as a module I can trigger its execution (load a module)
>> and disable it (unload a module). How can I achieve this if the code
>> is inside the kernel? One possibility I see is adding an entry in the
>> procfs.
>
> I think you want to have the kernel execute some code of yours just for learning
> purposes right?
> So, your question could be put like this:
> Where are the "doors" for me -userspace- to enter to the kernel?
>
> In that case, I believe the "canonical" answer is: system calls.
> If you have a copy of Love's book you could look there, or you could
> just search through the
> code and look how system calls are implemented and add own of your own.
> Perhaps you could even modify one. You can search all syscalls definitions with:
>
> grep "SYSCALL_DEFINE" `find . -name "*.c"`
>
> Actually, that's the path I would take if I were to try this. You can
> pick a simple syscall
> like "getcwd", defined in fs/dcache.c and just add my test code there. That way
> every time you call pwd in your shell, you get your code called (you
> can check with
> strace).
>
> Hope this helps,
> Ezequiel.
>

This is also a good summary of Kernel space / User space interfaces

http://people.ee.ethz.ch/~arkeller/linux/kernel_user_space_howto.html

Hope it helps,

-- 
Javier Martínez Canillas
(+34) 682 39 81 69
Barcelona, Spain

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux