2010-07-10 21:55:50

by Philip Wernersbach

[permalink] [raw]
Subject: Calling system call from User-mode Linux?

I'm trying to add some functionality to User-mode Linux that requires
the UML kernel to call a custom syscall I've added to the host kernel.
This should be technically possible since UML runs in the userspace,
but I can't figure out how to call the syscall, as the syscall()
function isn't defined in UML. Are there other ways I can accomplish
this?

Thanks,
Phil


2010-07-11 02:15:36

by Jeff Dike

[permalink] [raw]
Subject: Re: Calling system call from User-mode Linux?

On Sat, Jul 10, 2010 at 05:55:48PM -0400, Philip Wernersbach wrote:
> I'm trying to add some functionality to User-mode Linux that requires
> the UML kernel to call a custom syscall I've added to the host kernel.
> This should be technically possible since UML runs in the userspace,
> but I can't figure out how to call the syscall, as the syscall()
> function isn't defined in UML. Are there other ways I can accomplish
> this?

Add a function in the userspace side of UML (arch/um/os-Linux) which
invokes your new system call through syscall(), and then call that
from wherever you need to.

Jeff