Presentation is loading. Please wait.

Presentation is loading. Please wait.

Operating System Structures

Similar presentations

Presentation on theme: "Operating System Structures"— Presentation transcript:

1 Operating System Structures
Chapter 2 Operating System Structures

2 Common System Components
Due to the complex nature of the modern operating systems, it is partitioned into smaller component. Each component performs a well-defined function with well-defined inputs and outputs.

3 Common System Components
Process Management Main Memory Management File Management I/O System Management Secondary Management Networking Protection System User Interface/Command-Interpreter System

4 Basic OS Organization Each manager: Manager tasks
Works closely with other managers Performs a unique role Manager tasks Monitor its resources continuously Enforce policies determining: Who gets what, when, and how much Allocate the resource (when appropriate) Deallocate the resource (when appropriate)

5 Process Management A process is a program in execution (More about process in chapter 4) A process needs certain resources, including CPU time, memory, files, and I/O devices, to accomplish its task. These resources are either given to the process when it is created or when it is running. When the process completes, the OS reclaims all the resources.

6 Process Management 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 Providing mechanisms for process synchronization Providing mechanisms for process communication Providing mechanisms for deadlock handling

7 Main Memory Management
All data in memory before and after processing All instructions in memory in order to execute Memory management determines what is in memory when Optimizing CPU utilization and computer response to users Memory management activities include: 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

8 File Management Computers can store information on several different types of physical media (e.g. magnetic tap, magnetic disk, CD etc). For convenient use of the computer system, the OS provides a uniform logical view of information storage. A file is a logical storage unit, which abstract away the physical properties of its storage device. Commonly, files represent programs (both source and object forms) and data.

9 File Management The operating system is responsible for the following activities in connections with file management: 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

10 I/O System 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 (the overlapping of output of one job with input of other jobs) General device-driver interface Drivers for specific hardware devices

11 Secondary Storage Management
Since main memory (primary storage) is volatile and too small to accommodate all data and programs permanently, the computer system must provide secondary storage to back up main memory. Usually disks used to store data that does not fit in main memory or data that must be kept for a “long” period of time Proper management is of central importance Entire speed of computer operation hinges on disk subsystem and its algorithms

12 Secondary Storage Management
The operating system is responsible for the following activities in connection with disk management: Free space management Storage allocation Disk scheduling

13 Networking (Distributed Systems)
A distributed system provides user access to various system resources. Retains user access control

14 Protection System Protection – any mechanism for controlling access of processes or users to resources defined by the OS Security – defense of the system against internal and external attacks Huge range, including denial-of-service, worms, viruses, identity theft, theft of service Systems generally first distinguish among users, to determine who can do what User identities (user IDs, security IDs) include name and associated number, one per user User ID then associated with all files, processes of that user to determine access control Group identifier (group ID) allows set of users to be defined and controls managed, then also associated with each process, file Privilege escalation allows user to change to effective ID with more rights

15 Protection System The protection mechanism must:
Distinguish between authorized and unauthorized usage. Specify the controls to be imposed. Provide a means of enforcement.

16 Command-Interpreter System
Command Line Interface (CLI) or command interpreter 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 Sometimes commands built-in, sometimes just names of programs If the latter, adding new features doesn’t require shell modification

17 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 Many systems now include both CLI and GUI interfaces Microsoft Windows is GUI with CLI “command” shell Apple Mac OS X as “Aqua” GUI interface with UNIX kernel underneath and shells available Solaris is CLI with optional GUI interfaces (Java Desktop, KDE)

18 Summary of Functions Provided by OS

19 A View of Operating System Services

20 System Calls Programming interface to the services provided by the OS
Typically written in a high-level language (C or C++) 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?

21 Requesting Services from OS
System Call Process traps to OS Interrupt Handler Supervisor mode set Desired function executed Returns to application Message Passing User process constructs message indicating function (service needed) Invokes send to pass message to OS Process blocks …… OS receives message OS initiates function execution Upon function completion, OS returns “OK” Process unblock…

22 Requesting Services from OS

23 System Calls

24 System Calls C program invoking printf() library call, which calls write() system call

25 Types of System Calls Process control File management
Device management Information maintenance Communications Protection

26 Examples of Windows and Unix System Calls

Download ppt "Operating System Structures"

Similar presentations

Ads by Google