RE: Linux code quality

2012-04-20 Thread Jeff Haran
> -Original Message-
> From: kernelnewbies-bounces+jharan=bytemobile@kernelnewbies.org
> [mailto:kernelnewbies-
> bounces+jharan=bytemobile@kernelnewbies.org] On Behalf Of
> Ezequiel García
> Sent: Friday, April 20, 2012 9:53 AM
> To: kernelnewbies
> Subject: Linux code quality
> 
> Off-topic, perhaps not relevant... need to throw this out me :)
> 
> Why do I have to hear that linux code is not well written?
> 
> Having seen lots of other projects, it seems very neat to me.
> Actually, it is one of the main reasons that makes me want to learn, help, 
> etc.
> 
> Thanks,
> Ezequiel.

I find the report at this link informative in this regard:

http://www.coverity.com/library/pdf/coverity-scan-2011-open-source-integrity-report.pdf

Jeff Haran




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


Linux code quality

2012-04-20 Thread Ezequiel García
Off-topic, perhaps not relevant... need to throw this out me :)

Why do I have to hear that linux code is not well written?

Having seen lots of other projects, it seems very neat to me.
Actually, it is one of the main reasons that makes me want to learn, help, etc.

Thanks,
Ezequiel.

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


Re: how to get create/compile time of vmlinux

2012-04-20 Thread Jonathan Neuschäfer
On Fri, Apr 20, 2012 at 08:09:27PM +0800, 卜弋天 wrote:
> Hi All:i have a vmlinux file, how can i know when it is created/compiled? 
>   thanks.  Best Regards

The "file" utility should give you the version, the compile time, and
some other information about vmlinuz and probably also vmlinux files.

HTH,
Jonathan Neuschäfer

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


Re: Node creation For real time devices

2012-04-20 Thread Philipp Ittershagen
On Fri, Apr 20, 2012 at 4:04 PM, manty kuma  wrote:
> Hi Philipp,
>
> The flow you mentioned is something which I was not aware of. I would like
> to see it happening in code.
>
> My Queries are as follows:
>
> 1) " The kernel then creates an uevent and notifies the userspace part of
> udev (udevd) through a netlink socket. " -  What are the corresponding files
> that i need to check? If the question is too abstract, kindly explain me
> with respect to any sample Bus.

The article at http://www.linuxjournal.com/article/8093 explains the
initialization mechanism for USB. I don't have any code experience on
USB hubs but by following the functions mentioned in the article
(expecially the khubd kthread) you can see that the interrupt I
mentioned is handled by the USB subsystem.

Next, the uevent is created. The generic(?) implementation of this can
be found at http://lxr.free-electrons.com/source/drivers/usb/core/driver.c#L722,
where you can see that the uevent contains the necessary data for
creating a udev entry.

By sending the uevent we're crossing the kernel/userspace boundary and
you have to take a look at the udev and udevd implementation for more
information.

> 2)  "The uevent is received by udevd and now udev can check for rules to add
> the device node to /dev" - Again the same thing. I would like to see it
> inside the code. Please help me in looking at the real code.

If a `man udev` does not answer your questions, you should take a look
at the source code at
http://git.kernel.org/?p=linux/hotplug/udev.git;a=summary.


Again, please correct me if I'm wrong :)



Hope this helps,

  Philipp

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


Re: Node creation For real time devices

2012-04-20 Thread Li Haifeng
A good question.

When a driver is probed, corresponding device file will be created in
sysfs or devfs.

Maybe you can take a look at this link: http://lwn.net/Articles/330985/

Regards,
Haifeng Li

在 2012年4月20日 下午10:04,manty kuma  写道:
> Hi Philipp,
>
> The flow you mentioned is something which I was not aware of. I would like
> to see it happening in code.
>
> My Queries are as follows:
>
> 1) " The kernel then creates an uevent and notifies the userspace part of
> udev (udevd) through a netlink socket. " -  What are the corresponding files
> that i need to check? If the question is too abstract, kindly explain me
> with respect to any sample Bus.
>
> 2)  "The uevent is received by udevd and now udev can check for rules to add
> the device node to /dev" - Again the same thing. I would like to see it
> inside the code. Please help me in looking at the real code.
>
> Thanks again Philipp for your valuable answer.
>
> Regards,
> -Manty
>
> On Fri, Apr 20, 2012 at 7:24 PM, Philipp Ittershagen
>  wrote:
>>
>> Hi Manty!
>>
>> On Fri, Apr 20, 2012 at 3:29 PM, manty kuma  wrote:
>> > Hi,
>> >
>> > I want to know how a node is created when a hardware is connected to the
>> > system.
>> >
>> > Information that I know :
>> > When a hardware is connected to the system, the device name is compared
>> > with
>> > the driver name, if it matches, then probe is called.
>> >
>> > Info i wish to know:
>> > At which point is the node created and who is creating it(In other
>> > words, i
>> > want to know where is mknod happening)?
>> >
>> > This one thing is bugging my mind from so many months. Please tell me
>> > programatically where is this happening. I will be very thankful.
>>
>> Please correct me if I'm wrong, my understanding is this:
>>
>> The hardware is connected and the corresponding subsystem or bus will
>> be notified (i.e. by interrupt of the device). The kernel then creates
>> an uevent and notifies the userspace part of udev (udevd) through a
>> netlink socket. The uevent is received by udevd and now udev can check
>> for rules to add the device node to /dev. That's when the creation and
>> naming of the device node happens.
>>
>>
>> Greetings,
>>
>>  Philipp
>
>
>
> ___
> 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: how to get create/compile time of vmlinux

