Re: What is asmlinkage ?
> So with asmlinkage we request compiler to put args on stack. What is advantage of this to start_kernel or in general to other functions ? See its about implementation ease and little of performance too. Assuming the default model of keeping arguments in registers is used. lets say arguments are assumed to be in registers R1, R2, R3, R4, R5, R6 and beyond that in stack. Since system call number is a transparent argument which is chopped off when calling the actual kernel handler and if R1 had the system call number, then you have to shift all register values and stack arguments too. Now consider that all arguments are pushed on stack (as enforced by asmlinkage), you have all function argument in the beginning of the stack and the system call number on top of the stack. you just need to pop out stack top to remove system call number from function argument. You might argue that why not always keep system call number on stack top and use registers for function arguments? But thats part of the compiler ABI and if you had fewer arguments lets say 2 only and used up R1 and R2 only, you may not jump to stack top directly for storing system call as its turn for R3 as argument. So, isn't it simpler implementation with everything on stack? -Rajat On Fri, Jan 4, 2013 at 12:13 PM, Rahul Bedarkar wrote: > Thanks. So with asmlinkage we request compiler to put args on stack. What > is advantage of this to start_kernel or in general to other functions ? > > Regards, > Rahul > > > On Thu, Jan 3, 2013 at 9:34 PM, Mulyadi Santosa > wrote: > >> On Thu, Jan 3, 2013 at 7:40 PM, Rahul Bedarkar wrote: >> > Hi, >> > >> > I was searching for asmlinkage and found that it is already explained at >> > http://kernelnewbies.org/FAQ/asmlinkage >> > >> > But I didn't get this. Can someone tell me about it in brief ? >> >> the point is, parameters which is usually passed via stack, is passed >> using different way. >> >> A good example is system call they are passed using registers IIRC >> >> >> -- >> regards, >> >> Mulyadi Santosa >> Freelance Linux trainer and consultant >> >> blog: the-hydra.blogspot.com >> training: mulyaditraining.blogspot.com >> > > > ___ > 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: What is asmlinkage ?
Thanks. So with asmlinkage we request compiler to put args on stack. What is advantage of this to start_kernel or in general to other functions ? Regards, Rahul On Thu, Jan 3, 2013 at 9:34 PM, Mulyadi Santosa wrote: > On Thu, Jan 3, 2013 at 7:40 PM, Rahul Bedarkar wrote: > > Hi, > > > > I was searching for asmlinkage and found that it is already explained at > > http://kernelnewbies.org/FAQ/asmlinkage > > > > But I didn't get this. Can someone tell me about it in brief ? > > the point is, parameters which is usually passed via stack, is passed > using different way. > > A good example is system call they are passed using registers IIRC > > > -- > regards, > > Mulyadi Santosa > Freelance Linux trainer and consultant > > blog: the-hydra.blogspot.com > training: mulyaditraining.blogspot.com > ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
what does this error mean?
/usr/bin/ld: arch/i386/kernel/vsyscall-int80.so: Not enough room for program headers, try linking with -N ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Detect list corruption at early stage to avoid BUG hitting?
Hi Everyone, Many times we see the following warning, which causes some kernel Bug to hit. I googled for any solution to detect list corruption so as to avoid the bug hit, but couldnt find any. Do you guys have any info ?? Does kernel provide any generic solution to do this? *Warning: list_del corruption. next->prev should be xx, but was y. * Regards Ritesh ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
keyboard driver question
Hi. I`m sorry if this isn`t the right place to post my question, but first I tried posting it on forum.kernelnewbies.org and nobody answered. Here`s my question: I have a Gembird kb-9140l keyboard with some multimedia keys which are not working on linux. I thought about writing my own driver for it, so as a start, I wrote a small module, which registers an interrupt handler on irq 1 with the IRQF_SHARED flag. In the handler function I put a simple printk with the scancode read from the keyboard. The problem is, that the handler never gets executed. I searched on google, and found that because the native driver doesn`t share its interrupt with another modules, before I call request_irq I have to free the original interrupt handler from the native driver. This would make my computer practically unusable until I reboot, but at least I would see, it works, but it doesn`t. The original driver works fine after I insert my module, and the interrupt handler still doesn`t get called. The weird thing is, when I remove my module, my handler executes ones, and the scancode is 0xFE. The code is the following: #include #include #include #include #include MODULE_LICENSE("Dual BSD/GPL"); static int gembirdkb_init(void); static void gembirdkb_exit(void); irq_handler_t irq_handler (int irq, void *dev_id, struct pt_regs *regs) { static unsigned char scancode; scancode = inb (0x60); printk("gembirdkb: irq handled... scancode: %d\n",scancode); return (irq_handler_t) IRQ_HANDLED; } static int gembirdkb_init(void) { int ret; /* free original interrupt handler */ // free_irq(1, NULL); ret = request_irq (1, (irq_handler_t) irq_handler, IRQF_SHARED, "gembirdkb", (void *)&irq_handler); printk("gembirdkb: request_irq result: %d\n", ret); return ret; } static void gembirdkb_exit(void) { free_irq(1, (void *)&irq_handler); } module_init(gembirdkb_init); module_exit(gembirdkb_exit); Is there any way I can remove the native driver, or I need to recompile the kernel without it, and insert mine? P.s.: Why every topic on the forum is full with questions about mac, iphone, samsung galaxy etc.? ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: What is asmlinkage ?
On Thu, Jan 3, 2013 at 7:40 PM, Rahul Bedarkar wrote: > Hi, > > I was searching for asmlinkage and found that it is already explained at > http://kernelnewbies.org/FAQ/asmlinkage > > But I didn't get this. Can someone tell me about it in brief ? the point is, parameters which is usually passed via stack, is passed using different way. A good example is system call they are passed using registers IIRC -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Kernelnewbies Digest, Vol 26, Issue 1
Hello Dave, So I have to do the kernelversion.xz extraction in linux OS and then build, right? I am extracting this in another OS, got the problem. Thank you very much. Why would I get the following errors, though they would not stop the build process? Any help? 1> Where do I change the annotation of snd_hda_build_pcms? WARNING: sound/pci/hda/built-in.o(.text+0x54bc5): Section mismatch in reference from the function azx_probe_continue() to the function .devinit.text:snd_hda_build_pcms() The function azx_probe_continue() references the function __devinit snd_hda_build_pcms(). This is often because azx_probe_continue lacks a __devinit annotation or the annotation of snd_hda_build_pcms is wrong. OR WARNING: sound/built-in.o(.text+0x266d0d): Section mismatch in reference from the function azx_probe_continue() to the function .devinit.text:snd_hda_build_pcms() The function azx_probe_continue() references the function __devinit snd_hda_build_pcms(). This is often because azx_probe_continue lacks a __devinit annotation or the annotation of snd_hda_build_pcms is wrong. 2> sound/pci/rme9652/hdspm.c: In function ‘snd_hdspm_create_controls’: sound/pci/rme9652/hdspm.c:4597:20: warning: ‘limit’ may be used uninitialized in this function TnR, Ganesh B From: Dave Hylands To: Ganesh B Cc: "kernelnewbies@kernelnewbies.org" Sent: Thursday, January 3, 2013 2:07 PM Subject: Re: Kernelnewbies Digest, Vol 26, Issue 1 Hi Ganesh, On Wed, Jan 2, 2013 at 11:55 PM, Ganesh B wrote: I am trying to build the Kernel 3.7 and there are some files which have to be overwritten when uncompressing. One of the same files, ipt_ECN.c, gives an error stopping the build process. Any suggestions? > > >net/ipv4/netfilter/ipt_ECN.c:20:42: fatal error: >linux/netfilter_ipv4/ipt_ECN.h: No such file or directory >compilation terminated. There is an ipt_ecn.c file and an ipt_ECN.c file (which differ only by case), so it sounds like there was a case-insensitive file system involved somewhere in what you're doing. Normal linux filesystems (like ext2/3/4) are case-sensitive, so these are 2 different files. Dave Hylands___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: internel implemention of file operation
> in this vm_operations_struct , there are open/close functions , are there necessary relations between file operations and this struct ? well not really for open/close of vm_ops are of interest to filesystems, but page fault handler and making page writable is where filesystem come into picture. Have a look at ext4_file_vm_ops, it implements operations of interest. static const struct vm_operations_struct ext4_file_vm_ops = { .fault = filemap_fault, .page_mkwrite = ext4_page_mkwrite, } Note that only filesystem knows how to fill up this page. On Thu, Jan 3, 2013 at 3:39 PM, horseriver wrote: > On Thu, Jan 03, 2013 at 01:16:06PM +0530, Rajat Sharma wrote: > > > > will it be maped with vm_area struct ? > > Yes if it is accessed via mmap system call. > > you know that , in the struct vm_area_struct,there is a struct > vm_operations_struct * vm_ops; > > in this vm_operations_struct , there are open/close functions , are there > necessary relations between file > > operations and this struct ? > > thanks! > > > > > > what is the relation between page-cache and file operation? > > file operations for data access like read/write will look into page-cache > > first before going to disk. > > > > -Rajat > > > > ___ > 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: compile linux kernel 2.6.0 failed
On Thu, Jan 3, 2013 at 5:43 AM, horseriver wrote: > hi: >I am compiling 2.6.0 kernel with gcc 4.4.5 and link with ld 2.20 version. 2.6.0, SRSLY?! > my host os is 2.6.32 kernel . > >when linking .so , output this error : > >/usr/bin/ld: arch/i386/kernel/vsyscall-int80.so: Not enough room for > program headers, try linking with -N > >does gcc generate the program headers ? why not enough room for it ? > >I guess it is because gcc version is not compitable with ld version > >is there some advice ? Kernel source too old, GCC too new :-) -- Thanks, //richard ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: internel implemention of file operation
On Thu, Jan 03, 2013 at 01:16:06PM +0530, Rajat Sharma wrote: > > will it be maped with vm_area struct ? > Yes if it is accessed via mmap system call. you know that , in the struct vm_area_struct,there is a struct vm_operations_struct * vm_ops; in this vm_operations_struct , there are open/close functions , are there necessary relations between file operations and this struct ? thanks! > > > what is the relation between page-cache and file operation? > file operations for data access like read/write will look into page-cache > first before going to disk. > > -Rajat > ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Kernelnewbies Digest, Vol 26, Issue 1
Hi Ganesh, On Wed, Jan 2, 2013 at 11:55 PM, Ganesh B wrote: > I am trying to build the Kernel 3.7 and there are some files which have to > be overwritten when uncompressing. One of the same files, ipt_ECN.c, gives > an error stopping the build process. Any suggestions? > > net/ipv4/netfilter/ipt_ECN.c:20:42: fatal error: > linux/netfilter_ipv4/ipt_ECN.h: No such file or directory > compilation terminated. > There is an ipt_ecn.c file and an ipt_ECN.c file (which differ only by case), so it sounds like there was a case-insensitive file system involved somewhere in what you're doing. Normal linux filesystems (like ext2/3/4) are case-sensitive, so these are 2 different files. Dave Hylands ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Re: Kernelnewbies Digest, Vol 26, Issue 1
I am trying to build the Kernel 3.7 and there are some files which have to be overwritten when uncompressing. One of the same files, ipt_ECN.c, gives an error stopping the build process. Any suggestions? net/ipv4/netfilter/ipt_ECN.c:20:42: fatal error: linux/netfilter_ipv4/ipt_ECN.h: No such file or directory compilation terminated. make[3]: *** [net/ipv4/netfilter/ipt_ECN.o] Error 1 make[2]: *** [net/ipv4/netfilter] Error 2 make[1]: *** [net/ipv4] Error 2 make: *** [net] Error 2 TnR, Ganesh B From: "kernelnewbies-requ...@kernelnewbies.org" To: kernelnewbies@kernelnewbies.org Sent: Wednesday, January 2, 2013 10:30 PM Subject: Kernelnewbies Digest, Vol 26, Issue 1 Send Kernelnewbies mailing list submissions to kernelnewbies@kernelnewbies.org To subscribe or unsubscribe via the World Wide Web, visit http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies or, via email, send a message with subject or body 'help' to kernelnewbies-requ...@kernelnewbies.org You can reach the person managing the list at kernelnewbies-ow...@kernelnewbies.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Kernelnewbies digest..." Today's Topics: 1. Re: trace_console function definition not found in Linux kernel v3.5 (jiangtao.jit) 2. compile linux kernel 2.6.0 failed! (horse_rivers) -- Message: 1 Date: Wed, 02 Jan 2013 11:45:38 +0800 From: "jiangtao.jit" Subject: Re: trace_console function definition not found in Linux kernel v3.5 To: "siddharth goel" Cc: kernelnewbies Message-ID: <50e3ad65.8abe440a.56a1.b...@mx.google.com> Content-Type: text/plain; charset="utf-8" siddharth goel: defined in include/trace/event/printk.h refer to macro TRACE_EVENT_CONDITION(...) 2013-01-02 jiangtao.jit siddharth goel ?2012-12-28 15:43 ???trace_console function definition not found in Linux kernel v3.5 "kernelnewbies" ??? In file kernel/printk.c in Linux Kernel 3.5 there is a function call trace_console(text, 0, len, len); @line 1219 . But I could not find the definition for same. Am I missing any concept ? -- Thanks and Regards, Siddharth Goel -- next part -- An HTML attachment was scrubbed... URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130102/46a96f21/attachment-0001.html -- Message: 2 Date: Wed, 2 Jan 2013 14:50:26 +0800 (CST) From: horse_rivers Subject: compile linux kernel 2.6.0 failed! To: "kernelnewbies@kernelnewbies.org" Message-ID: <57a6aed1.b519.13bfa067778.coremail.horse_riv...@126.com> Content-Type: text/plain; charset=UTF-8 hi, ? ?I am compiling kernel 2.6.0 with gcc 4.4.5, when linking , here comes the error : ??/usr/bin/ld: arch/i386/kernel/vsyscall-int80.so: Not enough room for program headers, try linking with -N ? I suspect that ?gcc version is not compitable for ld , my ld is 2.20 version . ? I want to know what does this error mean ? and the general reason for this ? ?thanks! -- ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies End of Kernelnewbies Digest, Vol 26, Issue 1 ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies