vinit dhatrak | 1 Oct 03:39 2009
Picon

Re: development/hacking environment reg.

On Wed, Sep 30, 2009 at 8:57 PM, Anand Arumugam <anand.arumug <at> gmail.com> wrote:
> Thanks a bunch for your detailed reply. It really gave me some idea. Even if
> its not something related to the nuts and bolts of the target hardware, how
> does one go about test the fix in other architectures say
> SPARC/MIPS/ARM/SH*??? Can that be achieved using QEMU or can this be done
> using VirtualBox itself?
>
> Cheers,
> -Anand.

Yes, its very much possible to emulate these archs with QEMU, I use it
for arm processor related work. Or another very nice option is
Marvell's SheevaPlug. It already comes with development kit with it.
Explore it here, http://en.wikipedia.org/wiki/SheevaPlug

-Vinit

> On Wed, Sep 30, 2009 at 1:15 AM, Michal Ludvig <mludvig <at> logix.net.nz> wrote:
>>
>> Anand Arumugam wrote:
>>
>> > what is the
>> > normal environment that is used by most of the kernel hackers and
>> > developers? do they have a dedicated pc for this work and have a
>> > separate pc for other uses? or just create a partition in the hard drive
>> > and use this partition for kernel related development?
>>
>> I guess it really depends on what sort of kernel development you do. If
>> it's something that doesn't need access to the hardware, for instance a
>> new filesystem, you can get away with a virtual machine in VirtualBox or
(Continue reading)

Peter Teoh | 1 Oct 04:37 2009
Picon

Threaded Network Device Interrupts

Look at this:

http://linuxplumbersconf.org/2009/schedule/

and in particular the following - Steven Rostedt is talking about
replacing softirq with threaded interrupt.   Amazing innovations!!!

http://linuxplumbersconf.org/ocw/proposals/53

Threaded Network Device Interrupts
*
Networking
Talk
lpc2009-0053
Scheduled: Wednesday, September 23, 2009 from 11:30am – 12:15pm in Salon E
Excerpt

Increasing networking performance by using threaded interrupts for the
network devices.
Description

Several in the networking community are skeptical on using interrupt
threads for the network devices. I will argue that not only does it
make the solution more simplex, but also increases network throughput.
With the introduction of the threaded interrupt infrastructure into
2.6.30, the path has been paved to allow networking devices to take
advantage of this. The threaded interrupt may then do all the work
needed to hand off the packet to the thread code without all the
complexities needed in locking while using the softirqs.

(Continue reading)

Harinderjit Singh Sandhu | 1 Oct 08:24 2009
Picon

facing a problem with request _irq qnd enable_irq

-----------------------------------------------------------------------------------------------------------
int ret;
    printk("initializing module\n");
        //free_irq(7,NULL);   
    i = register_chrdev (SKELETON_MAJOR, SKELETON_NAME, &skeleton_fops);
    if (i != 0) return - EIO;
    //disable_irq(7);
    ret = request_irq (7, interrupt_handler,0,SKELETON_NAME ,NULL);
        printk("ret=%d\n",ret);
        //enable_irq(7);
    if(ret>=0){
    enable_irq(7);
//    outb_p(0x10, BASEPORT + 2);
    }
    else
    {
    printk("Not Working \n");
    }
    //printk("Generating interrupt \n");
   
    outb(0, BASEPORT);
    outb(255, BASEPORT);
    outb(0, BASEPORT);
    printk("Interrupt generated. You should see the handler-message\n");

---------------------------------------------------------------------------------------------------------
when i insmod the module of which this is apart.


i get the following output