2012-04-20 Thread Vlad Dogaru
2012/4/20 卜弋天 :
> Hi All:
>
>    i have a vmlinux file, how can i know when it is created/compiled?
>    thanks.

If you manage to boot the image, /proc/version should tell you when
the image was compiled.

Vlad

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


Re: Node creation For real time devices

2012-04-20 Thread manty kuma
Hi Philipp,

The flow you mentioned is something which I was not aware of. I would like
to see it happening in code.

My Queries are as follows:

1) " The kernel then creates an uevent and notifies the userspace part of
udev (udevd) through a netlink socket. " -  What are the corresponding
files that i need to check? If the question is too abstract, kindly explain
me with respect to any sample Bus.

2)  "The uevent is received by udevd and now udev can check for rules to
add the device node to /dev" - Again the same thing. I would like to see it
inside the code. Please help me in looking at the real code.

Thanks again Philipp for your valuable answer.

Regards,
-Manty
On Fri, Apr 20, 2012 at 7:24 PM, Philipp Ittershagen <
p.ittersha...@googlemail.com> wrote:

> Hi Manty!
>
> On Fri, Apr 20, 2012 at 3:29 PM, manty kuma  wrote:
> > Hi,
> >
> > I want to know how a node is created when a hardware is connected to the
> > system.
> >
> > Information that I know :
> > When a hardware is connected to the system, the device name is compared
> with
> > the driver name, if it matches, then probe is called.
> >
> > Info i wish to know:
> > At which point is the node created and who is creating it(In other
> words, i
> > want to know where is mknod happening)?
> >
> > This one thing is bugging my mind from so many months. Please tell me
> > programatically where is this happening. I will be very thankful.
>
> Please correct me if I'm wrong, my understanding is this:
>
> The hardware is connected and the corresponding subsystem or bus will
> be notified (i.e. by interrupt of the device). The kernel then creates
> an uevent and notifies the userspace part of udev (udevd) through a
> netlink socket. The uevent is received by udevd and now udev can check
> for rules to add the device node to /dev. That's when the creation and
> naming of the device node happens.
>
>
> Greetings,
>
>  Philipp
>
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: how to get create/compile time of vmlinux

2012-04-20 Thread Alexandru Juncu
2012/4/20 卜弋天 :
> Hi All:
>
>    i have a vmlinux file, how can i know when it is created/compiled?
>    thanks.

If it's the original image (not a copy) you can always do a ls -l or
stats on it...

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


Re: Node creation For real time devices

2012-04-20 Thread Philipp Ittershagen
Hi Manty!

On Fri, Apr 20, 2012 at 3:29 PM, manty kuma  wrote:
> Hi,
>
> I want to know how a node is created when a hardware is connected to the
> system.
>
> Information that I know :
> When a hardware is connected to the system, the device name is compared with
> the driver name, if it matches, then probe is called.
>
> Info i wish to know:
> At which point is the node created and who is creating it(In other words, i
> want to know where is mknod happening)?
>
> This one thing is bugging my mind from so many months. Please tell me
> programatically where is this happening. I will be very thankful.

Please correct me if I'm wrong, my understanding is this:

The hardware is connected and the corresponding subsystem or bus will
be notified (i.e. by interrupt of the device). The kernel then creates
an uevent and notifies the userspace part of udev (udevd) through a
netlink socket. The uevent is received by udevd and now udev can check
for rules to add the device node to /dev. That's when the creation and
naming of the device node happens.


Greetings,

  Philipp

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


Node creation For real time devices

2012-04-20 Thread manty kuma
Hi,

I want to know how a node is created when a hardware is connected to the
system.

Information that I know :
*When a hardware is connected to the system, the device name is compared
with the driver name, if it matches, then probe is called.*
*
*
Info i wish to know:
*At which point is the node created and who is creating it(In other words,
i want to know where is mknod happening)?*
*
*
This one thing is bugging my mind from so many months. Please tell me
programatically where is this happening. I will be very thankful.

Best Regards,
Manty.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


how to get create/compile time of vmlinux

2012-04-20 Thread 卜弋天




Hi All:i have a vmlinux file, how can i know when it is created/compiled?   
thanks.  Best Regards ___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies