introduction to operating systems - part2

99
Introduction to Operating Systems (Part II) Amir H. Payberah [email protected] Amirkabir University of Technology (Tehran Polytechnic) Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 1 / 45

Upload: amir-payberah

Post on 15-Jul-2015

102 views

Category:

Software


13 download

TRANSCRIPT

Page 1: Introduction to Operating Systems - Part2

Introduction to Operating Systems(Part II)

Amir H. [email protected]

Amirkabir University of Technology(Tehran Polytechnic)

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 1 / 45

Page 2: Introduction to Operating Systems - Part2

Computer System Architecture

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 2 / 45

Page 3: Introduction to Operating Systems - Part2

Computer System Architecture

I A computer system can be organized in a number of different ways,e.g., number of general-purpose processors:

• Single processor systems

• Multiprocessor systems

• Clustered systems

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 3 / 45

Page 4: Introduction to Operating Systems - Part2

Multiprocessor Systems

I Also known as parallel systems or tightly-coupled systems.

I Advantages include:• Increased throughput• Economy of scale• Increased reliability

I New trends in multiprocessor systems:• Multicore systems• Blade servers

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 4 / 45

Page 5: Introduction to Operating Systems - Part2

Multiprocessor Systems

I Also known as parallel systems or tightly-coupled systems.

I Advantages include:• Increased throughput• Economy of scale• Increased reliability

I New trends in multiprocessor systems:• Multicore systems• Blade servers

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 4 / 45

Page 6: Introduction to Operating Systems - Part2

Multiprocessor Systems

I Also known as parallel systems or tightly-coupled systems.

I Advantages include:• Increased throughput• Economy of scale• Increased reliability

I New trends in multiprocessor systems:• Multicore systems• Blade servers

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 4 / 45

Page 7: Introduction to Operating Systems - Part2

Multicore Systems

I Including multiple computing cores on a single chip.

I They can be more efficient than multiple chips with single cores:

• Faster communication• Less power consumption

[A dual-core design with two cores placed on the same chip]

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 5 / 45

Page 8: Introduction to Operating Systems - Part2

Multicore Systems

I Including multiple computing cores on a single chip.

I They can be more efficient than multiple chips with single cores:

• Faster communication• Less power consumption

[A dual-core design with two cores placed on the same chip]

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 5 / 45

Page 9: Introduction to Operating Systems - Part2

Multicore Systems

I Including multiple computing cores on a single chip.

I They can be more efficient than multiple chips with single cores:• Faster communication

• Less power consumption

[A dual-core design with two cores placed on the same chip]

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 5 / 45

Page 10: Introduction to Operating Systems - Part2

Multicore Systems

I Including multiple computing cores on a single chip.

I They can be more efficient than multiple chips with single cores:• Faster communication• Less power consumption

[A dual-core design with two cores placed on the same chip]

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 5 / 45

Page 11: Introduction to Operating Systems - Part2

Blade Servers

I Multiple processor boards, I/O boards, and networking boards areplaced in the same chassis.

I Each blade-processor board boots independently and runs its ownoperating system.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 6 / 45

Page 12: Introduction to Operating Systems - Part2

Clustered Servers

I Like multiprocessor systems, but multiple systems working together.

I Usually sharing storage via a storage-area network (SAN).

[General structure of a clustered system]

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 7 / 45

Page 13: Introduction to Operating Systems - Part2

Operating System Structure

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 8 / 45

Page 14: Introduction to Operating Systems - Part2

Multiprogramming (1/2)

I Multiprogramming (batch system).

I CPU always has one to execute: efficiency.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 9 / 45

Page 15: Introduction to Operating Systems - Part2

Multiprogramming (1/2)

I Multiprogramming (batch system).

I CPU always has one to execute: efficiency.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 9 / 45

Page 16: Introduction to Operating Systems - Part2

Multiprogramming (2/2)

I A subset of total jobs in system is kept in memory.

I One job selected and run via job scheduling.

I When it has to wait (for I/O for example),OS switches to another job.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 10 / 45

Page 17: Introduction to Operating Systems - Part2

Multiprogramming (2/2)

I A subset of total jobs in system is kept in memory.

I One job selected and run via job scheduling.

I When it has to wait (for I/O for example),OS switches to another job.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 10 / 45

Page 18: Introduction to Operating Systems - Part2

Multiprogramming (2/2)

I A subset of total jobs in system is kept in memory.

I One job selected and run via job scheduling.

