View
215
Download
0
Category
Preview:
Citation preview
Basic UNIX Concepts
Why We Need an Operating System (OS)
• OS interacts with hardware and manages programs.
• A safe environment for programs to run is required.
• Programs not expected to know which hardware they will run on.
• Must be possible to change hardware without changing the programs.
In Computing Today It Is Desirable To Be
•Multiprogramming: Multiple programs can be in memory.
•Multiuser: Multiple users can be on system.
•Multitasking: One user can run multiple programs.
What an OS Does When a Program Runs on a Computer
• OS loads program from disk and allocates memory and CPU.
• Instructions in program are run on CPU and OS keeps track of last
instruction executed.
• If program needs to access the hardware, OS does the job on its behalf.
• OS saves the state of the program if program has to leave CPU temporarily.
• OS cleans up memory and registers after process has completed execution.
A Little UNIX History
• 1969 Richie/Thompson at Bell Labs (AT&T) invent UNIX
• BSD UNIX from Berkeley created from AT&T version
• Fragmentation grows: Solaris, AIX, HP-UX, Tru64 UNIX
• System V from AT&T (SVR4) attempts unification
• AT&T -> Novell -> X/OPEN -> The Open Group (own trademark)
A Little UNIX History (continued)
• Early 80’s: BSD UNIX contains TCP/IP spurring growth of Internet
• Early 80’s: MIT develops X Windows, a windowing system for UNIX
• 1991: Linus Torvalds develops Linux, a free UNIX implementation
• IEEE POSIX – Portable Operating System Interface (for UNIX)– Defines standardized UNIX computing environment– OSs based on UNIX can claim conformity
• 2001: Single UNIX Specification Version 3 (SUSV3)
What Makes Unix Special
• It is written in a high-level language, C.
• Everything in the system is represented as a file – containers for information .
• Work gets done by processes – representations of programs in execution.
• Workload shared by two separate programs, the kernel and the shell
•Kernel - the core OS
•Shell – the interface between user and kernel (command line interpreter)
• Kernel uses system calls to do most of the work.
What Makes Unix Special (continued)
• It is multiprogramming, multitasking, and multiuser.
• UNIX ships with many useful tools (e.g., compilers, interpreters, filters, …).
• “Small is beautiful” philosophy. Pipes connect output of one command to the
input of another command (e.g., who | wc).
• UNIX provides strong pattern matching features (e.g., *.c)
•The shell is also a programming language (shell scripts)
• Online help is provided through the man command..
UNIX Architecture: The Kernel
• Loaded by the bootstrap program at startup.
• Program always resides in memory.
• Has direct access to the hardware.
• Handles file I/O.
• Manages processes.
• One copy shared by all users.
UNIX Architecture: The Shell
• Everyone has a login id/ password assigned by an administrator.
• After the user logs in, a shell program is invoked.
• The shell accepts user input, options, and parameters.
• The shell makes calls to the kernel to execute the user request.
• At least one shell is invoked by every user.
• User has a choice of shells: Bourne, C, Korn, Secure, Bash, …
A Typical UNIX Session
Recommended