home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.linux
- Path: sparky!uunet!utcsri!torn!pulp.cs.laurentian.ca!ron
- From: ron@ramsey.cs.laurentian.ca (Ron Prediger [Velociraptor])
- Subject: A question about Kernel system call mechanism
- Message-ID: <1992Aug19.174117.21233@ramsey.cs.laurentian.ca>
- Keywords: linux, kernel, system call
- Organization: Dept. of Computer Science, Laurentian University, Sudbury, ON
- Date: Wed, 19 Aug 1992 17:41:17 GMT
- Lines: 26
-
- I am relatively new to Linux and have been examining the kernel source.
-
- 1) Does anyone know how linux passes parameters from the user process to the
- kernel service routine ? Below is what I think is happening and where I
- am confused.
-
- It appears that system calls are handled using interrupt or trap gates
- resident in the Interrupt descriptor table (IDT). From reading the Intel
- 386 ref. manual I understand that a stack switch occurs automatically when
- a less privileged process accesses a gate for a more privileged subroutine.
- What I can't see is how the kernel service routine gets the system call
- parameters (ie. addresses, etc) from the user process. Is there code
- somewhere which copies these parameters from the original (level 3) stack to
- the more privileged (level 0) stack ? If linux had used call gates to
- implement system calls, the parameters would automatically be copied to the
- privileged routine's stack by the 386. (This automatic
- copy of parameters does not occur when referencing interrupt/trap gates.)
-
- 2) It appears that Linux is making use of segment registers (FS,GS) and the
- LDT/GDT to transfer the actual data (ie. from a read system call) between
- user and kernel address spaces. Is this observation correct ?
-
- Thank you.
-
- Ron Prediger (ron@ramsey.cs.laurentian.ca)
-
-