home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / os / linux / 8632 < prev    next >
Encoding:
Text File  |  1992-08-19  |  1.7 KB  |  37 lines

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