What is difference between kernel API and system call ?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
leetow2003
Member
Member
Posts: 70
Joined: Fri Nov 19, 2010 6:54 pm

What is difference between kernel API and system call ?

Post by leetow2003 »

Are they in the same layer kernel?do they call each other?
What is difference between them?
User avatar
dozniak
Member
Member
Posts: 723
Joined: Thu Jul 12, 2012 7:29 am
Location: Tallinn, Estonia

Re: What is difference between kernel API and system call ?

Post 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.
Learn to read.
leetow2003
Member
Member
Posts: 70
Joined: Fri Nov 19, 2010 6:54 pm

Re: What is difference between kernel API and system call ?

Post 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?
User avatar
zhiayang
Member
Member
Posts: 368
Joined: Tue Dec 27, 2011 7:57 am
Libera.chat IRC: zhiayang

Re: What is difference between kernel API and system call ?

Post 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.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: What is difference between kernel API and system call ?

Post 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.
leetow2003
Member
Member
Posts: 70
Joined: Fri Nov 19, 2010 6:54 pm

Re: What is difference between kernel API and system call ?

Post by leetow2003 »

Could they call each other?could you give me an example?
User avatar
dozniak
Member
Member
Posts: 723
Joined: Thu Jul 12, 2012 7:29 am
Location: Tallinn, Estonia

Re: What is difference between kernel API and system call ?

Post 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.
Learn to read.
User avatar
Jezze
Member
Member
Posts: 395
Joined: Thu Jul 26, 2007 1:53 am
Libera.chat IRC: jfu
Contact:

Re: What is difference between kernel API and system call ?

Post by Jezze »

Perhaps a syscall more reflects the kernel ABI rather?
Fudge - Simplicity, clarity and speed.
http://github.com/Jezze/fudge/
User avatar
iansjack
Member
Member
Posts: 4711
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: What is difference between kernel API and system call ?

Post 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.
Post Reply