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
SinhVienZone.com
/>
1
UNIX
User
Interface
The layers of a UNIX system.
SinhVienZone.com
/>
2
UNIX Utility Programs
A few of the more common UNIX utility programs required by POSIX
SinhVienZone.com
/>
3
UNIX Kernel
Approximate structure of generic UNIX kernel
SinhVienZone.com
/>
4
Processes in UNIX
Process creation in UNIX.
SinhVienZone.com
/>
5
POSIX
The signals required by POSIX.
SinhVienZone.com
/>
6
System Calls for Process Management
s is an error code
pid is a process ID
residual
is the remaining time from the previous alarm
SinhVienZone.com
/>
7
POSIX Shell
A highly simplified shell
SinhVienZone.com
/>
8
Threads in POSIX
The principal POSIX thread calls.
SinhVienZone.com
/>
9
The ls Command
Steps in executing the command ls type to the shell
SinhVienZone.com
/>
10
Flags for Linux clone
Bits in the sharing_flags bitmap
SinhVienZone.com
/>
11
UNIX Scheduler
The UNIX scheduler is based on a multilevel queue structure
SinhVienZone.com
/>
12
Booting UNIX
cp
The sequences of processes used to boot some systems
SinhVienZone.com
/>
13
Handling Memory
Process A
Process B
• Process A's virtual address space
• Physical memory
• Process B's virtual address space
SinhVienZone.com
/>
14
Sharing Files
Two processes can share a mapped file.
A new file mapped simultaneously into two processes
SinhVienZone.com
/>
15
System Calls for Memory Management
•
•
•
•
•
•
•
SinhVienZone.com
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
/>
16
Paging in UNIX
The core map in 4BSD.
The core map has an entry for each page
SinhVienZone.com
/>
17
Paging in Linux (1)
Linux uses three-level page tables
SinhVienZone.com
/>
18
Paging in Linux (2)
Operation of the buddy algorithm.
Buddy algorithm
SinhVienZone.com
/>
19
Networking
Use of sockets for networking
SinhVienZone.com
/>
20
Terminal Management
The main POSIX calls for managing the terminal
SinhVienZone.com
/>
21
UNIX I/O (1)
Some of the fields of a typical cdevsw table
SinhVienZone.com
/>
22
UNIX I/O (2)
The UNIX I/O system in BSD
SinhVienZone.com
/>
23
Streams
An example of streams in System V
SinhVienZone.com
/>
24
The UNIX File System (1)
Some important directories found in most UNIX systems
SinhVienZone.com
/>
25