I When it has to wait (for I/O for example),OS switches to another job.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 10 / 45

Page 19: Introduction to Operating Systems - Part2

Timesharing

I Timesharing (multitasking)

• Providing each user with a small portion of a time-shared computer.

• Each user has at least one separate program in memory, called aprocess.

• Each process typically executes for only a short time.

• If several jobs ready to run at the same time → CPU scheduling

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 11 / 45

Page 20: Introduction to Operating Systems - Part2

Timesharing

I Timesharing (multitasking)

• Providing each user with a small portion of a time-shared computer.

• Each user has at least one separate program in memory, called aprocess.

• Each process typically executes for only a short time.

• If several jobs ready to run at the same time → CPU scheduling

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 11 / 45

Page 21: Introduction to Operating Systems - Part2

Timesharing

I Timesharing (multitasking)

• Providing each user with a small portion of a time-shared computer.

• Each user has at least one separate program in memory, called aprocess.

• Each process typically executes for only a short time.

• If several jobs ready to run at the same time → CPU scheduling

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 11 / 45

Page 22: Introduction to Operating Systems - Part2

Timesharing

I Timesharing (multitasking)

• Providing each user with a small portion of a time-shared computer.

• Each user has at least one separate program in memory, called aprocess.

• Each process typically executes for only a short time.

• If several jobs ready to run at the same time → CPU scheduling

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 11 / 45

Page 23: Introduction to Operating Systems - Part2

Timesharing

I Timesharing (multitasking)

• Providing each user with a small portion of a time-shared computer.

• Each user has at least one separate program in memory, called aprocess.

• Each process typically executes for only a short time.

• If several jobs ready to run at the same time → CPU scheduling

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 11 / 45

Page 24: Introduction to Operating Systems - Part2

Dual-Mode Operation (1/2)

I The OS and the users share the hardware and software resources ofthe computer system.

I We need to make sure that an error in a user program could causeproblems only for the one program running.

• E.g., stuck on an infinite loop

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 12 / 45

Page 25: Introduction to Operating Systems - Part2

Dual-Mode Operation (1/2)

I The OS and the users share the hardware and software resources ofthe computer system.

I We need to make sure that an error in a user program could causeproblems only for the one program running.

• E.g., stuck on an infinite loop

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 12 / 45

Page 26: Introduction to Operating Systems - Part2

Dual-Mode Operation (2/2)

I Dual-mode operation allows OS to protect itself and other systemcomponents.

• User mode and kernel mode.• System call changes mode to kernel, return from call resets it to

user.

[Transition from user to kernel mode]

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 13 / 45

Page 27: Introduction to Operating Systems - Part2

Dual-Mode Operation (2/2)

I Dual-mode operation allows OS to protect itself and other systemcomponents.

• User mode and kernel mode.

• System call changes mode to kernel, return from call resets it touser.

[Transition from user to kernel mode]

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 13 / 45

Page 28: Introduction to Operating Systems - Part2

Dual-Mode Operation (2/2)

I Dual-mode operation allows OS to protect itself and other systemcomponents.

• User mode and kernel mode.• System call changes mode to kernel, return from call resets it to

user.

[Transition from user to kernel mode]

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 13 / 45

Page 29: Introduction to Operating Systems - Part2

Operating System Structure

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 14 / 45

Page 30: Introduction to Operating Systems - Part2

User Space

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 15 / 45

Page 31: Introduction to Operating Systems - Part2

Programs

I Kernel: the program running at all times on a computer.

I Everything else is either:• a system program, or• an application program

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 16 / 45

Page 32: Introduction to Operating Systems - Part2

Programs

I Kernel: the program running at all times on a computer.

I Everything else is either:• a system program, or• an application program

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 16 / 45

Page 33: Introduction to Operating Systems - Part2

System Programs (1/4)

I Most users’ view of an OS is defined by system programs.

I System programs include:• File manipulation• Status information• Programming language support• Communications• Background services

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 17 / 45

Page 34: Introduction to Operating Systems - Part2

System Programs (1/4)

I Most users’ view of an OS is defined by system programs.

I System programs include:• File manipulation• Status information• Programming language support• Communications• Background services

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 17 / 45

Page 35: Introduction to Operating Systems - Part2

System Programs (2/4)

I File management• Create, delete, copy, rename, print, dump, list, and generally

manipulate files and directories.

I File modification• Text editors to create and modify files.• Special commands to search contents of files or perform

