Chapter 10


Published on

Published in: Education, Technology
  • Be the first to comment

Chapter 10

  1. 1. Case Study 1: UNIX and LINUX Chapter 10 10.1 History of unix 10.2 Overview of unix 10.3 Processes in unix 10.4 Memory management in unix 10.5 Input/output in unix 10.6 The unix file system 10.7 Security in unix
  2. 2. UNIX <ul><li>The layers of a UNIX system. </li></ul>User Interface
  3. 3. UNIX Utility Programs <ul><li>A few of the more common UNIX utility programs required by POSIX </li></ul>
  4. 4. UNIX Kernel <ul><li>Approximate structure of generic UNIX kernel </li></ul>
  5. 5. Processes in UNIX <ul><li>Process creation in UNIX. </li></ul>
  6. 6. POSIX <ul><li>The signals required by POSIX. </li></ul>
  7. 7. System Calls for Process Management <ul><li>s is an error code </li></ul><ul><li>pid is a process ID </li></ul><ul><li>residual is the remaining time from the previous alarm </li></ul>
  8. 8. POSIX Shell <ul><li>A highly simplified shell </li></ul>
  9. 9. Threads in POSIX <ul><li>The principal POSIX thread calls. </li></ul>
  10. 10. The ls Command <ul><li>Steps in executing the command ls type to the shell </li></ul>
  11. 11. Flags for Linux clone <ul><li>Bits in the sharing_flags bitmap </li></ul>
  12. 12. UNIX Scheduler <ul><li>The UNIX scheduler is based on a multilevel queue structure </li></ul>
  13. 13. Booting UNIX <ul><li>The sequences of processes used to boot some systems </li></ul>cp
  14. 14. Handling Memory <ul><li>Process A's virtual address space </li></ul><ul><li>Physical memory </li></ul><ul><li>Process B's virtual address space </li></ul>Process A Process B
  15. 15. Sharing Files <ul><li>Two processes can share a mapped file. </li></ul>A new file mapped simultaneously into two processes
  16. 16. System Calls for Memory Management <ul><li>s is an error code </li></ul><ul><li>b and addr are memory addresses </li></ul><ul><li>len is a length </li></ul><ul><li>prot controls protection </li></ul><ul><li>flags are miscellaneous bits </li></ul><ul><li>fd is a file descriptor </li></ul><ul><li>offset is a file offset </li></ul>
  17. 17. Paging in UNIX <ul><li>The core map in 4BSD. </li></ul>The core map has an entry for each page
  18. 18. Paging in Linux (1) <ul><li>Linux uses three-level page tables </li></ul>
  19. 19. Paging in Linux (2) <ul><li>Operation of the buddy algorithm. </li></ul>Buddy algorithm
  20. 20. Networking <ul><li>Use of sockets for networking </li></ul>
  21. 21. Terminal Management <ul><li>The main POSIX calls for managing the terminal </li></ul>
  22. 22. UNIX I/O (1) <ul><li>Some of the fields of a typical cdevsw table </li></ul>
  23. 23. UNIX I/O (2) <ul><li>The UNIX I/O system in BSD </li></ul>
  24. 24. Streams <ul><li>An example of streams in System V </li></ul>
  25. 25. The UNIX File System (1) <ul><li>Some important directories found in most UNIX systems </li></ul>
  26. 26. The UNIX File System (2) <ul><li>Before linking. </li></ul><ul><li>After linking. </li></ul>(a) Before linking. (b) After linking
  27. 27. The UNIX File System (3) <ul><li>Separate file systems </li></ul><ul><li>After mounting </li></ul>(a) (b) (a) Before mounting. (b) After mounting
  28. 28. Locking Files <ul><li>(a) File with one lock </li></ul><ul><li>(b) Addition of a second lock </li></ul><ul><li>(c) A third lock </li></ul>
  29. 29. System Calls for File Management <ul><li>s is an error code </li></ul><ul><li>fd is a file descriptor </li></ul><ul><li>position is a file offset </li></ul>
  30. 30. The lstat System Call <ul><li>Fields returned by the lstat system call. </li></ul>
  31. 31. System Calls for Directory Management <ul><li>s is an error code </li></ul><ul><li>dir identifies a directory stream </li></ul><ul><li>dirent is a directory entry </li></ul>
  32. 32. UNIX File System (1) <ul><li>Disk layout in classical UNIX systems </li></ul>
  33. 33. UNIX File System (2) <ul><li>Directory entry fields. </li></ul>Structure of the i-node
  34. 34. UNIX File System (3) <ul><li>The relation between the file descriptor table, the open file description </li></ul>
  35. 35. UNIX File System (4) <ul><li>A BSD directory with three files </li></ul><ul><li>The same directory after the file voluminous has been removed </li></ul>
  36. 36. The Linux File System <ul><li>Layout of the Linux Ex2 file system. </li></ul>
  37. 37. Network File System (1) <ul><li>Examples of remote mounted file systems </li></ul><ul><li>Directories are shown as squares, files as circles </li></ul>
  38. 38. Network File System (2) <ul><li>The NFS layer structure. </li></ul>The NFS layer structure
  39. 39. Security in UNIX <ul><li>Some examples of file protection modes </li></ul>
  40. 40. System Calls for File Protection <ul><li>s is an error code </li></ul><ul><li>uid and gid are the UID and GID, respectively </li></ul>