operating system and security, Schemes and Mind Maps of Operating Systems

In this study guide, we covered the basics of operating system, software and its types, process scheduling, memory management, and security. We discussed the different process scheduling algorithms, process states, and interrupt handlers. We also covered the concepts of deadlock and starvation, and the dining philosophers problem. Additionally, we discussed the basics of memory management, including memory allocation and deallocation, and memory protection. Finally, we covered the basics of security, including security threats and security measures.## Computing Ethics and Responsibilities

Typology: Schemes and Mind Maps

2024/2025

Available from 12/26/2024

hamza-anjum
hamza-anjum šŸ‡µšŸ‡°

8 documents

1 / 24

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Operating Systems
Denition
An operating system is the software that controls the overall operation of
a computer. It provides the means by which a user can store and retrieve
les, provides the interface by which a user can request the execution of
programs, and provides the environment necessary to execute the
programs requested.
Examples of Operating Systems
Windows
UNIX
Mac OS
Solaris
Linux
The History of Operating Systems
Early Computing
Computers were not very exible or efcient
Machines occupied entire rooms
Program execution required signicant preparation of equipment
The execution of each program, called a job, was handled as an isolated activity
Batch Processing
The separation of users and equipment, which eliminated the physical transition
of people in and out of the computer room
A computer operator was hired to operate the machine
Users submitted their programs, data, and special directions to the operator
The operator loaded these materials into the machine's mass storage, where a
program called the operating system could read and execute them one at a time
1940sāˆ’ 1950s
Created by Turbolearn AI
Page 1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18

Partial preview of the text

Download operating system and security and more Schemes and Mind Maps Operating Systems in PDF only on Docsity!

Operating Systems

Denition

An operating system is the software that controls the overall operation of a computer. It provides the means by which a user can store and retrieve les, provides the interface by which a user can request the execution of programs, and provides the environment necessary to execute the programs requested.

Examples of Operating Systems

Windows UNIX Mac OS Solaris Linux

The History of Operating Systems

Early Computing

Computers were not very exible or efcient Machines occupied entire rooms Program execution required signicant preparation of equipment The execution of each program, called a job, was handled as an isolated activity

Batch Processing

The separation of users and equipment, which eliminated the physical transition of people in and out of the computer room A computer operator was hired to operate the machine Users submitted their programs, data, and special directions to the operator The operator loaded these materials into the machine's mass storage, where a program called the operating system could read and execute them one at a time

1940 s āˆ’ 1950 s

Job Queue

Component Description Job A program, data, and directions

Job Queue A storage organization in which jobs are ordered in rst-in, rst- out fashion Job Control Language

A system used to encode instructions explaining the steps required to prepare the machine for a particular job

Interactive Processing

Allowed a program being executed to carry on a dialogue with the user through remote terminals Featured real-time processing, where the computer performed tasks under a deadline Required the computer to respond promptly to user input

Time-Sharing

Provided service to multiple users at the same time Implemented using multiprogramming, where time is divided into intervals and the execution of each job is restricted to only one interval at a time Created the illusion of several jobs executing simultaneously

Key Terms

F IF O

JCL

Embedded systems: computers dedicated to specic tasks, such as medical devices, vehicle electronics, home appliances, cell phones, or other hand-held computers Embedded operating systems: operating systems designed for embedded systems, often expected to conserve battery power, meet demanding real-time deadlines, or operate continuously with little or no human oversight

Examples of Embedded Operating Systems

Operating System Description

VxWORKS

Developed by Wind River Systems, used in the Mars Exploration Rovers Windows CE Developed by Microsoft, also known as Pocket PC

Palm OS Developed by PalmSource, Inc., especially for use in hand-held devices

Operating System Architecture

A Software Survey

Software can be classied into two broad categories: application software and system software.

Application Software

Application software: programs for performing tasks particular to the machine's utilization Examples: spreadsheets, database systems, desktop publishing systems, accounting systems, program development software, and games

System Software

System software: software that performs tasks common to computer systems in general Examples: operating systems, utility software

Utility Software

Utility software: software units that extend or customize the capabilities of the operating system Examples: software to format a magnetic disk, copy a le from a magnetic disk to a CD, compress and decompress data, play multimedia presentations, and handle network communication

Software Classication

Category Description Application Software

Programs for performing tasks particular to the machine's utilization

System Software Software that performs tasks common to computer systems in general

Utility Software Software units that extend or customize the capabilities of the operating system Operating System

The software that manages the computer system and provides the infrastructure for application software

Linux

Linux: an operating system originally designed by Linus Torvalds while a student at the University of Helsinki Non-proprietary: available, along with its source code and documentation, without charge Reliable: recognized as one of the more reliable operating systems available today## Components of an Operating System

User Interface

The user interface is the portion of an operating system that handles communication with the user. It acts as an intermediary between the user and the operating system's kernel.