transformations of the text.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 18 / 45

Page 36: Introduction to Operating Systems - Part2

System Programs (2/4)

I File management• Create, delete, copy, rename, print, dump, list, and generally

manipulate files and directories.

I File modification• Text editors to create and modify files.• Special commands to search contents of files or perform

transformations of the text.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 18 / 45

Page 37: Introduction to Operating Systems - Part2

System Programs (3/4)

I Status information• Asking the system info: date, time, amount of available memory, ...

I Programming-language support• Compilers, assemblers, debuggers and interpreters sometimes

provided.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 19 / 45

Page 38: Introduction to Operating Systems - Part2

System Programs (3/4)

I Status information• Asking the system info: date, time, amount of available memory, ...

I Programming-language support• Compilers, assemblers, debuggers and interpreters sometimes

provided.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 19 / 45

Page 39: Introduction to Operating Systems - Part2

System Programs (4/4)

I Communications• A mechanism to make connections among processes, users, and

computers.

I Background services• Launch at boot time, called services or daemons.• Provide facilities like disk checking, process scheduling, error

logging, printing.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 20 / 45

Page 40: Introduction to Operating Systems - Part2

System Programs (4/4)

I Communications• A mechanism to make connections among processes, users, and

computers.

I Background services• Launch at boot time, called services or daemons.• Provide facilities like disk checking, process scheduling, error

logging, printing.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 20 / 45

Page 41: Introduction to Operating Systems - Part2

Application Programs

I Run by users.

I Not typically considered part of OS.

I Launched by command line, mouse click, finger poke.

I Web browsers, word processors, database systems, compilers,games, ...

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 21 / 45

Page 42: Introduction to Operating Systems - Part2

User Operating System Interface

I Almost all operating systems have a user interface (UI).

• Command Line Interface (CLI)

• Graphics User Interface (GUI)

• Batch

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 22 / 45

Page 43: Introduction to Operating Systems - Part2

Command Line Interface (1/2)

I Allows direct command entry.

I Sometimes implemented in kernel, sometimes by systems program.

I Sometimes commands built-in, sometimes just names of programs.

I Sometimes multiple flavors implemented - shell.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 23 / 45

Page 44: Introduction to Operating Systems - Part2

Command Line Interface (1/2)

I Allows direct command entry.

I Sometimes implemented in kernel, sometimes by systems program.

I Sometimes commands built-in, sometimes just names of programs.

I Sometimes multiple flavors implemented - shell.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 23 / 45

Page 45: Introduction to Operating Systems - Part2

Command Line Interface (1/2)

I Allows direct command entry.

I Sometimes implemented in kernel, sometimes by systems program.

I Sometimes commands built-in, sometimes just names of programs.

I Sometimes multiple flavors implemented - shell.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 23 / 45

Page 46: Introduction to Operating Systems - Part2

Command Line Interface (1/2)

I Allows direct command entry.

I Sometimes implemented in kernel, sometimes by systems program.

I Sometimes commands built-in, sometimes just names of programs.

I Sometimes multiple flavors implemented - shell.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 23 / 45

Page 47: Introduction to Operating Systems - Part2

Command Line Interface (2/2)

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 24 / 45

Page 48: Introduction to Operating Systems - Part2

Graphical Line Interface (1/2)

I User-friendly desktop metaphor interface.

I Icons represent files, programs, actions, ...

I Various mouse buttons over objects in the interface cause variousactions.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 25 / 45

Page 49: Introduction to Operating Systems - Part2

Graphical Line Interface (1/2)

I User-friendly desktop metaphor interface.

I Icons represent files, programs, actions, ...

I Various mouse buttons over objects in the interface cause variousactions.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 25 / 45

Page 50: Introduction to Operating Systems - Part2

Graphical Line Interface (1/2)

I User-friendly desktop metaphor interface.

I Icons represent files, programs, actions, ...

I Various mouse buttons over objects in the interface cause variousactions.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 25 / 45

Page 51: Introduction to Operating Systems - Part2

Graphical Line Interface (2/2)

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 26 / 45

Page 52: Introduction to Operating Systems - Part2

Batch Interface

I Commands and directives to control those commands are enteredinto files, and those files are executed.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 27 / 45

Page 53: Introduction to Operating Systems - Part2

Kernel Space

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 28 / 45

Page 54: Introduction to Operating Systems - Part2

Operating System Structure

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 29 / 45

