Operating System It is the interface between user (application programs) and hardware. It is a program that controls the execution of application programs.

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Threads, SMP, and Microkernels
CSC 360- Instructor: K. Wu Overview of Operating Systems.
Operating System Structures
EEE 435 Principles of Operating Systems Operating System Concepts (Modern Operating Systems 1.5)
Chap 2 System Structures.
Operating System Structure
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
Computer Systems/Operating Systems - Class 8
Unix Systems Administration 1Y. K. Chang Reasons for UNIX’s success 4 Written in high level language –easy to read, understand, change, and move to other.
Figure 2.8 Compiler phases Compiling. Figure 2.9 Object module Linking.
Operating Systems: Software in the Background
Phones OFF Please Operating System Introduction Parminder Singh Kang Home:
1 Process Description and Control Chapter 3. 2 Process Management—Fundamental task of an OS The OS is responsible for: Allocation of resources to processes.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis.
Common System Components
Silberschatz, Galvin and Gagne  Operating System Concepts Common OS Components Process Management Memory Management File Management I/O System.
A. Frank - P. Weisberg Operating Systems Introduction to Tasks/Threads.
1 Threads Chapter 4 Reading: 4.1,4.4, Process Characteristics l Unit of resource ownership - process is allocated: n a virtual address space to.
What do operating systems do? manage processes manage memory and computer resources provide security features execute user programs make solving user.
Computer Organization Review and OS Introduction CS550 Operating Systems.
Operating System A program that controls the execution of application programs An interface between applications and hardware 1.
1 Lecture 4: Threads Operating System Fall Contents Overview: Processes & Threads Benefits of Threads Thread State and Operations User Thread.
Chapter 1. Introduction What is an Operating System? Mainframe Systems
Operating Systems.
LINUX System : Lecture 2 OS and UNIX summary Bong-Soo Sohn Assistant Professor School of Computer Science and Engineering Chung-Ang University Acknowledgement.
CSC 322 Operating Systems Concepts Lecture - 4: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Composition and Evolution of Operating Systems Introduction to Operating Systems: Module 2.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
Operating Systems David Goldschmidt, Ph.D. Computer Science The College of Saint Rose CIS 432.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Processes and Process Control 1. Processes and Process Control 2. Definitions of a Process 3. Systems state vs. Process State 4. A 2 State Process Model.
UNIX and Shell Programming
Distributed System Concepts and Architectures Services
Operating System Structure A key concept of operating systems is multiprogramming. –Goal of multiprogramming is to efficiently utilize all of the computing.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
UNIX Unit 1- Architecture of Unix - By Pratima.
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.
Hardware process When the computer is powered up, it begins to execute fetch-execute cycle for the program that is stored in memory at the boot strap entry.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
What is a Process ? A program in execution.
What is an operating system? Tool to make programmer's job easy Resource allocator – Must be fair; not partial to any process – Must discriminate between.
Concepts and Structures. Main difficulties with OS design synchronization ensure a program waiting for an I/O device receives the signal mutual exclusion.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services.
WHY AN OPERATING SYSTEM (OS) OS interacts with hardware and manages programs. Programs not expected to know which hardware they will run on. Must be possible.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
1.3 Operating system services An operating system provide services to programs and to the users of the program. It provides an environment for the execution.
CompSci 143A1 1. Introduction 1.1 The Role of Operating Systems - Bridge the “Semantic Gap” between Hardware and Application - Three Views of Operating.
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Introduction to Operating Systems Concepts
Module 3: Operating-System Structures
Processes and threads.
Introduction to Operating System (OS)
Chapter 2: System Structures
Chapter 3: Operating-System Structures
Mid Term review CSC345.
Threads Chapter 4.
Chapter 2: Operating-System Structures
Introduction to Operating Systems
Outline Operating System Organization Operating System Examples
Chapter 2: Operating-System Structures
Mr. M. D. Jamadar Assistant Professor
The UNIX Time Sharing System
Presentation transcript:

