Re: Queries on USB skeleton Driver

2012-12-06 Thread Sannu K
On Fri, Dec 7, 2012 at 9:40 AM, sanchayan maity  wrote:
> Hello,
>
> I wanted to use the usb-skeleton driver for transferring data to a pen
> drive. I am using Ubuntu 12.04 with kernel version 3.2.0. I remove the
> usb-storage driver with rmmod and then inserted the skeleton module. The
> module is inserted successfully. On inserting the drive, usb-storage module
> gets automatically loaded.
>
> To avoid this, i tried blacklisting the module by including a blacklist
> entry in blacklist.conf  and rebooting. This didn't work either and
> usb-storage gets automatically loaded again.
>
> Can someone point out how i can use the usb-skeleton driver and also test
> it.
>
> I also have Arch linux set up, but, i have not tried the above on it yet.
>
> Thanks & Regards,
> Sanchayan.
>
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

Try rmmoding usb-storage after it gets loaded.

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


Re: Best and fastest way to understand kernel subsystem ?

2012-12-06 Thread sanjeev sharma
Hi,

First you need to start with basic of kernel and book for kernel by Robert
Love will help you.Both file-system and networking are major subsystem in
Kernel and required an knowledge of file-system & networking.

Thanks
Sanjeev Sharma


On Thu, Dec 6, 2012 at 3:24 PM, Shraddha Kamat  wrote:

> What is the best (and the fastest ) way to understand a kernel
> subsystem ( for e.g., filesystem , Networking .. etc.)
>
> -- Shraddha
>
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Queries on USB skeleton Driver

2012-12-06 Thread sanchayan maity
Hello,

I wanted to use the usb-skeleton driver for transferring data to a pen
drive. I am using Ubuntu 12.04 with kernel version 3.2.0. I remove the
usb-storage driver with rmmod and then inserted the skeleton module. The
module is inserted successfully. On inserting the drive, usb-storage module
gets automatically loaded.

To avoid this, i tried blacklisting the module by including a blacklist
entry in blacklist.conf  and rebooting. This didn't work either and
usb-storage gets automatically loaded again.

Can someone point out how i can use the usb-skeleton driver and also test
it.

I also have Arch linux set up, but, i have not tried the above on it yet.

Thanks & Regards,
Sanchayan.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: double exclamation mark meaning ?

2012-12-06 Thread devendra.aaru
On Thu, Dec 6, 2012 at 4:50 AM, Shraddha Kamat  wrote:
> Hi,
>
> # define likely(x)  __builtin_expect(!!(x), 1)
> # define unlikely(x)__builtin_expect(!!(x), 0)
>
> I see these !! in the above expressions. Please explain me the
> meaning of those double exclamations. What is their significance ?
>

this is c question, right, google is your friend

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

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


Re: Best and fastest way to understand kernel subsystem ?

2012-12-06 Thread Anuz Pratap Singh Tomar
On Thu, Dec 6, 2012 at 9:54 AM, Shraddha Kamat  wrote:

> What is the best (and the fastest ) way to understand a kernel
> subsystem ( for e.g., filesystem , Networking .. etc.)
>
There is no fast way to learn Filesystem and Networking subsystems,
probably one of the biggest subsystems in kernel.
you should start learning basics from the classic Kernel books and learn
your way around by digging the code.

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



-- 
Thank you
Warm Regards
Anuz
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


RE: transfering pages from user space to user space

2012-12-06 Thread Pablo Pessolani

Hi Yann:

Reading the patch source code I find that the pages from one user space to 
other are "copied" 
102 if (vm_write)
103 ret = copy_from_user(target_kaddr,
104  lvec[*lvec_current].iov_base
105  + *lvec_offset,
106  bytes_to_copy);
107 else
108 ret = copy_to_user(lvec[*lvec_current].iov_base
109+ *lvec_offset,
110target_kaddr, bytes_to_copy);
 
The code I wrote (very similar to this) also copies page contents. But my 
interest is transfering pages (zero-copy).
Regards.
PAP
 

