Page 1 of 1
What is difference between kernel API and system call ?
Posted: Sun Oct 06, 2013 9:21 pm
by leetow2003
Are they in the same layer kernel?do they call each other?
What is difference between them?
Re: What is difference between kernel API and system call ?
Posted: Mon Oct 07, 2013 12:02 am
by dozniak
Kernel API is a set of services provided by the kernel.
System call is one of the ways to invoke the kernel API functions.
Re: What is difference between kernel API and system call ?
Posted: Mon Oct 07, 2013 1:10 am
by leetow2003
dozniak wrote:Kernel API is a set of services provided by the kernel.
System call is one of the ways to invoke the kernel API functions.
Are they in the same kernel layer?
Re: What is difference between kernel API and system call ?
Posted: Mon Oct 07, 2013 1:21 am
by zhiayang
leetow2003 wrote:dozniak wrote:Kernel API is a set of services provided by the kernel.
System call is one of the ways to invoke the kernel API functions.
Are they in the same kernel layer?
The Kernel API includes things that require access to such things, such as raw disk access (which would be processed by the FS driver and so on), starting a process etc.
Such API functions are usually exposed through system calls.
The call handler is usually in ring 0 along with the kernel, although your design may vary.
Re: What is difference between kernel API and system call ?
Posted: Mon Oct 07, 2013 1:42 am
by bluemoon
syscall usually refer to interface that exposes to user space applications or drivers, as the interface for external entity to interact with the system.
Kernel API has no specific meaning, it depends on which context you are talking, it can be components for kernel developers, driver interfaces, or syscall, etc.
Re: What is difference between kernel API and system call ?
Posted: Mon Oct 07, 2013 2:31 am
by leetow2003
Could they call each other?could you give me an example?
Re: What is difference between kernel API and system call ?
Posted: Mon Oct 07, 2013 7:58 am
by dozniak
leetow2003 wrote:Could they call each other?could you give me an example?
Could functions call each other? They certainly can.
You must understand the meaning of the three-letter acronym "API". It means "application programming interface", i.e. it's a bunch of functions that your application can call.
For example, the VFS API consists of "open", "close", "read", "write", "seek" calls which your application can use to open, close,read and write files.
What relation does it have to the system call? Well, "open" could be implemented as a system call. It can also be implemented as an RPC to the VFS server. It can also be implemented as a direct function call. Therefore your question about "can kernel API and system call call each other?" makes no sense.
Re: What is difference between kernel API and system call ?
Posted: Mon Oct 07, 2013 11:56 pm
by Jezze
Perhaps a syscall more reflects the kernel ABI rather?
Re: What is difference between kernel API and system call ?
Posted: Tue Oct 08, 2013 12:10 am
by iansjack
leetow2003 wrote:Could they call each other?could you give me an example?
This is beginning to sound a lot like a homework question.