Page 55: Introduction to Operating Systems - Part2

Splitting the Kernel

I The kernel’s role can be split into the following parts• Process management• Memory management• Storage management and File system• Device control and I/O subsystem• Protection and security

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 30 / 45

Page 56: Introduction to Operating Systems - Part2

Process Management (1/2)

I A process is a program in execution.

• Program is a passive entity, process is an active entity.

I A process needs resources to accomplish its task.• CPU, memory, I/O, files, initialization data, ...

I Process termination requires reclaim of any reusable resources.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 31 / 45

Page 57: Introduction to Operating Systems - Part2

Process Management (1/2)

I A process is a program in execution.• Program is a passive entity, process is an active entity.

I A process needs resources to accomplish its task.• CPU, memory, I/O, files, initialization data, ...

I Process termination requires reclaim of any reusable resources.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 31 / 45

Page 58: Introduction to Operating Systems - Part2

Process Management (1/2)

I A process is a program in execution.• Program is a passive entity, process is an active entity.

I A process needs resources to accomplish its task.• CPU, memory, I/O, files, initialization data, ...

I Process termination requires reclaim of any reusable resources.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 31 / 45

Page 59: Introduction to Operating Systems - Part2

Process Management (1/2)

I A process is a program in execution.• Program is a passive entity, process is an active entity.

I A process needs resources to accomplish its task.• CPU, memory, I/O, files, initialization data, ...

I Process termination requires reclaim of any reusable resources.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 31 / 45

Page 60: Introduction to Operating Systems - Part2

Process Management (2/2)

I Process management activities:

• Scheduling processes and threads on the CPUs.

• Creating and deleting both user and system processes.

• Suspending and resuming processes.

• Providing mechanisms for process synchronization.

• Providing mechanisms for process communication.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 32 / 45

Page 61: Introduction to Operating Systems - Part2

Process Management (2/2)

I Process management activities:

• Scheduling processes and threads on the CPUs.

• Creating and deleting both user and system processes.

• Suspending and resuming processes.

• Providing mechanisms for process synchronization.

• Providing mechanisms for process communication.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 32 / 45

Page 62: Introduction to Operating Systems - Part2

Process Management (2/2)

I Process management activities:

• Scheduling processes and threads on the CPUs.

• Creating and deleting both user and system processes.

• Suspending and resuming processes.

• Providing mechanisms for process synchronization.

• Providing mechanisms for process communication.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 32 / 45

Page 63: Introduction to Operating Systems - Part2

Process Management (2/2)

I Process management activities:

• Scheduling processes and threads on the CPUs.

• Creating and deleting both user and system processes.

• Suspending and resuming processes.

• Providing mechanisms for process synchronization.

• Providing mechanisms for process communication.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 32 / 45

Page 64: Introduction to Operating Systems - Part2

Process Management (2/2)

I Process management activities:

• Scheduling processes and threads on the CPUs.

• Creating and deleting both user and system processes.

• Suspending and resuming processes.

• Providing mechanisms for process synchronization.

• Providing mechanisms for process communication.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 32 / 45

Page 65: Introduction to Operating Systems - Part2

Process Management (2/2)

I Process management activities:

• Scheduling processes and threads on the CPUs.

• Creating and deleting both user and system processes.

• Suspending and resuming processes.

• Providing mechanisms for process synchronization.

• Providing mechanisms for process communication.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 32 / 45

Page 66: Introduction to Operating Systems - Part2

Memory Management (1/2)

I To execute a program all (or part) of the instructions must be inmemory.

I All (or part) of the data that is needed by the program must be inmemory.

I Memory management determines what is in memory and when.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 33 / 45

Page 67: Introduction to Operating Systems - Part2

Memory Management (1/2)

I To execute a program all (or part) of the instructions must be inmemory.

I All (or part) of the data that is needed by the program must be inmemory.

I Memory management determines what is in memory and when.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 33 / 45

Page 68: Introduction to Operating Systems - Part2

Memory Management (1/2)

I To execute a program all (or part) of the instructions must be inmemory.

I All (or part) of the data that is needed by the program must be inmemory.

I Memory management determines what is in memory and when.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 33 / 45

Page 69: Introduction to Operating Systems - Part2

Memory Management (2/2)

I Memory management activities:

• Keeping track of which parts of memory are currently being usedand by whom.

• Deciding which processes (or parts of) and data to move into andout of memory.

• Allocating and deallocating memory space as needed.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 34 / 45