> Subject: Re: transfering pages from user space to user space
> From: ydrone...@opteya.com
> To: ppessol...@hotmail.com
> Date: Thu, 6 Dec 2012 10:30:27 +0100
> CC: kernelnewbies@kernelnewbies.org
> 
> Hi,
> 
> Le mercredi 05 décembre 2012 à 22:47 -0300, Pablo Pessolani a écrit :
> > Hi:
> > I am working on a project to copy (page aligned) the
> > buffer content of one process to the buffer of other process.
> > 
> > Now I resolved this issue using copy_page() but, analizing
> > performance with different buffer sizes, the "copy_page" becames the
> > critical time component and limiting factor.
> 
> This sounds a lot like "Cross Memory Support" (eg CROSS_MEMORY_ATTACH
> option) introduced in Linux 3.2:
> 
> http://kernelnewbies.org/Linux_3.2#head-a5e26c6275e85a5c9c41873fbab96bd38d934b72
> 
> Cross Memory Support add two syscalls:
> - process_vm_readv() : read from a process memory
> - process_vm_writev() : write to a process memory
> 
> Details can be found here:
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=fcf634098c00dd9cd247447368495f0b79be12d1
> 
> And documentation here:
> 
> http://www.man7.org/linux/man-pages/man2/process_vm_readv.2.html
> http://ozlabs.org/~cyeoh/cma/process_vm_readv.txt
> 
> > [...] The kernel I use is 2.6.32.
> > 
> 
> BTW, why use a kernel released 3 years ago for such new development ?
> Kernel 2.6.32 was released the 3rd of december 2009. Even the -rt
> project switch to newer kernel (eg. no less than 3.0, and up to 3.4),
> see http://rt.wiki.kernel.org/
> 
> You should at least switch to a current long term support kernels, for
> example Linux 3.4. See
> http://www.kroah.com/log/linux/stable-status-08-2012.html
> 
> Regards
> 
> -- 
> Yann Droneaud
> OPTEYA
> 
> 
> 
> 
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
  ___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Best and fastest way to understand kernel subsystem ?

2012-12-06 Thread Matthias Brugger
On 12/06/2012 10:54 AM, Shraddha Kamat wrote:
> What is the best (and the fastest ) way to understand a kernel
> subsystem ( for e.g., filesystem , Networking .. etc.)

If you are a beginner it might be convenient to look on a small 
subsystem first. The filesystem is really big and complicated, I think.
If you are familiar with the embedded world, maybe something like spi or 
i2c might be a good starting point.

If you want to understand networking, maybe starting with the tun/tap 
kernel module and try to understand how it "injects"/"grabs" 
packets/frames from/to userspace. This way you learn something on the 
data structures of the network subsystem.

Just my 3 cents.
Cheers,
Matthias

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


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


RE: transfering pages from user space to user space

2012-12-06 Thread Pablo Pessolani

Hi: 
 

> This sounds a lot like "Cross Memory Support" (eg CROSS_MEMORY_ATTACH
> option) introduced in Linux 3.2:
> 
> http://kernelnewbies.org/Linux_3.2#head-a5e26c6275e85a5c9c41873fbab96bd38d934b72
> 
> Cross Memory Support add two syscalls:
> - process_vm_readv() : read from a process memory
> - process_vm_writev() : write to a process memory
> 
> Details can be found here:
> 
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=fcf634098c00dd9cd247447368495f0b79be12d1
> 
> And documentation here:
> 
> http://www.man7.org/linux/man-pages/man2/process_vm_readv.2.html
> http://ozlabs.org/~cyeoh/cma/process_vm_readv.txt
> 
GREAT! I will study these documentation and source code.
 
> > [...] The kernel I use is 2.6.32.
> > 
> 
> BTW, why use a kernel released 3 years ago for such new development ?
> Kernel 2.6.32 was released the 3rd of december 2009. Even the -rt
> project switch to newer kernel (eg. no less than 3.0, and up to 3.4),
> see http://rt.wiki.kernel.org/
> 
> You should at least switch to a current long term support kernels, for
> example Linux 3.4. See
> http://www.kroah.com/log/linux/stable-status-08-2012.html
 
Because I use the stable distribution of Debian and all the packages for kernel 
modules and kernel building are for these version as you can see:
Package kernel-image-2.6.32-5-486-di


squeeze (stable) (debian-installer): Linux kernel binary image for the Debian 
installer 
1.99+squeeze8: i386
 
Thanks Yann Droneaud

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


Re: Best and fastest way to understand kernel subsystem ?

2012-12-06 Thread Abhijit Pawar
On 12/06/2012 05:32 PM, rush wrote:
> Hi,
> Most of O'Reilly books are pretty old. Afair the latest O'Reilly book is from 
> Robert Love about 2.6.34. Does it make sense?
Yes. Its a good book.
> Or even book 2005 are still usefull?
Even if the books are older they can give you the general idea about the
thoughts put into the particular subsystem.

> -- rush
> 06.12.2012, 15:49, "Abhijit Pawar" :
>>
>> On 12/06/2012 03:24 PM, Shraddha Kamat wrote:
>>
>>  What is the best (and the fastest ) way to understand a kernel
>>  subsystem ( for e.g., filesystem , Networking .. etc.) 
>>
>> Reading the kernel code is the best way. For reference you can use LDD3
>> and books from OReilly.
>>
>>  -- Shraddha
>>
>>
>>  ___
>>  Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org 
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>> -- 
>> -
>> Abhijit
>>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org 
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
> 


-- 
-
Abhijit

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


Re: Best and fastest way to understand kernel subsystem ?

