Operating Systems: Intro and Structure

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the primary role of an operating system?

  • To create application software for specific tasks.
  • To design and manufacture computer hardware.
  • To provide an interface between the user and computer hardware. (correct)
  • To execute user programs for entertainment purposes.

Which of the following is NOT a typical goal of an operating system?

  • To execute user programs.
  • To develop new hardware components. (correct)
  • To make the computer system convenient to use.
  • To manage and optimize the use of computer hardware.

Which of the following is a key function of the operating system?

  • Controlling and coordinating the use of hardware among various applications and users. (correct)
  • Manufacturing computer hardware components such as CPUs and memory.
  • Providing basic computing resources directly to end-users.
  • Developing application programs to solve specific computing problems.

In the context of operating systems, what is a 'resource allocator'?

<p>A component that manages and distributes system resources. (B)</p> Signup and view all the answers

Why is there no universally accepted definition of an operating system?

<p>Because the components included in an operating system can vary widely. (D)</p> Signup and view all the answers

What is firmware and where is it typically stored?

<p>Programming written to read-only memory and generally stored in ROM or EEPROM. (D)</p> Signup and view all the answers

What is the function of the bootstrap program?

<p>To load the operating system kernel and start execution. (B)</p> Signup and view all the answers

What is the purpose of 'shared memory' in a computer system organization?

<p>To enable different CPUs and devices to access the same data. (D)</p> Signup and view all the answers

What is the function of a 'device controller' in a computer system?

<p>To act as an interface between the system and a particular device type. (B)</p> Signup and view all the answers

What is the role of an interrupt in computer system operation?

<p>To signal the CPU that a device needs attention. (D)</p> Signup and view all the answers

What does it mean for an operating system to be 'interrupt driven'?

<p>The operating system is designed to handle multiple tasks simultaneously. (B)</p> Signup and view all the answers

What is the 'interrupt vector'?

<p>A table containing the addresses of interrupt service routines. (B)</p> Signup and view all the answers

In the context of I/O structure, what is the purpose of a 'system call'?

<p>To request a service from the operating system. (B)</p> Signup and view all the answers

In memory management, what does 'volatile' mean?

<p>That the memory loses its contents when power is lost. (D)</p> Signup and view all the answers

What is the primary benefit of Direct Memory Access (DMA)?

<p>Reduced CPU involvement in data transfer. (D)</p> Signup and view all the answers

Which of the following is likely to be located highest in the storage hierarchy?

<p>Cache. (D)</p> Signup and view all the answers

What is the primary goal of 'caching' in a computer system?

<p>To increase the speed of data access. (B)</p> Signup and view all the answers

What is a key characteristic of Symmetric Multiprocessing (SMP)?

<p>All processors can perform all tasks within the operating system. (B)</p> Signup and view all the answers

In the context of operating systems, what is the purpose of dual-mode operation?

<p>To allow the OS to protect itself and system resources. (C)</p> Signup and view all the answers

Which of the following accurately describes process?

<p>A program in execution representing a unit of work in a system. (D)</p> Signup and view all the answers

Flashcards

Operating System

A program that acts as an intermediary between a user and computer hardware.

Hardware

Provides basic computing resources.

Application Programs

Defines how system resources solve computing problems.

OS as Resource Allocator

Allocates resources like CPU, memory, and I/O devices.

Signup and view all the flashcards

OS as Control Program

Controls program execution to prevent errors and misuse.

Signup and view all the flashcards

Kernel

The one program running at all times on the computer.

Signup and view all the flashcards

Bootstrap Program

Loaded at power-up or reboot; initializes aspects of the system.

Signup and view all the flashcards

Firmware

Programming written to read-only memory (ROM).

Signup and view all the flashcards

Computer-System Operation

CPUs and device controllers connect through a bus to shared memory.

Signup and view all the flashcards

Concurrency

I/O devices and the CPU can execute concurrently.

Signup and view all the flashcards

Device Controller

In charge of a particular device type.

Signup and view all the flashcards

Interrupt handling

Transfers control to an interrupt service routine through the interrupt vector.

Signup and view all the flashcards

Trap/Exception

A software-generated interrupt caused by an error or request.

Signup and view all the flashcards

System Call

Request to the OS to allow a user to wait for I/O completion.

Signup and view all the flashcards

Device-Status Table

Contains entry for each I/O device indicating its type, address, and state.

Signup and view all the flashcards

Storage Units

