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