Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Could anyone tell me if it is possible to add several system calls to the linux kernel (version 2.6.35) and not have to recompile the kernel each time I change one of their implementations (i.e. method body). For example add to syscall_table, unistd.h, ... and then make stubs for the system calls, recompile, then implement/test the method bodies without having to recompile the entire kernel (takes like 4 hours). I have looked it up but haven't found anything online with an answer. The reason I ask is if I have to compile for 4+ hours each time I change something its really inefficient

UPDATE: Thanks for all the responses I solved my problem I was receiving some faulty advice from my TA which led me to this issue but have since resolved the issue. I appreciate everyone's comments and help on the issue

if anyone one else reads this and is running into the same problem after the inital kernel compilation when I added system calls I just recompiled the kernel using make bzImage then make install and rebooted and things worked fine

share|improve this question
    
Related question: stackoverflow.com/questions/2394985/… –  JodieC Apr 9 '12 at 16:57
    
That and: stackoverflow.com/questions/2103315/… allow you to intercept a syscall from a module, which should get you what you want pretty much. –  Mat Apr 9 '12 at 17:01
    
Just modify the files you need to modify and type make; only the files that need to be recompiled will be recompiled (admittedly, that will be most of them). Note that you very rarely need to add syscalls: extensions to the kernel are normally invoked through /sys or through the filesystem interface or another existing framework, depending on what they do. As an aside, if your kernel compilations take 4 hours, you really need to get a better development machine (with an average 10-year old PC and a reasonable selection of modules, you should be done in 20–30 minutes). –  Gilles Apr 9 '12 at 23:51
    
@Gilles Thanks for the response yeah I'm pretty sure my long compilation time was due to the fact that the default make builds a ton of drivers that I don't need for my computer so I am looking into figuring out how to only build the ones I need for my machine I was able to find out which .kod files are currently being used by my system (someone said that is an indication of which modules you need to build) but have not been able to figure out how to use that information when using make menuconfig(as I have not been able to locate if there is a way to select only certain modules to build) –  cpowel2 Apr 10 '12 at 14:17
    
In order to avoid building drivers you don't need, you need to manually configure what drivers are built (deselect others in e.g. make menuconfig). Picking and choosing can take a long time. It might be quicker to set up a combination of CC caching and distribution using e.g. ccache and distcc, which can drastically reduce your compile times. –  jmtd Apr 10 '12 at 15:56
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.