tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Same interface for kernel and user space programming!

On Tue, 3 Mar 2009 11:10:20 -0800 (PST)
Bits Pilani <> wrote:

> Why is the programming interface on the kernel side and user side different 
> (double-std interface) in NetBSD and other like OSes? 

There are various reasons, a few of them follow:

In the case of NetBSD it's generally prefered, where possible, for
kernel interfaces to be closer to other BSDs to ease porting software
and patches.

Microkernels tend to have a very thin kernel for interrupts and
low-level memory management and the remaining is usually implemented as
libraries which makes most of the system userland.  BSD and Linux
kernels are more monolithic in nature, making the kernel and userland
two very distinct components.

There exist various common userland API standards such as POSIX, which
are adhered to for compatibility when possible, however most such
standards are intended for userland.  Kernel APIs generally need to be
lower level or more powerful, and to adapt and evolve as needed,
without affecting stable userland interfaces...

That said, where convenient, a number of functions adhere to the same
API.  Consider very common string functions, for instance.  This still
doesn't mean that the same code can be shared in all cases, because
kernel code has strict requirements;  for instance, stack usage becomes
an important concern.

I hope this helps,

Home | Main Index | Thread Index | Old Index