Kilobyte, megabyte, gigabyte, terabyte, petabyte

Signup and view all the flashcards

Direct Memory Access (DMA)

Transfers blocks of data directly to main memory, bypassing the CPU.

Signup and view all the flashcards

Main Memory

Only large storage that the CPU can access directly.

Signup and view all the flashcards

Secondary Storage

Provides nonvolatile storage capacity.

Signup and view all the flashcards

Caching

Copying information into faster storage systems; main memory as a cache for secondary storage.

Signup and view all the flashcards

Study Notes

Introduction: Operating Systems

  • An operating system (OS) acts as an intermediary/interface between a computer user and the machine's hardware.
  • OS goals include executing user programs, solving user problems easily, making the computer system user-friendly, and using computer hardware efficiently.

Computer System Structure

  • A computer system has four components: hardware, the operating system, application programs, and users.
  • Hardware provides basic computing resources and include CPU, memory, and I/O devices.
  • The OS controls and coordinates the use of hardware by applications and users.
  • Application programs define how system resources are used to solve user computing problems (e.g., word processors, compilers, web browsers, video games).
  • Users can be people, machines, or other computers.

What Operating Systems Do

  • Operating systems must cater to different viewpoints.
  • Users prioritize convenience and ease of use, caring less about resource utilization.
  • Shared computers (mainframes or minicomputers) should keep all users happy.
  • Dedicated systems (workstations) are dedicated to individual users, but often use shared resources from servers.
  • Handheld computers are resource-poor and optimized for usability and battery life.
  • Embedded systems in devices and automobiles may have little to no user interface.

Operating System Definition

  • From a hardware perspective, an OS is a resource allocator that manages all resources (CPU, memory, I/O devices).
  • It decides between conflicting resource requests and aims for efficient and fair resource use.
  • From a software perspective, an OS controls program execution to prevent errors and ensure proper computer use.
  • There is no universally accepted definition of what exactly an OS entails.
  • One view is that it's everything a vendor ships, which varies widely.
  • The "kernel" is the one program running at all times, other programs are system programs (shipped with the OS) or application programs.

Computer Startup

  • The bootstrap program, stored in ROM or EEPROM (firmware), is loaded at power-up or reboot.
  • It initializes all system aspects and loads the OS kernel to start execution.
  • Firmware is programming written to a computing device's read-only memory (ROM).
  • EPROM (Erasable Programmable Read-Only Memory) retains its data when the power is switched off.

Computer System Organization

  • One or more CPUs and device controllers connect through a common bus, accessing shared memory.
  • Concurrent execution of CPUs and devices occurs, competing for memory cycles.

Computer System Operation

  • I/O devices and the CPU can execute concurrently.
  • Each device controller manages a specific device type and has a local buffer.
  • The CPU moves data to/from main memory and local buffers.
  • I/O is transferred from the device to the controller's local buffer.
  • The device controller informs the CPU upon operation completion by causing an interrupt (system call).
  • The device controller is an integral part of a system interpreting signals to/from the CPU.

Common Functions of Interrupts

  • Interrupts stop the CPU's current process and transfer control to an interrupt service routine through an interrupt vector, which contains the addresses of all service routines.
  • Interrupt architecture must save the address of the interrupted instruction, with the interrupt vector being a look-up table containing addresses/pointers to service routines.
  • Incoming interrupts are disabled while another interrupt is being processed to prevent loss.
  • A trap/exception is a software-generated interrupt caused by an error or user request, and the OS is responsible for managing them.
  • An OS is interrupt-driven (multitasking).

Interrupt Handling

  • The OS preserves CPU state by storing registers and the program counter.
  • It determines the interrupt type and the appropriate interrupt service routine.
  • Polling involves the interrupt controller querying each device to identify the requestor.
  • A vectored interrupt system directly identifies the requestor.
  • The OS contains separate code segments to handle various interrupt types.

I/O Structure

  • After I/O starts, control returns to the user program only upon I/O completion.
  • This involves waiting, which causes the CPU to idle until the next interrupt or enter a wait loop (memory contention).
  • Only one I/O request can be outstanding at a time.
  • After I/O starts, control returns without waiting for I/O completion via a system call to the OS.
  • The OS has a device-status table with entries about I/O devices (type, address, state).
  • The OS indexes into the I/O device table to get device status and modify the table entry to include interrupts.

