Operating Systems Overview
Computer Security
Last Update Unknown
Operating System
A program that controls the execution of application programs
An interface between applications and hardware
The main objectives of an OS:
- Convenience – Targets the user – ease of use
- Efficiency – Don’t want to waste resources
- Ability to evolve – Addressing issues, compatibility and security
Services Provided by the Operating System
Program development
- Editors and debuggers.
Program execution
- OS handles scheduling of numerous tasks required to execute a program
Access I/O devices
- Each device will have unique interface
- OS presents standard interface to users
Controlled access to files
- Accessing different media but presenting a common interface to users
- Provides protection in multi-access systems
System access
- Controls access to the system and its resources
Error detection and response
- Internal and external hardware errors
- Software errors
- Operating system cannot grant request of application
Accounting
- Collect usage statistics
- Monitor performance
The Role of an OS
A computer is a set of resources for the movement, storage, and processing of data.
The OS is responsible for managing these resources.
Operating System as Software
The OS functions in the same way as an ordinary computer software
• It is a program that is executed by the CPU
Operating system relinquishes control of the processor
Evolution of Operating Systems
Operating systems will evolve over time
- Hardware upgrades plus new types of hardware – such as Multicore processors
- New services – such as Video conferencing
- Fixes
OS has to keep up with hardware advancements to make sure all resources are used effectively
It may be easier to understand the key requirements of an OS by considering the evolution of Operating Systems
Stages include:
- Serial Processing
- Simple Batch Systems
- Multiprogrammed batch systems
- Time Sharing Systems
User Mode – Where games or browsers run
- User program executes in user mode
- Certain areas of memory protected from user access – To protect the system
- Certain instructions may not be executed
Kernel Mode – ‘The heart of the system’
- Monitor executes in kernel mode
- Privileged instructions may be executed, all memory accessible.
Uniprogramming
Processor must wait for I/O instruction to complete before preceding
Multiprogramming (Multi-tasking)
• When one job needs to wait for I/O, the processor can switch to the other job
Major Advances
Operating Systems are among the most complex pieces of software ever developed
Major advances include:
- Processes
- Memory management
- Information protection and security
- Scheduling and resource management
- System
Process
Fundamental to the structure of OS’s
A process is:
- A program in execution
- An instance of a running program
- The entity that can be assigned to and executed on a processor
- A single sequential thread of execution, a current state, and an associated set of system resources.
Causes of Errors when Designing System Software
Error in designing an OS are often subtle and difficult to diagnose.
Errors typically include:
- Improper synchronisation
- Failed mutual exclusion – When processes deal with memory, we don’t want other programs to get in the way
- Non-determinate program operation
- Deadlocks – Create an infinite loop
Deadlocks explained
It is possible for two or more programs to be hung up waiting for each other.
- e.g. two programs may each require two I/O devices to perform some operation (e.g., disk to tape copy).
- One of the programs has seized control of one of the devices and the other program has control of the other device.
- Each is waiting for the other program to release the desired resource.
Such a deadlock may depend on the chance timing of resource allocation and release.
Components of a Process
A process consists of
- An executable program
- Associated data needed by the program
- Execution context of the program (or “process state”) – Running, waiting for resources etc
The execution context contains all information the operating system needs to manage the process
Memory Management
The OS has 5 principal storage management responsibilities
- Process isolation
- Automatic allocation and management
- Support of modular programming – Access to and use of code libraries
- Protection and access control
- Long-term storage
Virtual Memory
File system implements long-term store – The way memory is organised
Virtual memory allows programs to address memory from a logical point of view
- Without regard to the limits of physical memory
Paging
Allows process to be comprised of a number of fixed-size blocks, called pages.
Virtual address is a page number and an offset within the page.
Each page may be located anywhere in main memory.
Information Protection and Security
The problem involves controlling access to computer systems and the information stored in them.
Main issues are:
- Availability – Available all the time
- Confidentiality – Only available to us
- Data integrity – Data should be there as we last left it. Nobody should be able to tamper with it.
- Authenticity – Before we get access to the data, we should authenticate ourselves.
Scheduling and Resource Management
Key responsibility of an OS is managing resources
Resource allocation policies must consider:
- Fairness
- Differential responsiveness – Some things are more important than others e.g. Monitor drivers before running games
- Efficiency
System Structure
• View the system as a series of levels
• Each level performs a related subset of functions
• Each level relies on the next lower level to perform more primitive functions
• This decomposes a problem into a number of more manageable sub problems
Different Architectural Approaches
Microkernel Architecture
Most early OS are a monolithic kernel
- Most OS functionality resides in the kernel.
A microkernel assigns only a few essential functions to the kernel
- Address spaces
- Interprocess communication (IPC)
- Basic scheduling
Multi-threading
A Thread is a dispatchable unit of work which executes sequentially and is interruptible
A Process is a collection of one or more threads which can run concurrently.
Symmetric multiprocessing (SMP)
An SMP system has
- multiple processors
- These processors share same main memory and I/O facilities
- All processors can perform the same functions
The OS of an SMP schedules processes or threads across all of the processors.
SMP Advantages
Performance
- Allowing parallel processing
Availability
- Failure of a single process does not halt the system
Incremental Growth
- Additional processors can be added
Scaling – There is always a threshold, at which things are no longer more efficient.
Distributed Operating Systems
Provides the illusion of
- a single main memory space and
- single secondary memory space
Early stage of development
Object-oriented design
Used for adding modular extensions to a small kernel
Enables programmers to customise an operating system without disrupting system integrity
Single-User Multitasking
From Windows 2000 on Windows development developed to exploit modern 32-bit and 64-bit microprocessors
Designed for single users who run multiple programs
Main drivers are:
- Increased memory and speed of microprocessors
- Support for virtual memory
- Windows draws heavily on the concepts of object-oriented design.
Client/Server Model
Windows OS, protected subsystem, and applications all use a client/server model
- Common in distributed systems, but can be used internal to a single system
Processes communicate via RPC
UNIX OS
Features of UNIX OS
- Multi-user, multitasking operating system
- It can be used as the master control program in workstations and servers.
- Hundreds of commercial applications are available
- In its heydays, UNIX was rapidly adopted and became the standard OS in universities.
Limitations of UNIX OS
- The unfriendly, terse, inconsistent, and non-mnemonic user interface
- UNIX OS is designed for a slow computer system, so you can't expect fast performance.
- Shell interface can be treacherous because typing mistake can destroy files.
- Versions on various machines are slightly different, so it lacks consistency.
- UNIX does not provide any assured hardware interrupt response time, so it does not support real time response time systems.
Modular Monolithic Kernel
Although monolithic, the kernel is structures as a collection of modules
- Loadable modules
- An object file which can be linked and unlinked at run time
Characteristics:
- Dynamic Linking
- Stackable modules
Linux OS
Features of Linux OS
• Support multitasking
• Programs consist of one or more processes, and each process have one or more threads
• It can easily co-exists along with other Operating systems.
• It can run multiple user programs
• Individual accounts are protected because of appropriate authorisation
• Linux is a replica of UNIX but does not use its code.
Limitations of Linux OS
• There's no standard edition of Linux
• Linux has patchier support for drivers which may result in misfunctioning of the entire system.
• Linux is, for new users at least, not as easy to use as Windows.
• Many of the programs we are using for Windows will only run on Linux only with the help of a complicated emulator. For example. Microsoft Office.
• Linux is best suitable for a corporate user. It's much harder to introduce in a home setting.