[lkml]   [1998]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Differences between FreeBSD and Linux system call mechanism
In message <>, Joerg Pommnitz writes:
| Alexander Kjeldaas wrote:
| > Doesn't this mean that it would be a good idea to let the kernel
| > implement system calls by mapping a page into user-space containing
| > the appropriate assembly instructions to most efficiently do the
| > system calls?
| Probably not. In this case all you would effectively do
| is change the syscall interface from:
| move parameters into registers
| int 0x80
| to
| move parameters into registers
| jump to kernel entry instruction
| execute int 0x80 or sysenter

IIRC SCO (used to?) implemented the syscalls that merely return process
information by read-mapping the appropriate part of the ublock (think
"struct task_struct", for those unfamiliar with AT&T-derived (including BSD)
*ix, although task_struct combines both proc and ublock) within the
process's address space during process creation. Thus, getpid(), getppid(),
getpgrp(), etc. were nothing more than

return ((struct user *) PROCESS_UBLOCK_MAP_ADDR)->u_pid;

(or other structure fields as appropriate).

(This also introduced a security hole at one point, though, IIRC.)

brandon s. allbery [os/2][linux][solaris][japh]
system administrator [WAY too many hats]
electrical and computer engineering KF8NH
carnegie mellon university

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:44    [W:0.081 / U:1.960 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site