Storage Definition and Notation Review

  • The basic unit of computer storage is the bit (0 or 1).
  • A Byte = 8 bits.
  • A word is the architechture's native data unit
  • A kilobyte (KB) is 1,024 bytes.
  • A megabyte (MB) is 1,024^2 bytes.
  • A gigabyte (GB) is 1,024^3 bytes.
  • A terabyte (TB) is 1,024^4 bytes.
  • A petabyte (PB) is 1,024^5 bytes.

Direct Memory Access Structure

  • Direct memory access (DMA) is used for high-speed I/O devices, able to transmit information at memory speeds.
  • The device controller transfers data blocks directly to main memory without CPU intervention.
  • Only one interrupt is generated per block, not per byte.

Storage Structure

  • Main memory is the only directly accessible storage medium for the CPU.
  • it is typically volatile.
  • Secondary storage, like hard disk or flash memory, provides large, nonvolatile storage capacity but is much slower.
  • The disk surface is organized into tracks and sectors, with the disk controller managing the interaction.

Storage Hierarchy

  • Storage systems are organized in a hierarchy based on speed, cost, and volatility.
  • Caching involves copying information into a faster storage system, with main memory acting as a cache for secondary storage.
  • Volatile memory loses its content when power is off, and RAM is volatile memory.

Caching

  • Caching is an important design principle implemented at many levels (hardware, OS, software).
  • Information in use is copied from slower to faster storage temporarily.
  • Faster storage (cache) is checked first to see if information is there before checking slower storage.
  • Cache is smaller than the storage it is being used for.
  • Cache management is an important design problem including cache size and replacement policy.

Computer-System Architecture

  • Most systems use a single general-purpose processor, but some have special-purpose processors.
  • Multiprocessor systems are growing with various advantages.
  • Including increased throughput, economic scale, and graceful degradation/fault tolerance.
  • Asymmetric multiprocessing assigns specific tasks to each processor.
  • Symmetric multiprocessing (SMP) allows each processor to perform all tasks within the OS.

Multiprocessing Types

  • Asymmetric Multiprocessing (AMP) was the original method for handling multiple CPUs and can be less expensive.
  • In AMP, all CPUs are not treated equally, potentially restricting certain CPUs to executing operating system code or I/O operations.
  • Symmetric Multiprocessing (SMP) has two or more identical processors that connect to shared main memory, each has full I/O access, and the system is controlled by a single OS.
  • The OS instance treats the processsors equally and reserves none for special pruporses.
  • SMP is the most common architecture for multiprocessor systems today.

Modern Computing

  • Modern computers features system including the cache, CPU, memory, device , DMA and more
  • These follow a von Neumann architecture
  • Executes through instructions, and data movements

Symmetric Multiprocessing (SMP) Architecture

  • In this system architecture CPUs have registers and cache and are connected to a memory

Dual-Core Design

  • Dual-core refers to a CPU that includes two complete execution cores on a single silicon chip.

Clustered Systems

  • Computer clusters works together as a single stem, controlled and scheduled by software.
  • Can provide high-availability service.
  • Asymmetric clustering has one machine in hot-standby mode.
  • Symmetric clustering has many nodes running together, monitor each other.
  • Some clusters are for high-performance computing (HPC) and must use parallelization.

Operating System Structure

  • Multiprogramming increases efficiencey by keeping CPU and I/O devices busy antime
  • To do so the multiprogramming organizes jobs so CPU always has one to execute
  • A subset of total jobs in the system is kept in memory so that processes can switch.
  • Timesharing/Multitasking is a logical extension of multiprogramming in which CPU switches jobs so frequently that users can interact with each job while executed.
  • If several jobs are ready to run at the same time then CPU scheduling occures
  • If processses don't fit in memory, swapping occurs to move items in and out.
  • Virtual memory allows execution of processes not completely in memory.

Memory layout for multiprogrammed system

  • The memory is laid out so that the operating system, job 1, 2, 3 and 4 are loaded into it.

Operating-System Operations

  • Interrupt driven (multitasking) by hardware in the systems.
  • Software error or request creates exception or trap (e.g., division by zero or requesting an OS service.).
  • Dual-mode operation allows OS to protect other systems through a mode bit.
  • A mode bit indicates whether the system is running user code or kernel code.
  • There are specific instructions labeled "priveleged", designed only for the kernel.
  • A system call changes mode to enter kernel mode, and resets it upon return to user mode.