User Interface: The part of an operating system that allows users to interact with the computer.

Device Driver Function Description

Device Communication

Translates generic requests into technical steps required by the device Device Control Carries out operations on the peripheral device

Memory Manager

The memory manager is responsible for coordinating the machine's use of main memory. Its duties include:

Assigning memory space for programs and data Ensuring program actions are restricted to allotted space Keeping track of occupied and unoccupied memory areas Creating the illusion of additional memory space through paging Memory Manager Function Description Memory Allocation Assigns memory space for programs and data Memory Protection Ensures program actions are restricted to allotted space Memory Management Keeps track of occupied and unoccupied memory areas

Virtual Memory

Virtual Memory is a large ctional memory space created by paging, which allows a computer to function as though it has more main memory than it actually does.

Paging: a memory management technique that divides main memory into uniform-sized units called pages, which are typically a few KB in size. Main Memory: a computer's primary memory, which is volatile and loses its data when the computer is turned off.

Boot Process

The boot process, also known as booting, is the procedure that transfers the operating system from mass storage into main memory when a computer is turned on.

ifnecessary

Boot Loader: a program permanently stored in a computer's ROM that directs the CPU to transfer the operating system into main memory. ROM: a type of non-volatile memory that can be read but not altered.

Firmware

Firmware is a type of software that is stored in non-volatile memory, such as FlashROM, and is used to perform fundamental input/output activities.

BIOS : a widely used rmware system in PCs. EFI : a newer rmware system used in PCs. Open Firmware: a rmware system used in Sun computers, now a product of Oracle. CFE : a rmware system used in many embedded devices.

Booting Procedure

The booting procedure involves the following steps:

  1. The computer is turned on, and the CPU starts executing the boot loader program stored in ROM.
  2. The boot loader directs the CPU to transfer the operating system from mass storage into main memory.
  3. The boot loader directs the CPU to execute a jump instruction to the area of memory where the operating system is stored.
  4. The operating system takes over and begins controlling the computer's activities.

Operating System Architecture

Read āˆ’ OnlyMemory

BasicInput / OutputSystem ExtensibleF irmwareInterface

CommonF irmwareEnvironment

A process table is a data structure that contains information about each process in the system, including the memory area assigned to the process, the priority of the process, and whether the process is ready or waiting.

Each time the execution of a program is requested, the scheduler creates a new entry for that process in the process table.

Dispatcher

The dispatcher is the component of the kernel that oversees the execution of the scheduled processes. In a time-sharing/multitasking system, this task is accomplished by multiprogramming, which involves dividing time into short segments called time slices and switching the CPU's attention among the processes as each is allowed to execute for one time slice.

Time Slice Description Time Slice A short segment of time allocated to a process for execution Process Switch The procedure of changing from one process to another

Interrupt A signal generated by the timer circuit to indicate the end of a time slice

Process State

A process's state includes the value of the program counter as well as the contents of the registers and pertinent memory cells. CPUs designed for multiprogramming systems incorporate the task of saving this information as part of the CPU's reaction to the interrupt signal.

Interrupts

Interrupts provide an important tool for coordinating a computer's actions with its environment. There are many situations in which an interrupt signal is generated, each with its own interrupt routine.

Interrupt Description

Power Failure The highest priority interrupt, generated if the computer's power is unexpectedly disrupted Mouse Click An interrupt signal generated when the mouse is clicked Keyboard Press

An interrupt signal generated when a key is pressed on the keyboard

Multiprogramming

Multiprogramming allows multiple processes to share the CPU's time, increasing the overall efciency of the machine. This is because the time that a process is waiting for peripheral devices to complete tasks or for a user to make the next request is not wasted.

Benets of Multiprogramming Description

Increased Efciency Multiprogramming allows multiple processes to share the CPU's time, increasing the overall efciency of the machine

Reduced Waiting Time

The time that a process is waiting for peripheral devices to complete tasks or for a user to make the next request is not wasted

Handling Competition Among Processes

An important task of an operating system is the allocation of the machine's resources to the processes in the system. This includes the allocation of access to les, mass storage space, memory space, space in the process table, and time slices.

Semaphores

A semaphore is a variable that controls the access to a shared resource by multiple processes. In a time-sharing/multitasking operating system, semaphores are used to manage the allocation of resources such as printers and disk drives.

The Problem of Competition

When multiple processes compete for a shared resource, such as a printer, the operating system must ensure that only one process can access the resource at a time.

The Flag System

One approach to controlling access to a shared resource is to use a ag, which is a bit in memory that can be set or cleared.

A ag is a bit in memory whose states are often referred to as set and clear, rather than 1 and 0.

However, this simple ag system has a problem. The task of testing and possibly setting the ag may require several machine instructions, which can lead to conicts between processes.

Semaphores

Denition

A semaphore is a variable that controls the access to a shared resource by multiple processes.

How Semaphores Work

