OSA Unit - I

Category: Education

Presentation Description

General Overview: History of Unix, System Structure, User perspective, Operating system Services, Assumptions about Hardware


Presentation Transcript

Unit I: Introduction to Operating Systems:

Unit I: Introduction to Operating Systems Reference: The Design of Unix Operating System By, Maurice Bach


Index General Overview: History of Unix, System Structure, User perspective. Operating system Services, Assumptions about Hardware.

History of Unix:

History of Unix In the mid-960s , the Massachusetts Institute of Technology, AT&T Bell Labs, and General Electric developed an experimental time sharing operating system called Multics for the GE-645 mainframe. Multics introduced many innovations , but had many problems. Bell Labs, frustrated by the size and complexity of Multics but not the aims, slowly pulled out of the project. Their last researchers to leave Multics , Ken Thompson , Dennis Ritchie, M. D. McIlroy , and J. F. Ossanna , decided to redo the work on a much smaller scale. In 1970, Peter Neumann coined the project name Unics ( UNiplexed Information and Computing Service) as a pun on Multics , (Multiplexed Information and Computer Services). Eventually, Unics supported multiple simultaneous users, and it was renamed Unix . In 1972, Unix was rewritten in the C programming language

What is an Operating System?:

What is an Operating System? An Operating System is a program that acts as an interface between the user of a computer and the computer hardware. Operating system goals: Control/execute application programs. Make the computer system convenient to use. Make solving user problems easier. Use the computer hardware in an efficient manner.

System Structure :

System Structure Figure: Architecture of Unix System

System Structure :

System Structure High Level Architecture of Unix System Hardware at the center of the diagram, OS is commonly called as system kernel , Programs interact with kernel by invoking system calls, System call instructs kernel to do various operations, private user programs may also exist e.g., a.out, Other application programs can build on top of lower level programs.

User perspective:

User perspective The File System The Unix File system is characterized by A hierarchical structure, Consistent treatment of file data, The ability to create and delete files, Dynamic growth of files, The protection of file data, The treatment of peripherals devices as files.

File System Tree:

File System Tree root bin dev etc home lib sbin stand tmp usr var cat date who dsk rdsk user1 user2 unix bin include sbin f0q18dt login.sql progs

File System:

File System bin - Binary executable files lib - Library functions dev - Device related files etc - binary executable files for system administration tmp - Temporary files created by Unix users usr - Home directories of all users /usr/bin - Additional binary executable files

User perspective:

User perspective The File System The file system is organized as tree With single root node called root, non leaf node of FS is a directory, Leaf nodes of the tree are files. Path name describes how to locate the file in the FS, Absolute path starts with slash / Relative path Permission to access a file is controlled by access permission associated with the file, Access permission: read, write and execute, Three classes of Users: Owner, file group and everyone.

PowerPoint Presentation:

ls list files and directories ls -a list all files and directories mkdir make a directory cd directory change to named directory cd change to home-directory cd ~ change to home-directory cd .. change to parent directory pwd display the path of the current directory Commands

PowerPoint Presentation:

. and .. . current directory .. parent of the current directory ~ home directory cd- immediate forward/backward directory change

PowerPoint Presentation:

cp file1 file2 copy file1 and call it file2 mv file1 file2 move or rename file1 to file2 rm file remove a file rmdir directory remove a directory cat file display a file more file display a file a page at a time head file display the first few lines of a file tail file display the last few lines of a file grep 'keyword' file search a file for keywords wc file count number of lines/words/characters in file

User perspective:

User perspective Processing Environment A program is an executable file, and Process is an instance of program, Subjected to use of system calls, processes execute independently of each other , fork system call: to create process, new process is called as child process System calls allow user to write program that do sophisticated operation. User level program: shell allows three types of commands Executable file, Executable file that contains sequence of shell command lines, Internal command Shell usually executes a command synchronously : waiting for command to terminate before reading next commands, It also allows asynchronous execution.

PowerPoint Presentation:

Kernel It is core of the OS. Written mostly using C/Assembly. They interact with hardware directly. I t allocates time and memory to programs and handles the file store and communications in response to system calls. Shell It acts as an interface between the user and the kernel The shell is a command line interpreter (CLI) It interprets the commands the user types in and arranges for them to be carried out It is an interpreter and a programming language rolled into one. System Calls The functions which are used to communicate with the kernel are called system calls

PowerPoint Presentation:

Controlling the execution of processes by allowing their creation, suspension, communication and termination. Allocating main memory for an executing process Kernel can write a process temporally to secondary memory: is call swap device, if writes entire process to swap device : implementation is called as swapping system, Allocation secondary memory for efficient storage and retrieval of user data, Allocating processes controlled access to peripheral devices such as terminals, tape drive, disc drive and network devices. Services Provided by an OS

Assumption about Hardware:

Assumption about Hardware The execution of user processes on UNIX system is divided in two level User and kernel level Processes in user mode can access their own instructions and data but not kernel instruction and data, Process in kernel mode however, can access kernel and user addresses, Some machine instructions are privileged and result in error when executed in user mode. K K U U A B C D K U Figure: Multiple Processes and Mode of Execution

Assumption about Hardware:

Interrupts and Exceptions Interrupts The UNIX system allows devices such as I/O peripherals or the system clock to interrupt the CPU asynchronously. On receipt of interrupt , kernel saves current context, determines the cause of interrupt and services the interrupt. Interrupts happen between the executions of two instruction. Exceptions An exception condition refers to unexpected events caused by a process, addressing illegal memory, executing privileged instructions, divided by zero and so on. Exceptions happen in the middle of the execution of an instruction. Assumption about Hardware

authorStream Live Help