All of lore.kernel.org
 help / color / mirror / Atom feed
* new link list
@ 2011-02-22 12:08 mohit verma
  2011-02-22 14:30 ` Javier Martinez Canillas
  0 siblings, 1 reply; 4+ messages in thread
From: mohit verma @ 2011-02-22 12:08 UTC (permalink / raw)
  To: kernelnewbies

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*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110222/e851750b/attachment.html 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* new link list
  2011-02-22 12:08 new link list mohit verma
@ 2011-02-22 14:30 ` Javier Martinez Canillas
  2011-02-22 14:36   ` mohit verma
  0 siblings, 1 reply; 4+ messages in thread
From: Javier Martinez Canillas @ 2011-02-22 14:30 UTC (permalink / raw)
  To: kernelnewbies

On Tue, Feb 22, 2011 at 1:08 PM, mohit verma <mohit89mlnc@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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* new link list
  2011-02-22 14:30 ` Javier Martinez Canillas
@ 2011-02-22 14:36   ` mohit verma
       [not found]     ` <AANLkTinGQhN7xVzt+7P1rKjVTp4wDXVQj48UD=t-EMwx@mail.gmail.com>
  0 siblings, 1 reply; 4+ messages in thread
From: mohit verma @ 2011-02-22 14:36 UTC (permalink / raw)
  To: kernelnewbies

thanks a lot javier

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

> On Tue, Feb 22, 2011 at 1:08 PM, mohit verma <mohit89mlnc@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*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110222/780a3abb/attachment.html 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* new link list
       [not found]     ` <AANLkTinGQhN7xVzt+7P1rKjVTp4wDXVQj48UD=t-EMwx@mail.gmail.com>
@ 2011-02-22 17:23       ` Javier Martinez Canillas
  0 siblings, 0 replies; 4+ messages in thread
From: Javier Martinez Canillas @ 2011-02-22 17:23 UTC (permalink / raw)
  To: kernelnewbies

> 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-22 17:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-22 12:08 new link list mohit verma
2011-02-22 14:30 ` Javier Martinez Canillas
2011-02-22 14:36   ` mohit verma
     [not found]     ` <AANLkTinGQhN7xVzt+7P1rKjVTp4wDXVQj48UD=t-EMwx@mail.gmail.com>
2011-02-22 17:23       ` Javier Martinez Canillas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.