System transition from user to Kernal

  • The Timer prevents infinite loop/process hogging resources
  • This is completed by setting an interrupt after a specific period
  • The operating system decrements a counter
  • When the counter is zero, generate an interrupt
  • The system is set up before scheduling the process to regain control or terminate the program that exceeds allotted time

Process Management

  • A process is a program in execution
  • A process is an active entity, whereas a program is a passive one
  • A process needs resources to accomplish its task CPU, memory, I/O, files,and initialization data.
  • It occurs when the process termination requires reclaim of any reusable resources
  • A single-threaded process has one program counter specifying the next instruction
  • Instructions are executed sequentially until completion.
  • The OS allows multiple program couters per thread processes/threads.
  • There is concurrency by multiplexing processes and threads.

Process Management Activities

  • Create and deleting of both user and system processes
  • Suspending and resuming processes
  • Mechanisms for process synchronization, and comminication
  • Providing mechanism for deadlock handling

Memory Management

  • All data in memory occurs after processing
  • The instructions occur in memory for order to execute
  • Manages what's in memory
  • CPU is optimised to utilize the computer and its response
  • Keeps track of currently used parts by keeping track of the who
  • Decides what Processes to move in and out
  • Allocates and deallocates memory space

Storage Management

  • The OS provides uniform, logical view of information storage.
  • Storage abstracts physical properties to logical storage unit - file.
  • Each medium is controlled by a device (e.g., disk drive, tape drive).
  • Varying properties include access speed, capacity, data-transfer rate, access method (sequential or random).CH12
  • Files usually are organized into directories.
  • There is access control based on most systems
  • There is uniform operation that includes: ➤ Mapping files and directories ➤ Primitives to manipulate files and dirs ➤creating and deleting files and directories

Mass-Storage Management

  • Disks used when the data does not fit in memory
  • Proper management is important
  • Entire speed of system depends on subsystems such as disk.
  • Operations ➤ Disk scheduling ➤ Storage allocation ➤ Free-space management
  • Tertiary storage used for optical/magnetic
  • This must have management
  • Depends betweem WORM(write once and read many times) and RW(read/write)

Performance of Various Levels of Storage

  • The system is designed so that is can complete explicit or implicit code, depending on the hierarchy
  • All storage levels must contain the
  • Register Level 1
  • Cache Level 2
  • Main Memory Level 3
  • Disk Storage Level 4

Migration of Integer A from Disk to Register

  • Multitasking must use most recent value
  • A must be cached
  • Multiprocessor must have Cache Coherency in hardware so CPUs have must recent value
  • Distributed environment
  • Has several copies for data
  • Solutions will be covered in CH17

I/O Subsystem

  • OS is designed to hide harware operations
  • Manages operations
  • Memory management ➤ Spooling Buffer cache:Stroing data for performance
  • The I/O is device driven
  • The system contains hardware drivers.

Protection and Security

  • Protection occurs by controlling the access of processes/users in resources
  • System does so by limiting what you can access or when you can access
  • System defends internal and external attacks ➤ Users require identities
  • System knows if there is access ➤ Identifier allows group process to operate
  • Previlege Escalation - Users can escalate perms.

Distributed Computing

  • Combines network and systems with the help of defined distance.
  • Contains multiple types of networks
    • LAN , WAN, MAN
    • the network contains operatings System/
  • Communicates via scheme
  • Ilusion of single system/Faliure

Special-purpose Systems

  • Real embedded (computers)
  • Contain limited OS and memory and purpose of data system
  • Can use small streams with limited resources

Computing Environments

  • Tradional and now are over time, and includes the
  • Offices
  • Homes
    • and PCs connected on Network
    • Each job give a specific switch time, and has portals

Computing Environments (Cont.)

  • Client-Sever computing
  • A dumb terminals in PCs
  • Server resonds via generated clients
  • Compute contains a provided client interface to request services
  • File Service store and get data
  • They occur in multiple enviornments of course

Peer-to-Peer Computing

  • A model that contains services and distribution
  • Most include
    • All notes can be used via the server
  • Requires a network
    • All register
    • Will have access via request for services and share via protocol

Web-Based Computing

  • Web is everywhere in web based systems,
  • Most are Network
    • Devices allow the ability to be on load balancers Access of OS will have access to systems.

Open-Source Operating Systems

  • The operating system has Code available for binary source
  • Provides security
  • They can be copyleft in GNU
  • This creates public licensing
  • OpenSource code
  • Code avail
  • Contains multiple Operating Systems that contain linux.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

More Like This

Use Quizgecko on...
Browser
Browser