[ 1291.259646] initializing module
[ 1291.259672] ret=0
[ 1291.259679] ------------[ cut here ]------------
[ 1291.259682] WARNING: at /build/buildd/linux-2.6.28/kernel/irq/manage.c:225 __enable_irq+0x30/0x70()
[ 1291.259685] Unbalanced enable for IRQ 7
[ 1291.259687] Modules linked in: skeleton(+) hid_bright usbhid rfkill_input i915 drm binfmt_misc ppdev bridge stp bnep lp parport arc4 ecb snd_hda_intel snd_pcm_oss snd_mixer_oss snd_pcm pcmcia snd_seq_dummy b43 snd_seq_oss snd_seq_midi snd_rawmidi mac80211 snd_seq_midi_event cfg80211 iTCO_wdt iTCO_vendor_support snd_seq snd_timer snd_seq_device yenta_socket rsrc_nonstatic ricoh_mmc sdhci_pci sdhci snd pcmcia_core led_class intel_agp agpgart soundcore snd_page_alloc pcspkr input_polldev serio_raw uvcvideo compat_ioctl32 videodev v4l1_compat video output ohci1394 ieee1394 8139too 8139cp mii ssb fbcon tileblit font bitblit softcursor
[ 1291.259751] Pid: 4400, comm: insmod Not tainted 2.6.28-11-generic #42-Ubuntu
[ 1291.259754] Call Trace:
[ 1291.259760]  [<c0139ab0>] warn_slowpath+0x60/0x80
[ 1291.259765]  [<c0181449>] ? register_handler_proc+0x119/0x130
[ 1291.259773]  [<c02cc3b8>] ? vsnprintf+0x378/0x5c0
[ 1291.259778]  [<c013a2f9>] ? release_console_sem+0x1c9/0x200
[ 1291.259782]  [<c017f570>] __enable_irq+0x30/0x70
[ 1291.259786]  [<c017f5ec>] enable_irq+0x3c/0x60
[ 1291.259790]  [<f7f9c000>] ? skeleton_init_module+0x0/0x96 [skeleton]
[ 1291.259795]  [<f7f9c078>] skeleton_init_module+0x78/0x96 [skeleton]
[ 1291.259802]  [<c010111e>] _stext+0x2e/0x170
[ 1291.259807]  [<c020c015>] ? sysfs_addrm_finish+0x15/0xf0
[ 1291.259811]  [<c020b7e3>] ? sysfs_add_one+0x13/0x50
[ 1291.259814]  [<c020b85f>] ? sysfs_addrm_start+0x3f/0xa0
[ 1291.259820]  [<c01a908c>] ? __vunmap+0x9c/0xe0
[ 1291.259823]  [<c01a908c>] ? __vunmap+0x9c/0xe0
[ 1291.259832]  [<c01a9121>] ? vfree+0x21/0x30
[ 1291.259837]  [<c0163f3a>] ? load_module+0x103a/0x1040
[ 1291.259848]  [<c0163fc8>] sys_init_module+0x88/0x1b0
[ 1291.259853]  [<c01bb5da>] ? sys_close+0x7a/0xc0
[ 1291.259857]  [<c0103f6b>] sysenter_do_call+0x12/0x2f
[ 1291.259865]  [<c0500000>] ? relay_hotcpu_callback+0x6d/0xbd
[ 1291.259868] ---[ end trace cddcbfa519faa2fe ]---
[ 1291.259870] Interrupt generated. You should see the handler-message

and the message in the handler doesnt appear.
i am unable to get what is the problem and how can this be solved.

please help me out


--
---------------------
Harinderjit Singh

debian developer | 1 Oct 08:49 2009
Picon

Re: contributing to linux kernel.

On Wed, Sep 30, 2009 at 3:29 PM, Pete <greg.petr <at> gmail.com> wrote:
>
> Hello list,

Welcome to kernel programming.

>
> I was mostly thinking of LSM, SELinux or btrfs, Ext4 ? Can anyone
> provide any pointers or tutorials or the project page where I could do
> some additional reading to get some hands on ?
>

You can lookup Tux3. It is in dire need of developers and could use some help.
Loads of documentation is available for it. See tux3.org

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis <at> nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

vinit dhatrak | 1 Oct 14:11 2009
Picon

Re: Query about /var/log/messages

On Thu, Oct 1, 2009 at 3:37 PM, Leonidas . <leonidas137 <at> gmail.com> wrote:
> On Thu, Oct 1, 2009 at 2:45 PM, Leonidas . <leonidas137 <at> gmail.com> wrote:
>> Hi List,
>>
>> Kernel maintains a circular log buffer and output of printk is stored
>> in that log buffer,
>> this log buffer survives reboots also.
>>
>> Is it possible to create a seperate file or dir inside /var/log for
>> logging only my kernel
>> modules messages?
>>
>> On my machine I see many files and dir inside /var/log/. Is it doable
>> from a module?
>>
>> -Leo.
>>
>
> E.g. I know that I can change syslog.conf file so that all kernel
> messages are stored in
> a separate file.
>
> But is there any way I can store only msgs emanating from My_Module to
> a separate file?
> Assume that all msgs from My_Module are having same priority say KERN_INFO.
>
> -Leo.
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis <at> nl.linux.org
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>

