Re: task_ops?

Martin von Loewis (martin@mira.isdn.cs.tu-berlin.de)
Wed, 7 Jan 1998 00:32:29 +0100


> I'm making something like a binary emulator which will execute
> assembly instructions in user space, but handle signals and syscalls
> differently than other native Linux tasks.

And still use Linux system calling conventions? Interesting.
With the same system call numbers as Linux or different ones?

> At first I thought I could just write another personality with a new
> exec_domain, but after looking at execdomain.c and entry.S I'm not
> sure. entry.S has entries for both lcall7 and syscall. There's only
> one lcall7 function defined in the kernel, and that sends SEGV.

Another one is defined in the iBCS2 support lcall 7 is the system
call convention for ... iBCS2 :-)

> What are the semantics of an lcall7 handler and what's the difference
> between lcall7 and syscall? Perhaps there should be another entry in
> exec_domain for a syscall handler?

The evaluation of lcall7 parameters is completely up to the exec_domain
module. So if you can make your applications use the call gate to enter
the kernel, you just need to register a new exec domain.

system_call does not consider the exec domain, it instead directly
goes to the handler function. It's probably not a good idea to add
another check into that code path, as it has been tuned to be as quick
as possible. Essentially, this is the entry point for personalities
that use the same calling conventions as Linux, and the same system
call numbers.

If you want to modify only a few system calls, this is the way to
go. Put checks for current->personality all over the place, and make
sure your applications call personality(2) early.

Finally, you can come up with another scheme for entering the kernel.
Maybe int 21 is still available :-)

Regards,
Martin