Page 70: Introduction to Operating Systems - Part2

Memory Management (2/2)

I Memory management activities:

• Keeping track of which parts of memory are currently being usedand by whom.

• Deciding which processes (or parts of) and data to move into andout of memory.

• Allocating and deallocating memory space as needed.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 34 / 45

Page 71: Introduction to Operating Systems - Part2

Memory Management (2/2)

I Memory management activities:

• Keeping track of which parts of memory are currently being usedand by whom.

• Deciding which processes (or parts of) and data to move into andout of memory.

• Allocating and deallocating memory space as needed.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 34 / 45

Page 72: Introduction to Operating Systems - Part2

Memory Management (2/2)

I Memory management activities:

• Keeping track of which parts of memory are currently being usedand by whom.

• Deciding which processes (or parts of) and data to move into andout of memory.

• Allocating and deallocating memory space as needed.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 34 / 45

Page 73: Introduction to Operating Systems - Part2

Storage Management (1/5)

I OS provides uniform and logical view of information storage.

I OS abstracts physical properties to logical storage unit, called file.

• A file is a collection of related information (programs or data).• Files usually organized into directories.

I OS maps files onto physical media and accesses these files via thestorage devices, e.g., disk drive, tape drive.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 35 / 45

Page 74: Introduction to Operating Systems - Part2

Storage Management (1/5)

I OS provides uniform and logical view of information storage.

I OS abstracts physical properties to logical storage unit, called file.

• A file is a collection of related information (programs or data).• Files usually organized into directories.

I OS maps files onto physical media and accesses these files via thestorage devices, e.g., disk drive, tape drive.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 35 / 45

Page 75: Introduction to Operating Systems - Part2

Storage Management (1/5)

I OS provides uniform and logical view of information storage.

I OS abstracts physical properties to logical storage unit, called file.• A file is a collection of related information (programs or data).

• Files usually organized into directories.

I OS maps files onto physical media and accesses these files via thestorage devices, e.g., disk drive, tape drive.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 35 / 45

Page 76: Introduction to Operating Systems - Part2

Storage Management (1/5)

I OS provides uniform and logical view of information storage.

I OS abstracts physical properties to logical storage unit, called file.• A file is a collection of related information (programs or data).• Files usually organized into directories.

I OS maps files onto physical media and accesses these files via thestorage devices, e.g., disk drive, tape drive.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 35 / 45

Page 77: Introduction to Operating Systems - Part2

Storage Management (1/5)

I OS provides uniform and logical view of information storage.

I OS abstracts physical properties to logical storage unit, called file.• A file is a collection of related information (programs or data).• Files usually organized into directories.

I OS maps files onto physical media and accesses these files via thestorage devices, e.g., disk drive, tape drive.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 35 / 45

Page 78: Introduction to Operating Systems - Part2

Storage Management (2/5)

I File management activities:

• Creating and deleting files and directories.

• Primitives to manipulate files and directories.

• Mapping files onto secondary storage.

• Backup files onto stable (non-volatile) storage media.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 36 / 45

Page 79: Introduction to Operating Systems - Part2

Storage Management (2/5)

I File management activities:

• Creating and deleting files and directories.

• Primitives to manipulate files and directories.

• Mapping files onto secondary storage.

• Backup files onto stable (non-volatile) storage media.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 36 / 45

Page 80: Introduction to Operating Systems - Part2

Storage Management (2/5)

I File management activities:

• Creating and deleting files and directories.

• Primitives to manipulate files and directories.

• Mapping files onto secondary storage.

• Backup files onto stable (non-volatile) storage media.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 36 / 45

Page 81: Introduction to Operating Systems - Part2

Storage Management (2/5)

I File management activities:

• Creating and deleting files and directories.

• Primitives to manipulate files and directories.

• Mapping files onto secondary storage.

• Backup files onto stable (non-volatile) storage media.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 36 / 45

Page 82: Introduction to Operating Systems - Part2

Storage Management (2/5)

I File management activities:

• Creating and deleting files and directories.

• Primitives to manipulate files and directories.

• Mapping files onto secondary storage.

• Backup files onto stable (non-volatile) storage media.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 36 / 45

Page 83: Introduction to Operating Systems - Part2

Storage Management (3/5)

I Usually disks used to store data that does not fit in main memoryor data that must be kept for a long period of time.

I Disk management activities:• Free-space management• Storage allocation• Disk scheduling

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 37 / 45