I dont know the answer for the question that you have asked but you
can always put your printks with a definite pre-text like "My_Module"
and later you can grep on /var/log/messages for this string. If this
is not what you wanted then may be somebody else can help you.

-Vinit

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis <at> nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Loránd Jakab | 1 Oct 14:09 2009

Re: Query about /var/log/messages

Hi Leo,

On Thursday, October 01, 2009 12:07:53 Leonidas . wrote:
> On Thu, Oct 1, 2009 at 2:45 PM, Leonidas . <leonidas137 <at> gmail.com> 
wrote:
> > Hi List,
> >
> > Kernel maintains a circular log buffer and output of printk is
> > stored in that log buffer,
> > this log buffer survives reboots also.
> >
> > Is it possible to create a seperate file or dir inside /var/log for
> > logging only my kernel
> > modules messages?
> >
> > On my machine I see many files and dir inside /var/log/. Is it
> > doable from a module?
> >
> > -Leo.
> 
> E.g. I know that I can change syslog.conf file so that all kernel
> messages are stored in
> a separate file.
> 
> But is there any way I can store only msgs emanating from My_Module
>  to a separate file?
> Assume that all msgs from My_Module are having same priority say
>  KERN_INFO.

I think the only way to do that is if the kernel module can write to a 
facility other than "kernel", such as "local0". I don't know if that is 
possible fron the Linux kernel.

--Lori

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis <at> nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Greg KH | 1 Oct 16:56 2009

Re: facing a problem with request _irq qnd enable_irq

On Thu, Oct 01, 2009 at 11:54:55AM +0530, Harinderjit Singh Sandhu wrote:
> -----------------------------------------------------------------------------------------------------------
> int ret;
>     printk("initializing module\n");
>         //free_irq(7,NULL);
>     i = register_chrdev (SKELETON_MAJOR, SKELETON_NAME, &skeleton_fops);
>     if (i != 0) return - EIO;
>     //disable_irq(7);
>     ret = request_irq (7, interrupt_handler,0,SKELETON_NAME ,NULL);
>         printk("ret=%d\n",ret);
>         //enable_irq(7);
>     if(ret>=0){
>     enable_irq(7);
> //    outb_p(0x10, BASEPORT + 2);
>     }
>     else
>     {
>     printk("Not Working \n");
>     }
>     //printk("Generating interrupt \n");
> 
>     outb(0, BASEPORT);
>     outb(255, BASEPORT);
>     outb(0, BASEPORT);
>     printk("Interrupt generated. You should see the handler-message\n");
> 
> ---------------------------------------------------------------------------------------------------------
> when i insmod the module of which this is apart.
> 
> 
> i get the following output
> 
> [ 1291.259646] initializing module
> [ 1291.259672] ret=0
> [ 1291.259679] ------------[ cut here ]------------
> [ 1291.259682] WARNING: at
> /build/buildd/linux-2.6.28/kernel/irq/manage.c:225 __enable_irq+0x30/0x70()
> [ 1291.259685] Unbalanced enable for IRQ 7
> [ 1291.259687] Modules linked in: skeleton(+) hid_bright usbhid rfkill_input
> i915 drm binfmt_misc ppdev bridge stp bnep lp parport arc4 ecb snd_hda_intel
> snd_pcm_oss snd_mixer_oss snd_pcm pcmcia snd_seq_dummy b43 snd_seq_oss
> snd_seq_midi snd_rawmidi mac80211 snd_seq_midi_event cfg80211 iTCO_wdt
> iTCO_vendor_support snd_seq snd_timer snd_seq_device yenta_socket
> rsrc_nonstatic ricoh_mmc sdhci_pci sdhci snd pcmcia_core led_class intel_agp
> agpgart soundcore snd_page_alloc pcspkr input_polldev serio_raw uvcvideo
> compat_ioctl32 videodev v4l1_compat video output ohci1394 ieee1394 8139too
> 8139cp mii ssb fbcon tileblit font bitblit softcursor
> [ 1291.259751] Pid: 4400, comm: insmod Not tainted 2.6.28-11-generic
> #42-Ubuntu
> [ 1291.259754] Call Trace:
> [ 1291.259760]  [<c0139ab0>] warn_slowpath+0x60/0x80
> [ 1291.259765]  [<c0181449>] ? register_handler_proc+0x119/0x130
> [ 1291.259773]  [<c02cc3b8>] ? vsnprintf+0x378/0x5c0
> [ 1291.259778]  [<c013a2f9>] ? release_console_sem+0x1c9/0x200
> [ 1291.259782]  [<c017f570>] __enable_irq+0x30/0x70
> [ 1291.259786]  [<c017f5ec>] enable_irq+0x3c/0x60
> [ 1291.259790]  [<f7f9c000>] ? skeleton_init_module+0x0/0x96 [skeleton]
> [ 1291.259795]  [<f7f9c078>] skeleton_init_module+0x78/0x96 [skeleton]
> [ 1291.259802]  [<c010111e>] _stext+0x2e/0x170
> [ 1291.259807]  [<c020c015>] ? sysfs_addrm_finish+0x15/0xf0
> [ 1291.259811]  [<c020b7e3>] ? sysfs_add_one+0x13/0x50
> [ 1291.259814]  [<c020b85f>] ? sysfs_addrm_start+0x3f/0xa0
> [ 1291.259820]  [<c01a908c>] ? __vunmap+0x9c/0xe0
> [ 1291.259823]  [<c01a908c>] ? __vunmap+0x9c/0xe0
> [ 1291.259832]  [<c01a9121>] ? vfree+0x21/0x30
> [ 1291.259837]  [<c0163f3a>] ? load_module+0x103a/0x1040
> [ 1291.259848]  [<c0163fc8>] sys_init_module+0x88/0x1b0
> [ 1291.259853]  [<c01bb5da>] ? sys_close+0x7a/0xc0
> [ 1291.259857]  [<c0103f6b>] sysenter_do_call+0x12/0x2f
> [ 1291.259865]  [<c0500000>] ? relay_hotcpu_callback+0x6d/0xbd
> [ 1291.259868] ---[ end trace cddcbfa519faa2fe ]---
> [ 1291.259870] Interrupt generated. You should see the handler-message
> 
> and the message in the handler doesnt appear.
> i am unable to get what is the problem and how can this be solved.
> 
> please help me out

