Query on CodingStyle: indentation
Hi, I've a query regarding the coding style for Linux Kernel code. I'm reading the CodingStyle under Documentation and what I've understood is that I shouldn't be using spaces for indentation purposes and should use tabs of width 8 characters. Quoting from the same document: "Outside of comments, documentation and except in Kconfig, spaces are never used for indentation, and the above example is deliberately broken." However, Is it correct to replace each tab stroke by 8 spaces ? I use vim editor and I've put following under $HOME/.vimrc file: set tabstop=8 set shiftwidth=8 set expandtab In past I've seen that some application have different interpretation of tabs and hence sometimes even If I've done proper indentation using tab, the code appears unindented, and therefore In order to make sure that I'm moving 8 characters upon hitting tab, I've put the above rules under my .vimrc file. Please let me know If I should remove these from my .vimrc file and rely on tab instead. -Amit ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Finding the interrupt vector of a given IRQ
Hi Anish, On Mon, May 28, 2012 at 9:16 AM, anish singh wrote: > On Mon, May 28, 2012 at 2:57 AM, richard -rw- weinberger > wrote: > > On Sun, May 27, 2012 at 2:02 AM, Mark Farnell > wrote: > >> In the kernel, how can I find out the interrupt vector number of a > >> given IRQ (for example, IRQ7)? > >> > >> Within the kernel module, I would like to manually set the IRQ using > >> the assembly code: > >> > >> asm("int $"); > >> > >> and let the IRQ handler installed by a different module catch that > interrupt. > >> > >> Is this possible? > > > > No really because not all IRQ have an interrupt line to the CPU. > > Linux can multiplex and emulate them. Think of GPIO drivers with > > interrupt support. > Can you please describe this in detail?It would really help a lot of > people like me.Does multiplex mean that all numbers starting from > 0,1,2,3,.. TOTAL-interrupt will have interrupt lines associated with it > eventhough all interrupt numbers are not linear? > GPIOs are grouped as banks. Let’s say 32 gpios are in a bank. There will be only single interrupt line to interrupt controller for a bank. Consider that you have configured gpio1 and gpio16 as interrupts. Even if interrupt happens on gpio 1 or gpio 16, the same interrupt line will be triggered to Interrupt controller. Now the gpio driver has to figure out reading the Interrupt status Register of GPIO to find which interrupt (gpio1 or gpio16) has really fired. So in this case a single interrupt line is multiplex for 32 gpio interrupts. HTH. Thanks, Arun > > Anyway, why to you think you need to trigger the raw IRQ manually? > > This sounds really odd... > > > > > > -- > > Thanks, > > //richard > > > > ___ > > 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 > ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Regarding udevadm
Hi, I am using udevadm info to get information about connected block devices. I have attached usb device and disabled auto mounting of it. I can see kernel logs that device is added and node is created. But when I use udevadm info --export-db, I can't see device info of /dev/sdb1 If I use udevadm monitor --kernel to monitor kernel udev events, I can see KERNEL[1419.590316] remove /block/sdb/sdb1 (block) KERNEL[1419.622381] remove /block/sdb (block) KERNEL[1430.528523] add /block/sdb (block) KERNEL[1430.564808] add /block/sdb/sdb1 (block) Why /dev/sdb1 is not getting displayed in case udevadm info ? Thanks, Rahul B. ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: looking for current, online kernel-related tutorials
On Thu, 18 Oct 2012, Sarah Sharp wrote: > That's what I'm planning on doing to the wiki. You're right that > it's out of date and very disorganized. So I'll take a crack at it > and see if there's a better structure. i'm going to take a different approach to reorganizing all of the tutorials at my site. first, i'm going to get all the useful stuff *out* of the wiki -- for this sort of thing, wikis are a waste of time. good for quick and dirty, utterly useless for anything else. instead, i'm going to move it all under drupal as books or stories or whatever is appropriate, where only i will have the authority to change the content, but people will be allowed to *comment* on individual articles. that way, i can post stuff and be notified down the road by people leaving comments that something's changed and needs updating (effectively crowdsourcing all of that work). at this point, i don't see any other way to do this that's as effective. rday -- Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca Twitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: looking for current, online kernel-related tutorials
On Thu, Oct 18, 2012 at 06:08:55AM -0400, Robert P. J. Day wrote: > On Tue, 16 Oct 2012, Sarah Sharp wrote: > > > Any plans to include this content in kernelnewbies.org? It seems > > like tutorials on kernel programming should be linked from there. > > at the risk of putting a few noses out of joint, a main reason why > i'm not keen on adding more content to kernelnewbies is that what's > there is, in many cases, spectacularly out of date, and newer content > would just get lost in the shuffle. > > consider the links here: > > http://kernelnewbies.org/Documents > > follow some of those links and see where you end up. i mean, > seriously, "working with the kernel source in CVS"?? and a number of > other links there have very little remaining value. > > rather than trying to add more content, a higher priority would be > to *cleanse* that documentation page of what obviously has little > value, and start over. thoughts? That's what I'm planning on doing to the wiki. You're right that it's out of date and very disorganized. So I'll take a crack at it and see if there's a better structure. Sarah Sharp ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: looking for current, online kernel-related tutorials
On Thu, Oct 18, 2012 at 11:08 AM, Robert P. J. Day wrote: > On Tue, 16 Oct 2012, Sarah Sharp wrote: > > > Any plans to include this content in kernelnewbies.org? It seems > > like tutorials on kernel programming should be linked from there. > > at the risk of putting a few noses out of joint, a main reason why > i'm not keen on adding more content to kernelnewbies is that what's > there is, in many cases, spectacularly out of date, and newer content > would just get lost in the shuffle. > > consider the links here: > > http://kernelnewbies.org/Documents > > follow some of those links and see where you end up. i mean, > seriously, "working with the kernel source in CVS"?? and a number of > other links there have very little remaining value. > > rather than trying to add more content, a higher priority would be > to *cleanse* that documentation page of what obviously has little > value, and start over. thoughts? > > That is pretty much state of most documentation about kernel. Most of text on drivers is not updated to the point that some of it wont even compile and links are broken. There is a lot of development and very little updated documentation. > rday > > -- > > > Robert P. J. Day Ottawa, Ontario, CANADA > http://crashcourse.ca > > Twitter: http://twitter.com/rpjday > LinkedIn: http://ca.linkedin.com/in/rpjday > > > ___ > 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: looking for current, online kernel-related tutorials
On Tue, 16 Oct 2012, Sarah Sharp wrote: > Any plans to include this content in kernelnewbies.org? It seems > like tutorials on kernel programming should be linked from there. at the risk of putting a few noses out of joint, a main reason why i'm not keen on adding more content to kernelnewbies is that what's there is, in many cases, spectacularly out of date, and newer content would just get lost in the shuffle. consider the links here: http://kernelnewbies.org/Documents follow some of those links and see where you end up. i mean, seriously, "working with the kernel source in CVS"?? and a number of other links there have very little remaining value. rather than trying to add more content, a higher priority would be to *cleanse* that documentation page of what obviously has little value, and start over. thoughts? rday -- Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca Twitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: looking for current, online kernel-related tutorials
On Thu, 18 Oct 2012, Peter Senna Tschudin wrote: > Robert, > > I like this: > http://www.freesoftwaremagazine.com/articles/drivers_linux > > It is not current but not very old. not bad ... definitely dated as it uses a parallel port as an example, and deprecated register_chrdev() for device registration. but not bad. what i'm after these days is more up-to-date and much more *focused* tutorials if people run across them. as in, rather than another example of how to write a character driver, i'm collecting writeups like this: http://www.ibm.com/developerworks/linux/library/l-tasklets/index.html that is, a solid coverage of a single topic in some detail, particularly if it can tie back into code taken from the kernel. anyway, off to write more tutorials. rday -- Robert P. J. Day Ottawa, Ontario, CANADA http://crashcourse.ca Twitter: http://twitter.com/rpjday LinkedIn: http://ca.linkedin.com/in/rpjday ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: looking for current, online kernel-related tutorials
Robert, I like this: http://www.freesoftwaremagazine.com/articles/drivers_linux It is not current but not very old. Peter On Wed, Oct 17, 2012 at 12:38 AM, Robert P. J. Day wrote: > > regarding kernel programming tutorials i'm currently > writing/updating: > > On Tue, 16 Oct 2012, Sarah Sharp wrote: > >> Any plans to include this content in kernelnewbies.org? It seems >> like tutorials on kernel programming should be linked from there. > > that's a nice idea, but i have a selfish reason to host all of this > at my (soon-to-be-revamped) website -- training is how i make a > living, and having numerous tutorials on various aspects of kernel > programming and device drivers and so on brings in readers and > represents marketing for me. from a business perspective, it's > nothing more than attracting eyeballs that might then hire me to teach > a course. > > that said, all of this is going to be publicly available (creative > commons license) so there won't be any restriction on who can read it. > certainly, anyone is welcome to link to what eventually gets > published at my site. > > over the next few weeks, much will be updated and re-organized, and > i'll post pointers to whatever goes up. > > rday > > -- > > > Robert P. J. Day Ottawa, Ontario, CANADA > http://crashcourse.ca > > Twitter: http://twitter.com/rpjday > LinkedIn: http://ca.linkedin.com/in/rpjday > > > ___ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies -- Peter ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies