OS provide a user-friendly environment and manage resources of the computer system. Operating systems manage: –Processes –Memory –Storage –I/O subsystem.

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

Operating-System Structures
Interactive lesson about operating system
Processes Management.
Operating System Structures
Chap 2 System Structures.
Operating-System Structures
Chapter 2: Operating-System Structures
Cs238 Lecture 3 Operating System Structures Dr. Alan R. Davis.
Common System Components
Os31 Chapter 3 Operating-System Structures. os32 Outlines System Components Operating System Services System Calls System Programs System Structure Virtual.
Lecture 1: Introduction CS170 Spring 2015 Chapter 1, the text book. T. Yang.
Silberschatz, Galvin and Gagne  Operating System Concepts Common System Components Process Management Main Memory Management File Management.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Chapter 2: Operating-System Structures Modified from the text book.
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
What do operating systems do? manage processes manage memory and computer resources provide security features execute user programs make solving user.
General Information Class time (NC 441)
Chapter 1: Introduction. 1.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts What is an Operating System? A program that acts as an intermediary.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: Operating-System Structures.
Process Management A process is a program in execution. It is a unit of work within the system. Program is a passive entity, process is an active entity.
W EEK T HREE O PERATING S YSTEM S TRUCTURE. T OPICS TO BE DISCUSSED System Components Operating Systems Services User Operating System Interface System.
Overview Dr. Yingwu Zhu. What is an OS ? A program that acts as an intermediary between a user of a computer and the computer hardware. OS goals: – Execute.
OPERATING SYSTEM OVERVIEW. Contents Basic hardware elements.
Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Operating.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 1: Introduction.
2.1 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 2: Operating-System Structures Overview of topics covered Operating System Services.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 14, 2005 Chapter 2: Operating-System.
Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 2: Operating-System Structures.
Operating-System Structures. Operating System Services Operating systems provide an environment for execution of programs and services to programs and.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 3: Operating-System Structures System Components Operating System Services.
3.1 Operating System Chapter 3: Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual.
Operating systems manage: Processes Memory File systems.
OS, , Part I Operating - System Structures Department of Computer Engineering, PSUWannarat Suntiamorntut.
Shan Gao Fall 2007 Department of Computer Science Georgia State University.
Operating Systems Introduction to Operating System (OS)
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: Operating-System Structures.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: System Structures.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 3: Operating-System Structures System Components Operating System Services.
Introduction to Operating System. 1.1 What is Operating System? An operating system is a program that manages the computer hardware. It also provides.
Operating System (Reference : OS[Silberschatz] + Norton 6e book slides)
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
Chapter 1: Introduction Narzu Tarannum(NAT) Reff: BIS.
System Components Operating System Services System Calls.
Chapter 1: Introduction. 1.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Objectives To provide a grand tour of the major operating.
Introduction to Operating Systems Concepts
Chapter 2:Operating System Structures
Module 3: Operating-System Structures
Lecture 1-Part 2: Operating-System Structures
2. OPERATING SYSTEM 2.1 Operating System Function
Chapter 2: Operating-System Structures
Chapter 1: Introduction
Chapter 2: System Structures
Introduction to Operating System (OS)
Operating systems manage:
Chapter 2: Operating-System Structures
Chapter 2: Operating-System Structures
Chapter 2: Operating-System Structures
Chapter 2: Operating-System Structures
Chapter 2: System Structures
Chapter 3: Operating-System Structures
Chapter 2: Operating-System Structures
Introduction to Operating Systems
Chapter 2: Operating-System Structures
Chapter 2: Operating-System Structures
Chapter 2: Operating-System Structures
Operating Systems Structure
Chapter 2: Operating-System Structures
Chapter 2: Operating-System Structures
Presentation transcript:

OS provide a user-friendly environment and manage resources of the computer system. Operating systems manage: –Processes –Memory –Storage –I/O subsystem

Process Management A process is a program in execution. It is a unit of work within the system. Program is a passive entity, process is an active entity. Operating system controls execution of user and system processes. Process needs resources to accomplish its task –CPU, memory, I/O, files –Initialization data Process termination requires reclaim of any reusable resources

Process Management Activities The operating system is responsible for the following activities in connection with process management: Creating and deleting both user and system processes Suspending and resuming processes (context switching) Providing mechanisms for process synchronization Providing mechanisms for process communication

Memory Management Memory management activities –Keeping track of which parts of memory are currently being used and by whom –Deciding which processes (or parts thereof) and data to move into and out of memory –Allocating and deallocating memory space as needed

Storage Management OS provides uniform, logical view of information storage –Abstracts physical properties to logical storage unit - file

Storage Management File-System management –Files usually organized into directories –Access control on most systems to determine who can access what –OS activities include Creating and deleting files and directories Primitives to manipulate files and dirs Mapping files onto secondary storage Backup files onto stable (non-volatile) storage media

Disk Management OS activities –Free-space management –Disk-space allocation –Disk scheduling Some storage need not be fast –Tertiary storage includes optical storage, magnetic tape (often used for back-ups).

I/O Management One purpose of OS is to hide peculiarities of hardware devices from the user I/O subsystem responsible for –Memory management of I/O including buffering (storing data temporarily while it is being transferred), caching (storing parts of data in faster storage for performance), spooling (intercepting concurrent requests for device such as printer and ensuring sequential order, i.e., no interleaving of files). –General device-driver interface –Drivers for specific hardware devices

OS as Execution Environment Can also view the operating system as providing an environment for the execution of programs. –Provides services for user as well as user (and system) applications.

Services for User –User interface - Almost all operating systems have a user interface (UI) Varies between Command-Line Interface (CLI), Graphics User Interface (GUI), Batch –Program execution - The system must be able to load a program into memory and to run that program, end execution, either normally or abnormally (indicating error)

Operating System Services –I/O operations - A running program may require I/O, which may involve a file or an I/O device. –File-system manipulation - The file system is of particular interest. Obviously, programs need to read and write files and directories, create and delete them, search them, list file Information, permission management. –Communications – Processes may exchange information, on the same computer or between computers over a network Communications may be via shared memory or through message passing (packets moved by the OS)

Operating System Services –Error detection – OS needs to be constantly aware of possible errors May occur in the CPU and memory hardware, in I/O devices, in user program For each type of error, OS should take the appropriate action to ensure correct and consistent computing –Debugging facilities can greatly enhance the user’s and programmer’s abilities to efficiently use the system

Other Services Another set of OS functions exists for ensuring the efficient operation of the system itself via resource sharing –Resource allocation - When multiple users or multiple jobs running concurrently, resources must be allocated to each of them Many types of resources - CPU cycles, main memory, file storage, and I/O devices. –Accounting - To keep track of which users use how much and what kinds of computer resources

Operating System Services (Cont.) Protection and security - The owners of information stored in a multi-user or networked computer system may want to control use of that information, concurrent processes should not interfere with each other –Protection involves ensuring that all access to system resources is controlled E.g., base-limit registers for memory protection. Access lists on files. –Security of the system from outsiders. E.g., requiring user name and password.

User Operating System Interface - CLI CLI allows direct command entry Sometimes implemented in kernel, sometimes by systems program Sometimes multiple flavors implemented – shells Primarily fetches a command from user and executes it –Commands may be implemented in shell –Implemented through “system calls”. »Looks for program of that name. If found, executes it. If not, returns an error message.

User Operating System Interface - GUI User-friendly desktop metaphor interface –Usually mouse, keyboard, and monitor –Icons represent files, programs, actions, etc –Various mouse buttons over objects in the interface cause various actions (provide information, options, execute function, open directory (known as a folder) –Invented at Xerox PARC

System Calls Interface between executing program and OS defined by set of system calls OS provides. System call causes a TRAP to switch from user to kernel mode and starts execution at interrupt vector location for TRAP instruction. Operating system looks at requested operation and any parameters passed by the application. Dispatches the correct system call handler through a table of pointers to system call handlers. Handler completes and (may) return to user code at the next instruction. OS may schedule another process to execute.

Transition from User to Kernel Mode

System Calls Mostly accessed by programs via a high-level Application Program Interface (API) rather than direct system call use Three most common APIs are Win32 API for Windows, POSIX API for POSIX-based systems (including virtually all versions of UNIX, Linux, and Mac OS X), and Java API for the Java virtual machine (JVM) Why use APIs rather than system calls?

System Calls Why use APIs rather than system calls? –Portability: Code should run on any system that supports the same API.

System Calls Why use APIs rather than system calls? –Portability: Code should run on any system that supports the same API. –Ease of use. Some system calls are quite complex involving, for example, assembly code.

System Call Implementation High-level languages provide system-call interface. –Run-time libraries added by the compiler. Program makes an API call. Trapped by the run-time library. RTL places number of requested system call in correct register. Places parameters in appropriate locations. Makes system call.

System Call Implementation The standard I/O library in C (C++) is another high-level API. –Examples: fopen, printf, scanf, cin, cout …………… These are functions available to the program, but they are not system calls. Rather, they are replaced (at compile time) with calls to user-level libraries. –In C, these libraries are loaded into the application’s address space via the #include directive. –Actual system call made in the library.

Standard C Library Example C program invoking printf() library call, which calls write() system call. Library handles details of making system call (e.g., where to put parameters, system call id, etc. )