Documente Academic
Documente Profesional
Documente Cultură
A.2
UNIX History
First developed in 1969 by Ken Thompson and Dennis Ritchie of the
A.3
A.4
platform
Small size, modular, clean design
A.5
bytes
Supports multiple processes; a process can easily create new
processes
High priority given to making system interactive, and providing
A.6
Programmer Interface
Like most computer systems, UNIX consists of two separable parts:
Kernel: everything below the system-call interface and above
A.7
A.8
System Calls
System calls define the programmer interface to UNIX
The set of systems programs commonly available defines the user
interface
The programmer and user interface define the context that the
Process control
Information manipulation
A.9
File Manipulation
A file is a sequence of bytes; the kernel does not impose a
structure on files
Files are organized in tree-structured directories
Directories are files that contain information on how to find other
files
Path name: identifies a file by specifying a path through the
A.10
A.11
Process Control
A process is a program in execution
Processes are identified by their process identifier, an integer
Process control system calls
z
A.12
A.13
A.14
user identifier of the owner of the file, and leaves the real user
identifier as it was
setuid scheme allows certain processes to have more than
A.15
Signals
Facility for handling exceptional conditions similar to software
interrupts
The interrupt signal, SIGINT, is used to stop a command before
A.16
Process Groups
Set of related processes that cooperate to accomplish a common
task
Only one process group may use a terminal device for I/O at any
time
z
The foreground job has the attention of the user on the terminal
A.17
A.18
Information Manipulation
System calls to set and return an interval timer:
getitmer/setitmer
Calls to set and return the current time:
gettimeofday/settimeofday
Processes can ask for
z
A.19
Library Routines
The system-call interface to UNIX is supported and augmented by
in system calls
Additional library support is provided for mathematical functions,
A.20
User Interface
Programmers and users mainly deal with already existing systems
A.21
command interpreter)
Called a shell, because it surrounds the kernel
The shell indicates its readiness to accept another command by
search path
A.22
( ./home/prof/avi/bin
The shell usually suspends its own execution until the command
completes
A.23
Standard I/O
Most processes expect three file descriptors to be open when they
start:
z
Most programs can also accept a file (rather than a terminal) for
A.24
A.25
change the user view, but not change the kernel or programmer
interface
X Window System is a widely accepted iconic interface for UNIX
A.26
Process Management
Representation of processes is a major design problem for
operating system
UNIX is distinct from other systems in that multiple processes can
blocks
z
A.27
process structure
z
records were the page table for the text segment can be
found on disk when it is swapped
A.28
simultaneously
a kernel stack (rather than the user stack) is used for a process
A.29
A.30
new main memory is allocated for the data and stack segments
of the child process
A.31
new process simply shares the page table of the old one
z
new user structure and a new process structure are still created
A.32
CPU Scheduling
Every process has a scheduling priority associated with it; larger
an event
When that event occurs, the system process that knows about it
calls wakeup with the address corresponding to the event, and all
processes that had done a sleep on the same address are put in
the ready queue to be run
A.33
Memory Management
The initial memory management schemes were constrained in size
A.34
swap traffic and reduces the amount of main memory required for
multiple processes using the same text segment
The scheduler process (or swapper) decides which processes to
A.35
Paging
Berkeley UNIX systems depend primarily on paging for memory-
A.36
File System
The UNIX file system supports two main objects: files and
directories
Directories are just files with a special format, so the representation
A.37
blocks:
z
All the blocks of a file are of a large block size (such as 8K),
except the last
Thus, a file of size 18,000 bytes would have two 8K blocks and
one 2K fragment (which would not be filled completely)
A.38
A.39
Inodes
A file is represented by an inode a record that stores
Second
A
A.40
Directories
The inode type field distinguishes between plain files and
directories
Directory entries are of variable length; each entry contains first the
length of the entry, then the file name and the inode number
The user refers to a file by a path name,whereas the file system
The kernel has to map the supplied user path name to an inode
A.41
Directories (Cont.)
First determine the starting directory:
z
The search process continues until the end of the path name is
inode
4.3BSD improved file system performance by adding a directory
A.42
descriptor as an argument
The file descriptor is used by the kernel to index a table of open
A.43
A.44
Disk Structures
The one file system that a user ordinarily sees may actually consist
benefits
z
Reliability is improved
Prevents one program form using all available space for a large
file
A.45
A.46
A.47
Implementations
The user interface to the file system is simple and well defined,
truncate calls
A.48
identify a file
z
blocks in a file
z
A.49
A.50
I/O System
The I/O system hides the peculiarities of I/O devices from the bulk
of the kernel
Consists of a buffer caching system, general device driver code,
A.51
A.52
A.53
the percentage of cache hits can be high and the number of actual
I/O transfers low
Data written to a disk file are buffered in the cache, and the disk
A.54
a transfer size
A.55
C-Lists
Terminal drivers use a character buffering system which involves
queue and return characters directly form the raw queue raw
mode (used by full-screen editors and other programs that need to
react to every keystroke)
A.56
Interprocess Communication
The pipe is the IPC mechanism most characteristic of UNIX
z
A.57
Sockets
A socket is an endpont of communication
An in-use socket it usually bound with an address; the nature of the
A.58
Socket Types
Stream sockets provide reliable, duplex, sequenced data streams.
A.59
A.60
A.61
Network Support
Networking support is one of the most important features in
4.3BSD
The socket concept provides the programming mechanism to
A.62
A.63
End of Appendix A