OK, I guess this is my take.
Every OS has some way to make a "system call", i.e. calling a kernel function from user space. How that is done is OS-specific. You can place the parameters in registers and call INT 0x80. You can place the parameters in some memory area and call INT 21h. You can place the parameters on a hard drive sectore and trigger a fault handler. (NO!) You can... whatever. Somehow you have to:
- define which kernel function to call,
- define which parameters to pass to the function,
- tell the kernel it should execute the function.
Typically, these system calls are provided as C functions, which internally do the "call-the-kernel-magic" with a bit of ASM (system call stubs). As I said, what has to be done is OS specific. The C library then uses some "glue code" to interface its low-level functions with the system call stubs.
E.g. fopen() - while it has some additional work to do in user space, like setting up buffers etc., it has to tell the kernel to actually open the file, and deliver a file descriptor (on POSIX systems, an integer), which is then stored in the FILE struct for later reference by fread(), fwrite() etc.
When I want my PDCLib to work with Unixes, fopen() will call open(). When I want my PDCLib to work with Win32, I'd call CreateFile() or something like that.
In that regard, this part of the OS API (the system call stubs) is located
below the standard library, while the rest of the OS API (that what makes the OS different from others) is either
above the standard library, or
alongside it.
I hope I make myself clear.