[uClinux-dev] system_call: entry.S - Please reply

John Williams jwilliams at itee.uq.edu.au
Thu Mar 6 18:27:44 EST 2003

Deepa Sivasankarane wrote:
> Could u please tell me what the "libc system call stub" files are , for 
> m68knommu ?

For user mode programs, such as 'ls', 'ps', and all the usual command 
line Un*x utilities, as well as application software, access to kernel 
capabilities and data structures (such as the file system, or memory) is 
provided via system calls.  User programs are not permitted to call the 
kernel directly, instead they must use wrapper (stub) functions.  For 
example, when you write a C program and say

FILE *myfile=fopen("filename.txt", "wt");

The 'fopen' function is provided by the C libraries, also known as 
"libc".  In the libraries, there is a wrapper function ("call stub") 
that gets the parameters necessary, then makes the actual system call 
via the macros defined in unistd.h.  This also explains why, as a rule, 
you can't call libc functions from within the kernel (Un*x gurus, is 
this correct?).

It sounds like you really need to find yourself a good book about the 
linux kernel.  I can recommend two books from O'Reailly - "Understanding 
the Linux Kernel", by Bovet & Cesati, and "Linux Device Drivers" by 
Rubini and Corbet.  There's also a fair bit of info out there on the 
internet, if you look hard enough.



More information about the uClinux-dev mailing list