Operating Systems: Introduction and Structure

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Listen to an AI-generated conversation about this lesson
Download our mobile app to listen on the go
Get App

Questions and Answers

What is an operating system?

An operating system is a program that manages a computer’s hardware and provides a basis for application programs, acting as an intermediary between the computer user and the hardware.

What are the components of a computer system?

Hardware, operating system, application programs, and users.

The basic unit of computer storage is the _____

bit

A _____ is used to manage multiple processes.

<p>thread</p>
Signup and view all the answers

What are the goals of an operating system?

<p>All of the above (D)</p>
Signup and view all the answers

Which of the following is NOT a type of operating system?

<p>Cloud Computing (D)</p>
Signup and view all the answers

An operating system acts as a _____ between the computer user and the computer hardware.

<p>mediator</p>
Signup and view all the answers

What is meant by 'multiprocessing'?

<p>Multiple processes assigned different tasks (C)</p>
Signup and view all the answers

What is the difference between a program and a process?

<p>A program is a set of instructions, while a process is a program in execution with allocated resources.</p>
Signup and view all the answers

The kernel is an optional part of the operating system.

<p>False (B)</p>
Signup and view all the answers

Match the following operating system types with their definitions:

<p>Batch = Processes jobs in batches without user interaction Real-Time = Process data as it comes in Multiprogramming = Multiple jobs in memory for CPU utilization Distributed = Computing across multiple machines</p>
Signup and view all the answers

Flashcards

What is Hardware?

Provides basic computing resources like CPU, memory, and I/O devices.

What is the Operating System?

Controls and coordinates hardware use among applications and users.

What are Application Programs?

Use system resources to solve computing problems for users.

Who are Users?

People, machines, and other computers using the system.

Signup and view all the flashcards

What is an Operating System?

A program that manages a computer's hardware and acts as an intermediary between the user and the hardware.

Signup and view all the flashcards

What is the Goal of an OS?

Execute user programs and make solving user problems easier.

Signup and view all the flashcards

What is the Goal of an OS?

Make the computer system convenient to use.

Signup and view all the flashcards

What is the Goal of an OS?

Use computer hardware in an efficient manner.

Signup and view all the flashcards

What is the Kernel?

The program running at all times on the computer.

Signup and view all the flashcards

What are System Programs?

Assist with the operation of the operating system.

Signup and view all the flashcards

What are Application Programs?

Include all programs not associated with OS operation.

Signup and view all the flashcards

Computer System?

Consists of one or more CPUs and device controllers connected through a common bus providing access to shared memory.

Signup and view all the flashcards

What is a Bootstrap Program?

It is loaded at power-up or reboot.

Signup and view all the flashcards

What is an Interrupt?

The occurrence of an event.

Signup and view all the flashcards

What is a Trap (Exception)?

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

Signup and view all the flashcards

What does Interrupt Handling do?

Transfers control through the interrupt vector.

Signup and view all the flashcards

What is a Resource Allocator?

Allocates time and decides between conflicting requests.

Signup and view all the flashcards

What are hard disks?

Rigid platters covered with magnetic material.

Signup and view all the flashcards

What are solid-state disks?

Faster and nonvolatile storage.

Signup and view all the flashcards

What is Main Memory?

Only large storage that CPU can access directly. Typically volatile and random access.

Signup and view all the flashcards

What is secondary storage?

Extension of main memory providing large, nonvolatile storage.

Signup and view all the flashcards

Multiprocessors

Systems that grow in use and importance.

Signup and view all the flashcards

Multiprogramming

Needed for efficiency.

Signup and view all the flashcards

Timesharing

Logically extends by switching jobs so users can interact.

Signup and view all the flashcards

Dual-mode operation

OS needs to protect itself and components.

Signup and view all the flashcards

What is the Mode Bit?

Is added to the hardware to show running modes.

Signup and view all the flashcards

What is Protection?

Mechanism for controlling resource access defined by the OS.

Signup and view all the flashcards

What are Portals?

Provide Web accessibility to internal servers.

Signup and view all the flashcards

Distributed Computing

Collection of separate,systems networked together.

Signup and view all the flashcards

Virtualization

Technology that allows operating systems to run as applications within other operating systems.

Signup and view all the flashcards

Cloud Computing

Delivers computing, storage, even apps on a service.

Signup and view all the flashcards

Opearating System Services

A program provide API.

Signup and view all the flashcards

User Interface

All operating systems.

Signup and view all the flashcards

Program Execution

Load a program into memory and to run that program.

Signup and view all the flashcards

I/O Operations

A running program require I/O.

Signup and view all the flashcards

Study Notes

Chapter 1: Introduction

  • An operating system acts as an intermediary between the user of a computer and the computer hardware.

Computer System Structure

  • Computer systems consist of four main components: hardware, operating system, application programs, and users.
  • Hardware provides the basic computing resources, including CPU, memory, and I/O devices.
  • The operating system controls and coordinates the use of hardware among various applications and users.
  • Application programs define the ways in which system resources are used to solve computing problems for users, for example, word processors, compilers, web browsers, database systems, and video games.
  • Users can be people, machines, or other computers.