Operating System It is the interface between user (application programs) and hardware. It is a program that controls the execution of application programs and acts as an interface between the user of a computer and the computer hardware. Operating system is a software that enables all the programs we use. Examples – Windows, Linux, Unix, etc.

Operating System Goals Execute user programs and make solving user problems easier. Use the computer hardware in an efficient manner. Operating system performs basic tasks such as, 1.Controlling and allocating memory 2.Execute system requests as per their priority. 3.Controlling i/p and o/p devices. 4.Managing file systems.

Features of Operating System Multiprogramming : it is a technique to execute number of programs simultaneously by a single processor. Multitasking : Multiple jobs are executed by switching the CPU between them. In this, the CPU time is shared by different processes, so it is called as “Time sharing systems”. Multitasking or Time sharing is a logical extension of Multiprogramming.

UNIX operating system is popular from its beginning (from 1969), running on machines of varying processing power from microprocessor to mainframes and providing a common execution environment across them. UNIX OPERATING SYSTEM UNIX operating system is divided into two parts, first part consists of programs and services and second part consists of the operating system that supports these programs and services.

UNICS ( Uniplexed Information Computing System)  UNIX OS developed in 1969 by AT and T Bell lab in USA. UNIX OS is written in C language. It is designed by Ken Thompson. UNIX OS was first installed in PDP/7 machine. Unix system support other languages, including Fortran, Basic, Pascal, Ada, Cobol, Lisp, Prolog and also support any language that has a comipler or interpreter. Linux is the full name of the Kernel. It was created as a combination of the phrase “Linus UNIX”, after the original author Linus Torvalds.

1. System is written in a high-level language - easy to read, understand, change, move to other machine. 2. It has a simple user interface. 3. It provides many primitives that permit complex programs to be built from simpler programs. 4. It uses a hierarchical file system that allows easy maintenance and efficient implementation. 5. It uses a consistent file format (byte stream) - making programs easier to write 6. It provides a simple, consistent interface to peripheral devices. 7. It is a multi-user, multi-process system, each user can execute several processes simultaneously. Several reasons for popularity and success of the UNIX system :

Unix system structure Figure. Architecture of Unix OS

H/w at the centre provides the OS with basic services. OS interacts directly with the H/w, providing common services to programs Application programs interact with the kernel by invoking a well defined set of system calls. System calls instruct the kernel to do various operations for the calling program and exchange data between the kernel and the program. a.out – the standard name for executable files produced by the C compiler. Set of system calls and the internal algorithms that implement them form the body of the kernel.

High level features of the Unix system such as : 1.File system 2.Processing environment 3.Building block primitives User Perspective

1. File System The Unix file system is characterized by : 1.A hierarchical structure – as a tree with a root 2.Consistent treatment of file data – unformatted stream of bytes 3.The ability to create and delete files 4.Dynamic growth of files 5.The protection of file data – access permissions for three classes of users 6.The treatment of peripheral devices (such as terminals and tape units) as files

Figure. File System Tree

The file system is organized as a tree with a single root node (written “/”), every non-leaf node of the file system structure is a directory of files, and files at the leaf nodes of the tree are either directories, regular files, or special device files. The name of a file is given by a path name that describes how to locate the file in the FS hierarchy. A path name is a sequence of directory names separated by slash character that designates a file name.

A full path name starts with a “/” and specifies a file that can be found by starting at the FS root and traversing the file tree, following the branches that lead to successive directory names of the path name. Programs in the Unix system have no knowledge of the internal format in which the kernel stores file data, treating the data as an unformatted stream of bytes. Programs may interpret the byte stream as they wish, but the interpretation has no bearing on how the operating system stores the data.

The syntax of accessing the data in a file is defined by the system and is identical for all programs, but the semantics of the data are imposed by the program. Directories are like regular files, the system treats the data in a directory as a byte stream, but the data contains the names of the files in the directory in a predictable format.