A semaphore can be used to guard a critical region of code, ensuring that only one process can execute it at a time.

Step Description

  1. Check the semaphore

The process checks the state of the semaphore. If it is clear, the process can proceed.

  1. Set the semaphore The process sets the semaphore to indicate that it is using the shared resource.
  2. Execute the critical region The process executes the critical region of code.
  3. Clear the semaphore

The process clears the semaphore to indicate that it is no longer using the shared resource.

Deadlock

Denition

Deadlock is a condition in which two or more processes are blocked from progressing because each is waiting for a resource that is allocated to another.

Conditions for Deadlock

Condition Description

  1. Competition for non- sharable resources

Multiple processes are competing for a resource that cannot be shared.

  1. Partial allocation of resources

Processes are allocated some resources, but not all the resources they need.

  1. Non-preemptive allocation of resources

Once a resource is allocated, it cannot be forcibly retrieved.

Deadlock Avoidance and Detection

Deadlock Avoidance Schemes

Require each process to request all its resources at one time. Convert non-sharable resources into sharable ones.

Allocate le access according to the needs of the processes, allowing multiple processes to have read access but only one to have write access. Divide the le into pieces, allowing different processes to alter different parts of the le concurrently.

Multi-Core Operating Systems

Modern systems continue to multitask by switching rapidly between time slices, but multi-core CPUs can genuinely run multiple processes simultaneously. The dispatcher and scheduler must consider which processes to execute on each core.

Multi-Core CPU Description Multiple independent processors Share the computer's peripherals, memory, and other resources

Dispatcher and scheduler

Must consider which processes to execute on each core

Handling Competition Among Processes

Handling competition among processes becomes more challenging in multi-core systems because disabling interrupts on all cores whenever one needs to enter a critical region would be highly inefcient.

3.5 Security

Security: the responsibility of the operating system to protect the computer's resources from access by unauthorized personnel.

Attacks from the Outside

The operating system protects the computer's resources by:

Establishing accounts for authorized users Controlling access to the system through login procedures Monitoring activity within the computer system using auditing software

cores

Auditing Software

Auditing software records and analyzes activities within the computer system to detect:

Floods of attempts to login using incorrect passwords Activities within a user's account that do not conform to their past behavior Presence of snifng software

Attacks from Within

Once an intruder gains access to a computer system, they can:

Explore the system looking for information of interest or places to insert destructive software Use the administrator's account to gain highly privileged access to the operating system

User Carelessness

One of the major obstacles to computer security is the carelessness of users themselves, including:

Selecting easy-to-guess passwords Sharing passwords with friends Failing to change passwords on a timely basis Importing unapproved software into the system

Security Policies

Institutions with large computer installations adopt and enforce policies that catalog the requirements and responsibilities of users to prevent security breaches.## Security Threats and Countermeasures

Password Security

Security Threat Description Accessing Memory Cells Outside Allotted Area

A process can read and alter data being used by other processes Accessing Peripheral Devices Directly

A process can read les without supervision by the system's le manager

Altering the Timer A process can extend its time slice and dominate the machine

Questions and Exercises

  1. Give some examples of poor choices for passwords and explain why they would be poor choices.
  2. Processors in Intel's Pentium series provide for four privilege levels. Why would the designers of CPUs decide to provide four levels rather than three or ve?
  3. If a process in a multiprogramming system could access memory cells outside its allotted area, how could it gain control of the machine?## Process Scheduling

Process Scheduling Algorithms

When a process's time slice is over, the operating system's dispatcher must decide which process to execute next. The dispatcher uses a scheduling algorithm to make this decision.

First-Come-First-Served : The process that arrives rst is executed rst. Shortest Job First : The process with the shortest burst time is executed rst. Priority Scheduling: The process with the highest priority is executed rst.

Process States

A process can be in one of the following states:

F CF S

SJF

State Description Running The process is currently being executed by the CPU. Waiting The process is waiting for a resource or event to occur. Ready The process is ready to be executed by the CPU.

Zombie The process has nished execution but its parent process has not yet acknowledged its termination.

Interrupt Handlers

An interrupt handler is a routine that handles an interrupt, which is a signal to the CPU that an event has occurred. The interrupt handler saves the current state of the process, handles the interrupt, and then restores the process's state.

Deadlock

Deadlock occurs when two or more processes are blocked indenitely, each waiting for the other to release a resource.

"A deadlock is a situation in which two or more processes are unable to proceed because each is waiting for the other to release a resource."

There are three necessary conditions for deadlock to occur:

  1. Mutual Exclusion: Two or more processes must be competing for a common resource that cannot be used simultaneously.
  2. Hold and Wait: One process must be holding a resource and waiting for another resource, which is held by another process.
  3. No Preemption: The operating system must not be able to preempt one process and give the resource to another process.

Starvation

Starvation occurs when a process is unable to gain access to a resource because other processes are holding onto the resource for an extended period.