Operating Systems (OS)

  • An OS is a program that manages a computer's hardware and provides a basis for application programs.
  • Goals for OSs include executing user programs, making solving user problems easier, making the computer convenient, and using computer hardware efficiently.

What Operating Systems Do

  • From the user's view, the OS aims for convenience, ease of use, and good performance and is not as concerned with resource utilization.
  • From the system’s view, the OS is intimately involved with the hardware and acts as a resource allocator of resources like CPU time, memory space, file-storage space, and I/O devices.
  • The OS manages all resources and decides between conflicting requests for efficient and fair resource use.
  • The OS controls the execution of programs to prevent errors and improper use of the computer.
  • The OS is the one program running at all times, known as the kernel, alongside system programs and application programs.

Computer System Organization

  • A modern general-purpose computer system is made up of CPUs and device controllers connected via a common bus for shared memory access.
  • A bootstrap program, stored in ROM or EPROM (firmware), initializes the system and loads the OS kernel.
  • Interrupts, triggered by hardware or software (system calls or monitor calls), signal events.
  • Interrupts transfer control to interrupt service routines through the interrupt vector, which contains the addresses of all the service routines.
  • A trap or exception is a software-generated interrupt caused by an error or user request.
  • The OS is interrupt driven.

Storage Structure Review

  • The basic unit of computer storage is the bit, which can contain one of two values: 0 or 1.
  • Other storage in a computer is based on collections of bits
  • A word is a given computer architecture’s native unit of data
  • Data in computer storage is measured and manipulated in bytes and collections of bytes
  • The storage hierarchy is:
    • Kilobyte (KB) is 1,024 bytes.
    • Megabyte (MB) is 1,024 to the power of 2 bytes.
    • Gigabyte (GB) is 1,024 to the power of 3 bytes.
    • Terabyte (TB) is 1,024 to the power of 4 bytes.
    • Petabyte (PB) is 1,024 to the power of 5 bytes.

Memory

  • Main memory allows direct CPU access via random access and is typically volatile.
  • Secondary storage provides large, nonvolatile storage capacity as an extension of main memory.
  • Solid-state disks are faster, nonvolatile storage, while hard disks use magnetic recording.
  • Disk surfaces are logically divided into tracks subdivided into sectors.
  • The disk controller ensures logical interaction between the device and the computer

Multiprocessing Architecture

  • Multiprocessor systems, also known as parallel systems, have increased throughput, economy of scale, and reliability.
  • Two types of multiprocessing exist: asymmetric, where each processor is assigned a specific task, and symmetric, where each processor performs all tasks.

Operating System Structuring

  • Batch systems use multiprogramming for efficiency, organizing jobs so the CPU always has one to execute.
  • Job scheduling is used, and the OS switches to another job when one has to wait.
  • Timesharing (multitasking) allows users to interact with jobs while running.
  • Response time should be less than 1 second.
  • Each user has at least one program executing in memory, known as a process.
  • Swapping moves processes in and out to run if they don't fit in memory.
  • Virtual memory allows for the executions of processes not completely in memory.

Operating System Operations

  • The OS is interrupt driven, encompassing both hardware and software interrupts.
  • A hardware interrupt is triggered by devices, while a software interrupt (exception or trap) can be caused by errors or requests.
  • Dual-mode operation protects the OS and system components via user mode and kernel operating modes.
  • A mode bit indicates the current operating mode of a computer: kernel(0) or user (1), it distinguishes between user code and kernel code.
  • Certain instructions are privileged and only executable in kernel mode.
  • A system call changes the mode to kernel, and returning from the call resets it to user.

Protection and Security

  • Protection is any mechanism in the OS that controls access of processes or users to the resources.
  • Security is the defense of the system against internal and external attacks, denial-of-service, and viruses.

Computing Environments

  • A trend is toward providing more ways to access computing environments through portals that provide Web accessibility to internal servers.
  • Network computers (or thin clients) are cost-effective and provide web-based access.
  • Mobile computers interconnect via wireless networks.
  • Distributed computing involves networked, heterogeneous systems, often using TCP/IP.
  • Types of computer networks include Local Area Networks (LAN), Wide Area Networks (WAN), Metropolitan Area Networks (MAN) and Personal Area Networks (PAN).
  • Client-Server computing involves clients requesting services from central servers.
  • Peer-to-Peer computing allows systems to act as both clients and servers.
  • Virtualization enables operating systems to run as applications within other operating systems.
  • Cloud Computing delivers computing, storage, and apps as service across a network.
  • Cloud types include Public Clouds for public access, Private Clouds run by a company, or Hybrid Clouds include both public.
  • Computing as a service
    • Software as a Service provides applications.
    • Platform as a Service provides software stacks for application.
    • Infrastructure as a Service provides servers and storage.

Chapter 2: Operating-System Structures

  • An operating system (OS) provides an environment for the execution of programs and services to programs and users

