From mboxrd@z Thu Jan 1 00:00:00 1970 From: greg.freemyer@gmail.com (Greg Freemyer) Date: Wed, 29 Jun 2011 17:10:53 -0400 Subject: link question In-Reply-To: <4E0B629E.6030302@tysdomain.com> References: <4E0B629E.6030302@tysdomain.com> Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Wed, Jun 29, 2011 at 1:36 PM, Littlefield, Tyler wrote: > I have a quick question; this is something I haven't been able to figure > out. By using the kernel headers you can call functions that are defined > in the kernel, but you don't actually have to link to the kernel or any > sort of library. How does this work? How does compiled code call the > function if it doesn't link to it in some way or another?. Is this a question about userspace apps or kernel modules? Userspace apps link to glibc which in turn has assembly instructions embedded to call into the kernel. Kernel Modules get a different kind of magic, but I'm not sure of those details. Greg