Permission to access a file is controlled by access permissions associated with the file. Access permissions can be set independently to control read, write and execute permission for three classes of users : the file owner, a file group, other users. Users may create files if directory access permissions allow it. The newly created files are leaf nodes of the file system directory structure. To the user, the Unix system treats devices as if they were files.

2. Processing Environment Program - is an executable file Process - is an instance of the program in execution (program executing). Many processes can execute simultaneously on Unix systems (multiprogramming/multitasking) with no logical limit to their number and many instances of a program can exist simultaneously in the system.

Various system calls allow processes to create new processes, terminate processes, process execution and control reaction to various events. Four major system calls used for process control – fork, exec, wait, exit. Shell is a user program not the part of kernel. Shell is just a process that uses fork/exec/wait. Shell is the command interpreter program.

Shell searches for commands in a given sequence of directories. Shell usually executes a command synchronously and asynchronously. Synchronously – waiting for the cmd to terminate before reading the next cmd line. Asynchronously – it reads the next cmd line and executes it without waiting for the prior cmd to terminate. Commands executed asynchronously are said to execute in the background..

Users can use the C shell to provide a history mechanism and avoid retyping recently used commands instead of the Bourne shell (named after its inventor, Steve Bourne).

3. Building Block Primitives The Unix system to provide operating system primitives that enable users to write small, modular programs that can used as building blocks to build more complex programs. The second building block primitive is the pipe - a mechanism that allows a stream of data to be passed between reader and writer processes. Processes can redirect their standard output to a pipe to be read by other processes that have redirected their standard input to come from the pipe.

Operating System Services Controlling the execution of processes : creation, termination, suspension, communication. Scheduling of processes : processes share the CPU in a a time-shared manner, the CPU executes a process, the kernel suspends it when its time quantum elapses, and the kernel schedules another process to execute. The kernel later reschedules the suspended process. Allocating main memory for an executing process. If the system runs low on free memory, the kernel frees memory by writing a process temporarily to secondary memory, called a swap device.

Allocating secondary memory for efficient storage and retrieval of user data. Device management: hides device/regular file differences.

Assumptions About Hardware The execution of user processes on Unix systems is divided into two levels: 1.User mode 2.Kernel mode When a process executes a system call, the execution mode of the process changes from user mode to kernel mode. Hardware supports mode switching

Operating system tracks processes and switches between them The kernel distinguishes between processes and hardware distinguishes the mode of execution. Process executing in kernel mode allocates the resources or does the various operation.

Processes in user mode, can access their own instructions and data but not kernel instructions and data. Processes in kernel mode, can access kernel and user instructions and data.

Interrupts and Exceptions 1.Interrupts : Devices (I/O peripherals) interrupt the system asynchronously. On receipt of the interrupt, Kernel saves process current context ( a frozen image of what the process was doing), determines which interrupt occurred and "services" it. After interrupt servicing, kernel restores its interrupted context and proceeds process execution. Traps - program initiated interrupts

Device priorities are set in hardware design/cpu/interrupt handling circuitry. When the kernel services an interrupt, it blocks out lower priority interrupts but services higher priority interrupts. higher Priority | lower Priority Interrupt Level

2. Exceptions : Exceptions : refers to unexpected events caused by a process. e.g., divide by zero, executing privileged instructions, addressing illegal memory. Exceptions happen “ in the middle “ of the execution of an instruction, and the system attempts to restart the instruction after handling the exception. Interrupts are happen “between” the execution of two instructions, and the system continues with the next instruction after servicing the interrupt.

Memory Management Kernel permanently resides in main memory. When compiling a program, the compiler generates a set of addresses in the program that represent addresses of variables, and functions. Compiler generates the addresses as if the only process in the system.

When the program is to run on the machine, the kernel allocates space in main memory for it, but the virtual addresses generated by the compiler need not be identical to the physical addresses that they occupy in the machine. The kernel coordinates with the machine hardware to set up a virtual to physical address translation that maps the compiler-generated addresses to the physical machine addresses. The mapping depends on the capabilities of the machine hardware.