ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
i have a few questions about how things work on linux. all ideas welcome.
first is the way the kernel works with modules. i have my kernel image sitting in /boot. i have my modules in the right places after compiling and installing them. i have the kernel source tree sitting someplace in my home dir. now, when we build the new kernel, all the object files are created, and im guessing that those are what are being used by the kernel to load the modules. i wouldnt think that the source tree is of any use once the kernel modules have been built. but ... when i go make a modification in one of the kernel files (i made changes to the sis900.c file under /net), i see the changes immediately when i reboot the kernel. i didnt compile or build or do anything with the sis900.c file to affect the sis900. o file. how is this possible that it does this? is it actually, compiling, building and then loading the obj file everytime its brought up?
then, i made some changes to an user-space application (iwconfig, in my case), and added a simple 'printf()' stmt in it. again, i didnt compile it or do anything to affect the .o files, but it somehow reflects the changes. but ... in this case, i get a nice kernel panic.
how is it that changes i make in the source are reflected without me doing any compile/linking of these files? and why is it that one works fine with a change in a loop count, while another gives a kernel panic with a printf();?
Originally posted by h/w when i go make a modification in one of the kernel files (i made changes to the sis900.c file under /net), i see the changes immediately when i reboot the kernel. i didnt compile or build or do anything with the sis900.c file to affect the sis900. o file. how is this possible that it does this? is it actually, compiling, building and then loading the obj file everytime its brought up?
Of course some distro could arranged for this kernel-making at boot-time, but it does sound hard to believe. You said the sources are in some home-dir. How could the boot process (init script) know where it is?
Are you really sure that this is what happens. Like you, I would be quite surprised.
What happens if you put a syntax error deliberately in the sis900.c?
my kernel sources are sitting in /home/ksrc/linux-2.6.0
i have a symlink "linux" in /usr/src/ which points to the above.
my module object files are in /lib/modules/linux-2.6.0
so when i make changes to the file in /home/ksrc/linux-2.6.0/.../net/sis900.c, i see the changes, without doing anything afterwards to affect the obj file in /lib/modules. im sure you would see the same too.
the change i made to it was to reduce the count in the for loop from 32 to 2. right now, im not on my laptop, or else i would have tried putting the error in and checking (im guessing it would cause a kernel panic?)