Introduction to Operating Systems

A brief introduction and history into Operating Systems

History

Type
Product
Date

Vacuum Tubes

Z3 Computer, ENLAC

1945-55

Transistors & Batch Systems

GMOS

1955-65

ICs & Multiprogramming

System/360

1965-80

Personal Computers

CP/M, MS-DOS

1980-Now

Mobile Computers

PDA, Android, iOS

1990-Now

Definitions

  • Computer: A general purpose device that can execute sequences of instructions presented in a formal format to perform numerical calculations and other tasks.

  • Computer Hardware: A collection of physical components and elements which make up a computer system.

  • Computer Software: A collection of all programs stored in and executed by a computer system.

  • Application Software: Performs specific tasks for the user.

  • System Software: Operates and controls the computer system, and provides a platform to run application software.

Introduction

An Operating System is a piece of software that manages all the resources of a computer system, both hardware and software, and provides an environment in which the user can execute their programs in a convenient and efficient manner. They exist because they offer a reasonable way to solve the problem of creating a useable computer system.

An operating system:

  • Manages the computer hardware

  • Facilitates execution of application programs

  • Acts as an intermediary between the user and the computer hardware

  • Designed to be convenient and efficient

Design Goals:

  • Convenience & Ease of Use - Personal Computers

  • Efficiency (Proper Resource Allocation) - High Performance Computers

  • Energy Conservation - Handheld Devices

  • Minimal User Interference - Embedded Devices

Computer Hardware

CPU Internals

Storage

Cache

When a program reads a word, the hardware checks to see if it's in the cache.

  1. If so, then you will have a cache hit (2 cycles)

  2. If not, then it will make a request to the main memory over the bus which is expensive

Cache is expensive, therefore its size is limited.

Disk Drive Structure

Data on a disk is stored on Tracks and is read through a Head. Since the head has to search through the disk for the information, data acquisition is slow. Each sector on a disk stores between 256 bytes to 1 kilobyte of information.

Multithreaded and Multicore Chips

Chips can have a shared or separate cache connected to it depending on the manufacturer - Intel or AMD for example.

A core could be a CPU, and a CPU could be: 1. Efficiency Core - Slower but consumes less power 2. Performance Core - Efficient but expensive

Memory

Memory is split between two types:

  • Single Base / Limit Pair

    • Set for each process

  • Two Base / Limit Registers

    • One for the program, one for the data

What this means is that in a single base, the process and the user data is compiled together and given a limit for the whole program, while a two base will have the program running on one or more addresses, and the data running on a separate address.

Deadlock

When processes don't have a cycle or order to follow they will try to run at the same time, causing a deadlock - where they will each wait for the next program to run before running themselves.

Multiprogramming

Multiprogramming increases CPU utilisation by keeping multiple jobs (Code and Data) in the memory so that the CPU always has one to execute.

Multitasking

Multitasking is a logical extension of multiprogramming.

  • CPU Executes multiple tasks by switching among them

  • The switching is very fast

  • Requires an interactive (Hands-On) computer where the user can directly interact with the computer

  • Response Time should be minimal

Kernel: A kernal is that part of the operating system which interacts directly with the hardware and performs the most crucial tasks Microkernel: The microkernel is much smaller in size than a conventional kernel and supports only the core operating system functionalities Shell: The shell - or command interpreter - is part of the operating system that receives commands from the users and gets them executed

System Call

A system call is a mechanism where a user program can request a service from the kernel for which it does not have the permission to perform. User programs typically do not have permission to perform operations like accessing I/O devices and communicating with other programs.

  • A user program invokes system calls when it requires such services

  • System calls provide an interface between a program and the operating system

  • System calls have different types

    • fork

    • exec

    • getpid

    • getppid

    • wait

    • exit

Dual-Mode Operation

  • User Mode

  • Kernel Mode / Supervisor Mode / System Mode / Privileged Mode

  • Mode Bit: Kernel - 0, User - 1

  • Request using a system call

Duties of the Operating System

Process Management

  • Creating and deleting user and system processes

  • Suspending and resuming processes

  • Interprocess Communication

  • Process Synchronisation

  • Deadlock Handling

Memory Management

  • Keeping track of which part of memory is used by which job

  • Allocating and deallocating memory space

Storage Management

  • File System Management

    • Creating, deleting, and manipulating files and directories

  • Mass Storage Management

    • Free Space Management

    • Storage Allocation

    • Disk Scheduling

Caching

Input-Output Management

Operating System Structures

  • Monolithic [MS DOS, Unix, Linux]

  • Layered [THE]

  • Microkernel [Mach, MINIX]

A Real-Time Operating System (RTOS) has well-defined time constraints which have to be met or the system will fail. An RTOS is used when rigid time constraints have been placed on the operation of processes or flow of data. An RTOS is often used in the control device in a dedicated application. RTOS has two types - Soft and Hard. Applications: Embedded Systems, Robotics, Scientific Utilities, etc. Booting: Booting is the process of starting the computer and loading the kernel. When a computer is turned on, the power-on self-tests (POST) are performed. Then the bootstrap loader, which resides in the ROM, is executed. The bootstrap loader loads the kernel or a more sophisticated loader.

Last updated