Operating System Services

  • An OS provides services to users, such as user interfaces (UI) and program execution.
  • UI consists of command-line interface (CLI), graphics user interface (GUI), and batch.
  • There is also is I/O operations, such file-system manipulation like creating, deleting, searching, and listing.
  • Communications between computers over a network and error detection of possible errors are also provided.
  • The OS ensures its efficient operation via resource sharing such as resource allocation, accounting, and protection and security that controls outsider access.
  • There is protection where all system resource access is controlled.
  • System security requires user authentication and extends the defending of external I/O devices.

User Operating System Interface

  • CLI or command interpreter, shell, allows the entry of direct commands and executes commands from users.
  • The Graphics User Interface (GUI) is a user-friendly desktop interface.
  • Items in GUI are represented as Icons which represent files, programs, actions, etc.
  • The actions are carried out by use of a keyboard, mouse or other input devices.
  • Many systems now include both CLI and GUI interfaces

System Calls

  • They acts as a programming interface to the OS that are typically written in high-level languages like C or C++.
  • An application programming interface (API) accesses programs via a high-level use rather than a direct system call.
  • Three common APIs exist: Win32 API for Windows, POSIX API for POSIX-based systems, and Java API for the Java virtual machine (JVM).

Common System Calls

  • Process control: create, terminate, get attributes, wait, and locks.
  • File management: create, delete, open, close, read, write, and reposition.
  • Device management: request, release, attach, and detach devices.
  • Information maintenance: time, date, system data, file attributes.
  • Communications: establish, terminate, send, receive messages, transfer status.
  • Protection and security: control access, get/set permissions, allow/deny access.

System Programs

  • These provide a convenient environment for program development, execution, and can be divided into specific types.
  • File management involves operations such as create, delete, copy, as well as file modification via Text editors that can modify files.
  • One can get status on the system, such as date, time, memory, disk space, and detailed performance and logging information
  • Programming language support: Compilers, assemblers, debuggers, and interpreters are often supported.
  • Program loading and execution
  • Communications: Virtual connections for users, browse web pages, messaging, email.
  • Background services: Launched at boot, disk, process scheduling, error logging, and printing.
  • Application programs: Doesn't pertain to the OS and are run by users.

OS Design

  • Implementation of OS design is not "solvable", but approaches have been proven successful.

Design Goals

  • User goals should be convenient, easy to learn, reliable, safe, and fast.
  • System goals should be easy to design, implement, maintain, flexible, reliable, error-free, and efficient.

Variations

  • Varying from early OS programs to early programming languages, such as ALGOL or PL/1 to modern C and C++.
  • Usually a combination of languages, lowest levels are in assembly, and Main body programs.

Operating System Structure Types

  • Those include, simple structure, complex, layered, and Microkernel.
  • MS-DOS is of Simple structure.
  • UNIX is more complex.
  • Mach uses microkernels.

Chapter 3: Processes

  • A program is passive entity and a process becomes an active entity.

Process Control

  • This is the fundamental task of any operating system management..

Process Structure

  • Text Section program code.
  • Data Section that contains global variables.
  • Heap contains memory dynamically allocated.
  • Stack contains temporary data, function parameters and local variables.

Process Control Block (PCB)

  • Operating systems need to consider their dynamic behaviors for better control of processes
  • This contains process identification information: numeric identifiers or identifiers of the parent process.
  • Processor state information includes running, waiting, and the program counter is the instruction location to next execute.
  • CPU registers contains all process-centric registers.
  • CPU scheduling information indicates priorities, and scheduling queue pointers.
  • Memory-management information shows memory allocated.
  • Accounting information indicates CPU use, clock time, and time limits
  • I/O status information is for devices allocated, and open files

Process State Types

  • new: The process is being created
  • running: Instructions are being executed
  • waiting: Some event occurs
  • ready: The process is to be assigned to a processor
  • terminated: The process has finished execution

Schedulers

  • Short-term scheduler (or CPU scheduler): Executed next and allocates quickly.
  • Long-term scheduler (or job scheduler): Brought into the ready queue and is slow.
  • Medium-term scheduler: Multiple programming is needed, process removed from memory and stored to continue.

Interprocess Communication (IPC)

  • Communication can be independent or cooperating.
  • Cooperating processes cause effects or are affected.
  • Two Models of IPC share memory and message pasing.

Chapter 4: Threads

Threads Introduction

  • A thread is a unit of CPU utilization that comprises a thread ID, a program counter, a register set, and a stack and shares with the process containing it (code, data, open files, system resources).
  • Multithreading enables concurrent drawing and input.
  • Most kernels are now multithreaded performing interrupt handling, memory management and managing devices.

Multicore programming

  • This provides a mechanism for more efficient management of processors/ multi cores.

Three common models for Multithreading:

  • The one-to-one model assigns each user thread to a kernel thread, which enables parallel.
  • The main issue for a one-to-one model is one side requires creation of a parallel thread.
  • The many-to-one-model can map all user threads to a kenre thread.
  • In the Many-to-Many model Many user level threads are mapped to numerous of new threads.

Benefits of Threads

  • Benefits include responsiveness if blocked, sharing easier, cheaper execution and scalability.

Thread libraries

  • That are available will have an API for use by programmers for easy creation and management control purposes.
  • There are three thread libraries in use, POSIX Pthreads Windows and Java.

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