In user mode linux (UML) a trace thread annuls system calls made by the user-space process and redirects them to a kernel running in user-space. Now at some point this userspace kernel would require assistance of the host OS. How does the user-mode kernel call the underlying host kernel, Is it just normal system calls? Or does it use some kind of IOCTL mechanism or something else?
Asked
Active
Viewed 366 times
1 Answers
2
I found an very simple explanation of UML design here. It may be useful for you.
UML constructs it using ptrace system call tracing mechanism.
- When a process in user space, its system called are intercepted by ptrace.
- When it is in the kernel, no interception. When a process executes a system call or receives signal, the tracing thread forces the process to run in the kernel.
- After the transition, the process state is restored and it continues.
System call virtualization
- By switching the user and kernel and system calls interception
- Note: the system call must be annulled in the host kernel.
- The process state is preserved.
- When the system call is complete, the process obtains the returned value in its saved registers and returned to user mode.
Also, this article explains System call virtualization using ptrace with the following picture.
http://www.csee.wvu.edu/~katta/uml/graphics/vsyscall.jpg. The red line represents the normal syscall procedure.

Chris Tsui
- 452
- 3
- 10
-
In the above diagram, is "Kernel stack" the user-space running kernel or the host kernel? – syed Sep 01 '15 at 21:16
-
@syed, the user-space running kernel. – Chris Tsui Sep 02 '15 at 06:49
-
Links are broken – Bachelar Hu Oct 08 '22 at 01:54