A program that acts as an intermediary between the user and the computer hardware. It is able to run user programs, improves convenience when using the computer and efficiently uses computer hardware.
Operating System
Provide ease of use and 'readability' to the user
Acts as a resource allocator and control program for the hardware of the system
Manages the execution of programs by the user
Kernel - Main program running at all times on the computer
System Program - separate from the kernel. Comes with the operating System
Application Program - all programs not associated with the operating system
Middleware
A set of software frameworks that allow developers to have additional capabilities when creating applications
Parts of a Computer System Structure
Hardware
Operating System
Application Programs
Users
Computer System Organization
CPUs and I/O devices connect through a common system bus which grants access to shared memory of the computer. These can run concurrently
CPU moves data from/to main memory from the local buffers that come from the I/O devices
The device controllers, individually, are able to control specific devices in the system, have local buffers and a device driver to manage it. These use interrupts to signal the end of an operation
Interrupts
Operating Systems are interrupt driven
Interrupt Vector - Contains the addresses of all service routines
Interrupt Architecture - Would save the address of the interrupted instruction
Trap or Exception - software generated interrupt caused either by an error or user request
Interrupt Handling - Separate segments of code that determine the action taken when encountering a certain interrupt
I/O Handling Methods
Control returns to user program only upon completion
Control returns to user program without completion
System Call
Request by the system to the Operating System to allow the user to wait for I/O completion
Types of Storage
Main Memory - Random Access Memory (RAM) and Dynamic Random Access Memory (DRAM)
Secondary Storage - Hard Disk Drives (HDD)
Non-Volatile Memory (NVM)
Hard Disk Drives (HDD)
Surface of the disc are divided into tracks that are divided into sectors
Disc Controller - Determines the logical interactions between device and computer
Non-Volatile Memory (NVM)
Known to be faster than hard disks. Growth recently due to the capacity and performance.
Direct Memory Access
Device controller is able to transfer blocks of data from buffer storage directly to main memory without CPU intervention
One interrupt per block is generated
Operating-System Operations
Bootstrap Program - Code that is used to initialize the system and power the Kernel
System Daemons - Services that are provided outside of the Kernel
Kernel Interrupt - Hardware interrupt is triggered by one of the devices followed by a software interrupt (either software error or system call)
Multiprogramming
Batch System - Organization of the code and data for the CPU to always be busy. All total jobs are listed and kept in memory. Job Scheduling - When a job is selected out of the queued jobs by the OS
Timesharing - Extension of the Batch Systems capable of having the CPU switch jobs frequently so that the user is able to interact with each of the jibs happening. Response time - Less than one (1) second. Process - At least one (1) program being executed in memory. CPU Scheduling - When the system has several jobs queued to run. Swapping - When processes do not fit in the memory and thus need to be moved in and out. Virtual Memory - allows the execution of processes without the need to be reliant on the physical memory
Dual-mode Operation
Allows the OS to rely on both the user and kernel
Mode Bit - Provided by hardware. Helps in identifying when the system is running based on the user or kernel code
Timer
Used in order to prevent infinite loops from occurring by interrupting the ongoing process after a certain criteria was reached
Process
Program in execution. Unit of work in a system. Active Entity
Program
Passive Entity
Process Resources
CPU
Memory
I/O
Files
Initialization Data
Single-threaded Process
Has one program counter for location of next instruction to execute sequentially
Multi-threaded Process
One (1) program counter per thread. Usually has many processes operating at the same time on one or more CPUs
Operating System in Process Management
User and System process creation and deletion
Process suspension
Providing mechanisms for synchronization, communication and deadlock handling
Memory Management Activities
Optimizing CPU utilization and user response
Tracking which part of the memory is used
Deciding what process and data to be moved in and out of the memory
Memory Space organization and allocation
File-system Management
Creating and deleting files and directories
Primitives to manipulate files and directories
Mapping files onto secondary storage
Backup files onto stable storage devices
File
Abstract physical properties to logical storage units. Organized into directories
Mass-Storage Management
Mounting and connections
Free-space management
Storage Allocation
Disk Scheduling
Partitioning
Protection
Caching
Important principle, performed at many levels in a computer where information in use is copied from slower to faster storage temporarily
I/O Subsystem Responsibilities
Buffering - Storing data temporarily while being transferred
Caching - Storing parts of data in faster storage for performance
Spooling - The overlapping of output of one job with input of another
Device-driver interface
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
User Identities - including name, number and assigns a User ID associated with all the files that the user has control over
Group Identifier - Allows set users, defined by a Group ID, to control files
Private Escalation - Allows a user to change to a more effective ID with more rights
Virtualization
Emulation - Used when source CPU type different from target type (i.e. PowerPC to Intel x86)
Virtualization - OS natively compiled for CPU, running guest OSes also natively compiled. Includes Virtual Machines, which can run natively where they are also the host
Network Types
Local Area Network (LAN)
Wide Area Network (WAN)
Metropolitan Area Network (MAN)
Personal Area Network (PAN)
Network Operating System
Provides features between systems across networks which allows systems to exchange messages
Multiprocessor Systems
Advantages are an increased throughput, Economies of scale and Increased Reliability
Asymmetric Multiprocessing - Each processor is assigned a specific task
Symmetric Multiprocessing - Each processor performs all tasks
Dual-Core
Multi-chip and Multicore. System containing all chips and chassis containing multiple separate systems.
Clustered Systems
Like multiprocessor systems, but multiple systems working together usually sharing storage through a storage-area network (SAN)
Asymmetric Clustering - Has one machine in standby mode
Symmetric Clustering - Has multiple nodes running applications while monitoring one another
Parallelization is required as written by applications. While some having distributed lock managers (DLMs)
PC Motherboard is a good example of a fully-functioning computer once its slots such as processor, DRAM, PCIe (GPU and SSD), and Input/Output connectors are populated
Types of Computer Environments
Traditional
Mobile
Client Servers
Peer to Peer
Cloud Computing
Real-Time Embedded Systems
Client Servers
Terminals that are used to respond to client requests and a system that is able to store client information through a database
Compute-Server System
Provides an interface to client request services
File-Server System
Provides an interface for clients to store and retrieve files