Skip to contentSkip to conversation

user and kernel space

Xenomai-core Jan-Erik Lange 2 participants 4 messages Dec 31, 2011 – Jan 1, 2012

lore
Share & tools
lore
#0 lore raw

Hello,

I have a question concerning user space and kernel space. I'm dealing with the native API and I read, that this API provides the same funtkions for both kernel and user space.

When looking at the sourcecode of buffer.h for example, there I find a section called public interface. When looking at the function rt_buffer_create(); for example, how does the Implementation von this function in userspace differs to the implementation for this function kernel space? Or is it the same implementation for user and kernel space.

Best regards

Jan

#1 lore raw
Quoted 7 lines · Jan-Erik Lange

Hello,

I have a question concerning user space and kernel space. I'm dealing with the native API and I read, that this API provides the same funtkions for both kernel and user space.

Quoted 6 lines

When looking at the sourcecode of buffer.h for example, there I find a section called public interface. When looking at the function rt_buffer_create(); for example, how does the Implementation von this function in userspace differs to the implementation for this function kernel space? Or is it the same implementation for user and kernel space.

For most services such as buffer services, user functions emit system calls which implementation in kernel-space use the corresponding kernel service.

There are some exceptions such as mutexes implementation where we try hard to avoid system calls and so provide both a user-space implementation and a kernel-space implementation.

Another exception is the __xn_rdtsc() function, which relies on most platforms on the same mechanism in user and kernel-space to access the machine high resolution counter, and so has an identical implementation.

Signature · 1 line
                                                                Gilles.
#2 lore raw
Quoted 25 lines

Date: Sat, 31 Dec 2011 16:32:20 +0100
From: [email protected]
To: [email protected]
CC: [email protected]
Subject: Re: [Xenomai-core] user and kernel space

Quoted 7 lines · Jan-Erik Lange

Hello,

I have a question concerning user space and kernel space. I'm dealing with the native API and I read, that this API provides the same funtkions for both kernel and user space.

Quoted 6 lines

When looking at the sourcecode of buffer.h for example, there I find a section called public interface. When looking at the function rt_buffer_create(); for example, how does the Implementation von this function in userspace differs to the implementation for this function kernel space? Or is it the same implementation for user and kernel space.

Quoted 7 lines

For most services such as buffer services, user functions emit system calls which implementation in kernel-space use the corresponding kernel service.

There are some exceptions such as mutexes implementation where we try hard to avoid system calls and so provide both a user-space implementation and a kernel-space implementation.

Ok, but the names of the API function are the same for user and kernel space. How is it realized to take the implementation A for kernel space and the implementation B for userspace? Is this realzied in the linking process?

Quoted 9 lines

Another exception is the __xn_rdtsc() function, which relies on most platforms on the same mechanism in user and kernel-space to access the machine high resolution counter, and so has an identical implementation.

Signature · 1 line
Gilles.
#3 lore raw
Quoted 33 lines · Jan-Erik Lange
Quoted 24 lines

Date: Sat, 31 Dec 2011 16:32:20 +0100 From:
[email protected] To: [email protected] CC:
[email protected] Subject: Re: [Xenomai-core] user and kernel space

Quoted 7 lines · Jan-Erik Lange

Hello,

I have a question concerning user space and kernel space. I'm dealing with the native API and I read, that this API provides the same funtkions for both kernel and user space.

Quoted 6 lines

When looking at the sourcecode of buffer.h for example, there I find a section called public interface. When looking at the function rt_buffer_create(); for example, how does the Implementation von this function in userspace differs to the implementation for this function kernel space? Or is it the same implementation for user and kernel space.

Quoted 7 lines

For most services such as buffer services, user functions emit system calls which implementation in kernel-space use the corresponding kernel service.

There are some exceptions such as mutexes implementation where we try hard to avoid system calls and so provide both a user-space implementation and a kernel-space implementation.

Quoted 4 lines

Ok, but the names of the API function are the same for user and kernel space. How is it realized to take the implementation A for kernel space and the implementation B for userspace? Is this realzied in the linking process?

Yes, kernel and user-space are separated execution space, there is no possible confusion.

Signature · 1 line
                                                                Gilles.