2012-12-06 Thread rush
Hi,Most of O'Reilly books are pretty old. Afair the latest O'Reilly book is from Robert Love about 2.6.34. Does it make sense?Or even book 2005 are still usefull? -- rush 06.12.2012, 15:49, "Abhijit Pawar" :On 12/06/2012 03:24 PM, Shraddha Kamat wrote: What is the best (and the fastest ) way to understand a kernel  subsystem ( for e.g., filesystem , Networking .. etc.) Reading the kernel code is the best way. For reference you can use LDD3and books from OReilly. -- Shraddha ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies-- -Abhijit___Kernelnewbies mailing listKernelnewbies@kernelnewbies.orghttp://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Best and fastest way to understand kernel subsystem ?

2012-12-06 Thread Abhijit Pawar
On 12/06/2012 03:24 PM, Shraddha Kamat wrote:
> What is the best (and the fastest ) way to understand a kernel 
> subsystem ( for e.g., filesystem , Networking .. etc.) 
Reading the kernel code is the best way. For reference you can use LDD3
and books from OReilly.

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


-- 
-
Abhijit

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


Re: double exclamation mark meaning ?

2012-12-06 Thread Prabhakar Lad
Hi,

On Thu, Dec 6, 2012 at 3:20 PM, Shraddha Kamat  wrote:
> Hi,
>
> # define likely(x)  __builtin_expect(!!(x), 1)
> # define unlikely(x)__builtin_expect(!!(x), 0)
>
> I see these !! in the above expressions. Please explain me the
> meaning of those double exclamations. What is their significance ?
>
The Operator ! is used to perform the Boolean operation NOT.
For example:
!(1) ---> Outputs to 0 (false).
!(2.56565) ---> Outputs to 0 (false).
!(20) > Outputs to 0 (false).
!(-123)---> Outputs to 0 (false).
!(0)-> Outputs to 1 (true).
Similarly '!!'  Performs twice NOT operation
!!(1) --->  Outputs to 1 (true).
!!(2.56565) --->  Outputs to 1 (true).
!!(20) >  Outputs to 1 (true).
!!(-123)---> Outputs to 1 (true).
!!(0)->  Outputs to 0 (false).

Hope that clears your doubt.

Regards,
--Prabhakar Lad

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

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


Re: double exclamation mark meaning ?

2012-12-06 Thread Yann Droneaud
> Hi,
>
> # define likely(x)  __builtin_expect(!!(x), 1)
> # define unlikely(x)__builtin_expect(!!(x), 0)
>
> I see these !! in the above expressions. Please explain me the
> meaning of those double exclamations. What is their significance ?
>

This is a kind of cast to a "bool".

After applying !!(x), the value will be either 0 or 1.
It's roughly equivalent to (((x) != 0) ? 1 : 0)

Regards.

-- 
Yann Droneaud
OPTEYA



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


Re: transfering pages from user space to user space

2012-12-06 Thread Yann Droneaud
Hi,

Le mercredi 05 décembre 2012 à 22:47 -0300, Pablo Pessolani a écrit :
> Hi:
> I am working on a project to copy (page aligned) the
> buffer content of one process to the buffer of other process.
> 
> Now I resolved this issue using copy_page() but, analizing
> performance with different buffer sizes, the "copy_page" becames the
> critical time component and limiting factor.

This sounds a lot like "Cross Memory Support" (eg CROSS_MEMORY_ATTACH
option) introduced in Linux 3.2:

http://kernelnewbies.org/Linux_3.2#head-a5e26c6275e85a5c9c41873fbab96bd38d934b72

Cross Memory Support add two syscalls:
- process_vm_readv() : read from a process memory
- process_vm_writev() : write to a process memory

Details can be found here:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=fcf634098c00dd9cd247447368495f0b79be12d1

And documentation here:

http://www.man7.org/linux/man-pages/man2/process_vm_readv.2.html
http://ozlabs.org/~cyeoh/cma/process_vm_readv.txt

> [...] The kernel I use is 2.6.32.
>  

BTW, why use a kernel released 3 years ago for such new development ?
Kernel 2.6.32 was released the 3rd of december 2009. Even the -rt
project switch to newer kernel (eg. no less than 3.0, and up to 3.4),
see http://rt.wiki.kernel.org/

You should at least switch to a current long term support kernels, for
example Linux 3.4. See
http://www.kroah.com/log/linux/stable-status-08-2012.html

Regards

-- 
Yann Droneaud
OPTEYA




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


Best and fastest way to understand kernel subsystem ?

2012-12-06 Thread Shraddha Kamat
What is the best (and the fastest ) way to understand a kernel 
subsystem ( for e.g., filesystem , Networking .. etc.) 

-- Shraddha


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


double exclamation mark meaning ?

2012-12-06 Thread Shraddha Kamat
Hi, 

# define likely(x)  __builtin_expect(!!(x), 1)
# define unlikely(x)__builtin_expect(!!(x), 0)

I see these !! in the above expressions. Please explain me the 
meaning of those double exclamations. What is their significance ?

-- Shraddha 



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