new link list

2011-02-22 Thread mohit verma
hi all,
 i want to create a new link list of data structures( define by me) in
kernel space. for that what are the essential steps to make this link list
known to kernel??

thanks in advance :)
-- 

*MOHIT VERMA*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: new link list

2011-02-22 Thread mohit verma
thanks a lot javier

On Tue, Feb 22, 2011 at 8:00 PM, Javier Martinez Canillas 
martinez.jav...@gmail.com wrote:

 On Tue, Feb 22, 2011 at 1:08 PM, mohit verma mohit89m...@gmail.com
 wrote:
  hi all,
   i want to create a new link list of data structures( define by me) in
  kernel space. for that what are the essential steps to make this link
 list
  known to kernel??
 

 I don't know if I got it right. But if what you want is to create a
 linked list for your data structures, you have to use the kernel
 linked list API.

 A good explanation about how is implemented and how to use it is in
 the kernel newbies website.

 http://kernelnewbies.org/FAQ/LinkedLists

 Also the Linux Device Drivers 3 book has an excelent section that
 covers the linked list API

 http://www.makelinux.net/ldd3/chp-11-sect-5.shtml

 You can look at the complete API in the kernel.org website

 http://www.kernel.org/doc/htmldocs/kernel-api/adt.html#id484623

 Best regards,

 --
 -
 Javier Martínez Canillas
 (+34) 682 39 81 69
 PhD Student in High Performance Computing
 Computer Architecture and Operating System Department (CAOS)
 Universitat Autònoma de Barcelona
 Barcelona, Spain




-- 

*MOHIT VERMA*
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: new link list

2011-02-22 Thread Javier Martinez Canillas
 if i  add a new system call and define a new link list in that and some
 kernel function want to access that list
 is it possible for that kernel code to make use of this?


Since the Linux kernel is monolithic, all kernel code is in the same
memory address space. So it will depend of the scope of your
variables.
For example if your structure is global, it will be accesible from any
place in the kernel.

 actually i am making changes 2 side : one introducing a new kernel function
 and that kernel function has to use the link list created by the system call
 which i make in system call code.


Generally is not a good idea to introduce a new system call. You have
to make changes in many places an recompile the kernel to make it
work. It is better to use netlink or other mechanism to communicate
kernel and userspace.

 how can i intigrate them so that the things become easier?

 any further help is appreciable , javier. :)


I still don't know your context but a common approach is to create a
kernel module that has both your data structures (linked list) and
some way export that data to userspace (netlink sockets, sysfs,
procfs, virtual devices, etc)


-- 
-
Javier Martínez Canillas
(+34) 682 39 81 69
PhD Student in High Performance Computing
Computer Architecture and Operating System Department (CAOS)
Universitat Autònoma de Barcelona
Barcelona, Spain

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