Introduction To Operating System (Part1) : Asst. Prof. Dr. Noor Ghazi
Introduction To Operating System (Part1) : Asst. Prof. Dr. Noor Ghazi
1
Computer Organization
- Computer Consists of CPU, Memory, I/O, and storage.
- Each device controller is in charge of a particular device type
- Each device controller has a local buffer
- Each device controller type has an operating system device driver to
manage it
- CPU moves data from/to main memory to/from local buffers
- I/O is from the device to local buffer of controller
- Device controller informs CPU that it has finished its operation by causing an interrupt.
2
Computer System Structure
Computer system can be divided into four components:
3
Operating System (OS)
A program that acts as an intermediary between a user of a computer and the
computer hardware.
4
Operating System (Cont..)
Operating system can be viewed as:
• Resource allocator. A computer system has many resources that may be required to solve a
problem: CPU time, memory space, storage space, I/O devices, and so on. The operating system
acts as the manager of these resources.
• Control program. A control program manages the execution of user programs to prevent
errors and improper use of the computer. It is especially concerned with the operation and
control of I/O devices.
5
Operating System (Cont..)
The operating system is the one program running at all times on the computer” is
the kernel.
Everything else is either:
◦ A system program ( associated and shipped with the operating system, but not part of the
kernel) , or
◦ An application program, all programs not associated with the operating system.
6
Multiprogramming and Multitasking Concepts
Multiprogramming
When two or more programs are residing in memory, then sharing the processor is referred as
multiprogramming.
- In a multiprogrammed system, a program in execution is termed a process.
- Multiprogramming operating system also known as (Batch system)
7
Multiprogramming and Multitasking Concepts (Cont..)
Multitasking
- Multitasking refers to the term when multiple processes are executed by CPU simultaneously by
switching between them.
- Switching frequently occurs that the users may interact with each program while it is running.
- Multitasking operating systems are also known as (Timesharing systems).
8
Functions of Operating System
- Process Management.
- Main Memory Management.
- File System Management.
- Mass Storage Management.
- I/O System Management.
- Protection and Security.
9
Process Management
A process is a program in execution.
A process needs certain resources, including CPU time, memory, files, and I/O devices, to accomplish
its task.
The operating system is responsible for the following activities in connection with process management.
✦ Process creation and deletion.
✦ process suspension and resumption.
✦ Provision of mechanisms for:
- process synchronization.
- process communication.
- Providing mechanisms for deadlock handling.
10
Memory Management
- Memory is a large array of words or bytes, each with its own address.
- Main memory is a volatile storage device. It loses its contents in the case of system failure.
- To execute a program all (or part) of the instructions must be in memory, All (or part) of the data
that is needed by the program must be in memory.
he operating system is responsible for the following activities in connections with memory
management:
♦ Keeping track of which parts of memory are currently being used and which process is using them.
♦ Allocating and deallocating memory space as needed.
♦ Deciding which processes (or parts of processes) and data to move into and out of memory.
11
File-system Management
- A file is a collection of related information defined by its creator.
- Files are normally organized into directories to make them easier to use.
The operating system is responsible for the following activities in connections with file
management:
✦ File creation and deletion.
✦ Directory creation and deletion.
✦ Support of primitives for manipulating files and directories.
✦ Mapping files onto secondary storage.
✦ File backup on stable (nonvolatile) storage media.
12
Mass-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.
Most modern computer systems use disks as the principle storage medium, for both programs and
data.
The operating system is responsible for the following activities in connection with secondary
storage management:
✦ Mounting and unmounting.
✦ Free-space management.
✦ Storage allocation.
✦ Disk scheduling.
✦ Partitioning.
✦ Protection.
13
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 (the
overlapping of output of one job with input of other jobs)
✦ Drivers for specific hardware devices.
14
Protection and Security
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 (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