Upload
stjepansalopek
View
287
Download
1
Tags:
Embed Size (px)
DESCRIPTION
Unix and Linux
Citation preview
�1
UNIX and LINUX
History of UNIX and Linux "Overview of Linux "Processes in Linux "Memory management in Linux "Input/output in Linux "The Linux file system "Security in Linux "
!2
UNIX
Multiuser, multiprogrammed"Rich libraries"Portable"POSIX
!3
History
1971. Unix Version 1, Ken Thompson"1973. ported to C"1979. AT&T Unix V7"1980. BSD 4.0"1983. AT&T - Unix System V"1985. BSD 4.3"1989. AT&T - Unix System V R4.0"1991. Linux 0.01 (9.3k lines C, 950 lines assembly)"
1994. Linux 2.0 (165k lines)
!4
Linux
The layers of a UNIX system.
UserInterface
!5
Utility Programs
A few of the more common UNIX utility programs required by POSIX
!6
Kernel
Approximate structure of generic kernel
!7
Kernel
Approximate structure of Linux kernel
!8
Processes in UNIX
Process creation in UNIX.
!9
POSIX
The signals required by POSIX.
!10
System Calls for Process Management
s is an error code"pid is a process ID"residual is the remaining time from the previous alarm
!11
POSIX Shell
A highly simplified shell
!12
Threads in POSIX
The principal POSIX thread calls.
!13
The ls Command
Steps in executing the command ls type to the shell
!14
Flags for Linux clone
Bits in the sharing_flags bitmap
!15
UNIX Scheduler
The UNIX scheduler is based on a multilevel queue structure
!16
Linux Scheduler
• Real-time FIFO"• Real-time round robin"• Timesharing"
!17
Booting UNIX
The sequences of processes used to boot some systems
cp
!18
Handling Memory
• Process A's virtual address space"• Physical memory"• Process B's virtual address space
Process A Process B
!19
Sharing FilesTwo processes can share a mapped file.
A new file mapped simultaneously into two processes
!20
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
!21
Paging in Linux (1)
Linux uses four-level page tables
!22
Paging in Linux (2)
Operation of the buddy algorithm.
Buddy algorithm
!23
Networking
Use of sockets for networking
!24
Terminal Management
The main POSIX calls for managing the terminal
!25
I/O (1)
Some of the fields of a typical cdevsw table
!26
I/O (2)
The Linux I/O system
!27
The UNIX File System (1)
Some important directories found in most UNIX systems
!28
The UNIX File System (2)
• Before linking."• After linking.
(a) Before linking. (b) After linking
!29
The UNIX File System (3)
• Separate file systems"• After mounting
(a) (b)
(a) Before mounting. (b) After mounting
!30
Locking Files
(a) File with one lock"(b) Addition of a second lock"(c) A third lock
!31
System Calls for File Management
• s is an error code"• fd is a file descriptor"• position is a file offset
!32
The lstat System Call
Fields returned by the lstat system call.
!33
System Calls for Directory Management
• s is an error code"• dir identifies a directory stream"• dirent is a directory entry
!34
File System
Disk layout in classical UNIX systems
!35
File System
Directory entry fields.
Structure of the i-node
!36
File System
The relation between the file descriptor table, the open file description
!37
The Linux File System
Layout of the Linux Ex2 file system.
!38
File System
• A Linux directory with three files"• The same directory after the file voluminous has been
removed
!39
Network File System (1)
• Examples of remote mounted file systems"• Directories are shown as squares, files as circles
!40
Network File System (2)
The NFS layer structure.
The NFS layer structure
!41
Security in UNIX
Some examples of file protection modes
!42
System Calls for File Protection
• s is an error code"• uid and gid are the UID and GID, respectively