lkml.org 
[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
Date
From
In message <35EEAE7A.2DBD8809@darmstadt.gmd.de>, 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
+--->8

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] allbery@kf8nh.apk.net
system administrator [WAY too many hats] allbery@ece.cmu.edu
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 majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html

\
 
 \ /
  Last update: 2005-03-22 13:44    [W:0.080 / U:11.240 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site