Your irq handler is not working properly, please post the code for that.

Also, please follow the kernel coding style rules if you wish to have
other people review your code, otherwise it is very difficult for us to
do so.

good luck,

greg k-h

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis <at> nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Greg KH | 1 Oct 17:33 2009

Re: facing a problem with irq handler,please help me

On Thu, Oct 01, 2009 at 08:55:27PM +0530, Harinderjit Singh Sandhu wrote:
> this is the code for the small module that i wrote

The problem is in your interrupt handler:

> // interrupt handler
> irqreturn_t interrupt_handler (int irqn, void *dev)
> {
> 
>         printk("Press a key  ");
> 
> 
>         return IRQ_HANDLED;
> 
> 
> }

You aren't really handling the interrupt by turning it off in the
hardware.  So the kernel sees an interrupt storm for your device and
shuts it off to save the system from going crazy.

What are you trying to do with this sample module?

greg k-h

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis <at> nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Harinderjit Singh Sandhu | 1 Oct 17:41 2009
Picon

Re: facing a problem with irq handler,please help me

i was trying to figure out how the interrupts are handled . can you suggest me a reading to have proper knowledge of this ,so that i don't trouble people with such problems

On Thu, Oct 1, 2009 at 9:03 PM, Greg KH <greg <at> kroah.com> wrote:
On Thu, Oct 01, 2009 at 08:55:27PM +0530, Harinderjit Singh Sandhu wrote:
> this is the code for the small module that i wrote

The problem is in your interrupt handler:

> // interrupt handler
> irqreturn_t interrupt_handler (int irqn, void *dev)
> {
>
>         printk("Press a key  ");
>
>
>         return IRQ_HANDLED;
>
>
> }

You aren't really handling the interrupt by turning it off in the
hardware.  So the kernel sees an interrupt storm for your device and
shuts it off to save the system from going crazy.

What are you trying to do with this sample module?

greg k-h



--
---------------------
Harinderjit Singh
Greg KH | 1 Oct 17:45 2009

Re: facing a problem with irq handler,please help me

On Thu, Oct 01, 2009 at 09:11:30PM +0530, Harinderjit Singh Sandhu wrote:
> i was trying to figure out how the interrupts are handled . can you suggest
> me a reading to have proper knowledge of this ,so that i don't trouble
> people with such problems

Look at a driver with a real interrupt handler?  It's not like we don't
have a few thousand examples in the kernel already :)

good luck,

greg k-h

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis <at> nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ


Gmane