Page 84: Introduction to Operating Systems - Part2

Storage Management (3/5)

I Usually disks used to store data that does not fit in main memoryor data that must be kept for a long period of time.

I Disk management activities:• Free-space management• Storage allocation• Disk scheduling

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 37 / 45

Page 85: Introduction to Operating Systems - Part2

Storage Management (4/5)

[Cost vs. Speed of various levels of storage]

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 38 / 45

Page 86: Introduction to Operating Systems - Part2

Storage Management (5/5)

I Caching

I Copying information from slower to faster storage temporarily.

I Faster storage (cache) checked first to determine if information isthere

• If it is, information used directly from the cache (fast).• If not, data copied to cache and used there.

[Migration of data A from Disk to Register]

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 39 / 45

Page 87: Introduction to Operating Systems - Part2

Storage Management (5/5)

I Caching

I Copying information from slower to faster storage temporarily.

I Faster storage (cache) checked first to determine if information isthere

• If it is, information used directly from the cache (fast).• If not, data copied to cache and used there.

[Migration of data A from Disk to Register]

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 39 / 45

Page 88: Introduction to Operating Systems - Part2

I/O Subsystem

I Hides the details of the hardware devices from users.

I The I/O subsystem consists of several components, e.g., devicedrivers for specific hardware devices.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 40 / 45

Page 89: Introduction to Operating Systems - Part2

Protection and Security (1/2)

I Protection: any mechanism for controlling access of processes orusers to resources defined by the OS.

I Security: defense of the system against internal and external attacks.

• E.g., denial-of-service, worms, viruses, identity theft, theft ofservice, ...

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 41 / 45

Page 90: Introduction to Operating Systems - Part2

Protection and Security (1/2)

I Protection: any mechanism for controlling access of processes orusers to resources defined by the OS.

I Security: defense of the system against internal and external attacks.

• E.g., denial-of-service, worms, viruses, identity theft, theft ofservice, ...

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 41 / 45

Page 91: Introduction to Operating Systems - Part2

Protection and Security (2/2)

I Systems generally first distinguish among users, to determine whocan do what.

I User IDs include name and associated number, one per user.• The User ID is then associated with all files and processes of that

user to determine access control.

I Group ID allows set of users to be defined and controls managed,then also associated with each process, file.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 42 / 45

Page 92: Introduction to Operating Systems - Part2

Protection and Security (2/2)

I Systems generally first distinguish among users, to determine whocan do what.

I User IDs include name and associated number, one per user.• The User ID is then associated with all files and processes of that

user to determine access control.

I Group ID allows set of users to be defined and controls managed,then also associated with each process, file.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 42 / 45

Page 93: Introduction to Operating Systems - Part2

Protection and Security (2/2)

I Systems generally first distinguish among users, to determine whocan do what.

I User IDs include name and associated number, one per user.• The User ID is then associated with all files and processes of that

user to determine access control.

I Group ID allows set of users to be defined and controls managed,then also associated with each process, file.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 42 / 45

Page 94: Introduction to Operating Systems - Part2

Summary

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 43 / 45

Page 95: Introduction to Operating Systems - Part2

Summary

I Computer-system architecture: single-processor, multiprocessor(multi-core, blade), clustered

I Operating-system structure: user-space, system calls, kernel-space

I User-space: system programs, application programs

I Kernel-space

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 44 / 45

Page 96: Introduction to Operating Systems - Part2

Summary

I Computer-system architecture: single-processor, multiprocessor(multi-core, blade), clustered

I Operating-system structure: user-space, system calls, kernel-space

I User-space: system programs, application programs

I Kernel-space

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 44 / 45

Page 97: Introduction to Operating Systems - Part2

Summary

I Computer-system architecture: single-processor, multiprocessor(multi-core, blade), clustered

I Operating-system structure: user-space, system calls, kernel-space

I User-space: system programs, application programs

I Kernel-space

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 44 / 45

Page 98: Introduction to Operating Systems - Part2

Summary

I Computer-system architecture: single-processor, multiprocessor(multi-core, blade), clustered

I Operating-system structure: user-space, system calls, kernel-space

I User-space: system programs, application programs

I Kernel-space

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 44 / 45

Page 99: Introduction to Operating Systems - Part2

Questions?

Acknowledgements

Some slides were derived from Avi Silberschatz slides.

Amir H. Payberah (Tehran Polytechnic) Introduction 1393/6/24 45 / 45