I dealt with computers first when I was in the elementary school around 1998, where I used to play Sky Roads on DOS computers. 2000 was the year I convinced my father to buy a computer at home, Some guy came at home and installed Windows so that we can deal with the computer, This Windows was like a mysterious thing or like a ghost that controls my PC, Actually I didn’t pay attention to know what Windows is all about rather than it is a kind of “Operating System” ! but as an end-user I was very good at using it.
Now as a computer science student, I figured out what Operating System – abbreviated OS – is all about, this article intend to give a brief overview to Operating Systems.
What is OS?
- A program that controls the execution of application programs, and act as an interface between the application and the computer hardware.
- It has 3 objectives:
- Convenience; makes computer more convenient to use.
- Efficiency; allows us to use computer resources in an efficient manner.
- Ability to evolve; allow for further development to allow to system functions.
OS as a user/computer interface
- OS provides a variety of services in the following areas:
- Program development: editors, debuggers they are tools supplied with the OS.
- Program execution: automate a number of steps to execute a program.
- Access to I/O devices: act as a façade to I/O devices.
- Controlled access to files: provide protection mechanism to control access to files.
- System access: protect system data and resources from unauthorized users.
- Error detection and response: detect program and hardware errors so as to clear the error condition with the least impact on the running applications.
- Accounting: monitoring system resources and collect usage statistics, help in judging whether to upgrade the resources or it is efficient enough.
OS as a Resource Manager
- Memory allocation is controlled by the OS and the MMU (Memory Management Unit).
- The OS decides when I/O device can be used by a program in execution.
- Control access to and use of files.
- The processor operation itself is controlled by the OS, that OS decides how much time the processor can spend on a particular program.
What makes OS evolve ?
- Hardware upgrades and new types of hardware: New types of hardware require that the OS be able to deal with it, so OS should be built with support for that hardware.
- New services: OS offers new services demanded by the users or system managers.
- Bug Fixes: Bugs appear over time, and detected by users, so OS should be fixed for this bugs, and sometimes fixing a bug raise another bug.
OS Evolution
In the dark ages, when there was no OS from late 1940s to mid-1950s (I call this years: before OS, abbreviated BOS like BC) the programmer had to deal directly with the computer hardware, These computers were run from a console consisting of display lights, toggle switches, some form of input device.
-
Serial Processing:
- This systems presented two main problems
- Scheduling: users had to sign-up sheet to reserve computer time, users couldn’t`t know precisely how long it will take to finish their program.
- Setup time: A single program called a job had to be installed before used with its compiler and code, saving the object program and linking and so on to run the program.
- Users have access to computer in series.
- Simple Batch Systems
- Monitor: a software program that handle executing the jobs provided by the user on tapes or disks.
-
Multiprogrammed Batch Systems
- The I/O devices are much slower than the processor, leaving the processor idle most of the time waiting for the I/O devices to finish their operations.
- Uniprogramming: the processor starts executing a certain program and when it reaches an I/O instructions, it must wait until that I/O instructions is fully executed before proceeding.
- Multiprogramming: in contrast to the uniprogramming, when a job needs to wait for an I/O instruction, the processor switches to another job executing it until the first job finishes its waiting I/O instructions, the processor continue to swap between jobs as it reaches an I/O operation.
- Multiprogramming batch system must rely on certain hardware capabilities such as process switching when swapping between program execution.
- Interrupt-driven I/O or DMA helps a lot in multiprogramming environments, allowing the processor to issues an I/O command and proceed executing another program.
-
Time-Sharing Systems
- As multiprogramming allows processor to handle multiple batch jobs at time, it can allow the processor to handle multiple interactive jobs at time, through time sharing.
- Time Slicing: there is a system clock that generates interrupts at a constant rate, allowing the OS regain control and assign the processor to another process.
Time sharing and multiprogramming raise a host for new problems
- If multiple jobs are in memory they must be protected from interfering with each other.
- File systems must be protected from access by unauthorized users.
- The programs contention for resources (mass storage, printer, … ) must be handled by the OS.
Major Achievements in OS
- The Process
- Possible Definitions:
- A program in execution.
- An instance of a program running on a computer.
- The interrupt helped programmers in developing early multiprogramming and multiuser interactive systems.
- Errors caused by handling more than one process at time is:
-
- Improper synchronization
- Failed mutual exclusion: allow only one routine at a time to perform an update against the file.
- Non-determinate program operation: programs may interfere with each other when they share memory and their process is interleaved by the processor.
- Deadlocks: 2 programs hung up waiting for each others to release a resource.
- The execution context or the process state is the internal data by which the OS is able to control the process.
- The context contains the content of the processor registers, as with information to use by the OS as the priority of the process.
- Possible Definitions:
- Memory Management
- Process Isolation: OS should prevent independent processes from interfering with each other.
- Automatic allocation and management: Programs should be dynamically allocated, and allocation should be transparent to the programmer.
- Support of modular programming: Programmers should be able to write their own programs and create, destroy and alter the size of it dynamically.
- Long-term storage: saving information for extended periods of time.
- Protection and access control.
- Information Protection and Security
- the use of time-sharing systems, computer networks has brought concern for the protection of information.
- We are concerned with the problem of controlling access to the computer system.
- Work in this area can be grouped in:
- Availability: protect the system against interruption.
- Confidentiality: users cannot read data for which access is unauthorized.
- Data integrity: protection of data from unauthorized modification.
- Authenticity: verification of the identity of the users and validity messages.
- Scheduling and Resource Management
- Any resource allocation and scheduling policy must consider:
- Fairness: jobs of the same class competing for a resource are to be given equal and fair access to that resource.
- Differential responsiveness.
- Efficiency: OS should maximize processor utilization, minimize response time, and accommodate as many users as possible.
- OS elements involved in the scheduling of process and the allocation of resources in a multiprogramming environment:
- Short-term queue: contains processes in the main memory and are ready to run as soon as the processor is made available.
- Short-term scheduler: decides which process in the short-term queue to use the processor, a common strategy is to give each process some time in term (round-ribbon) technique.
- Long-term queue: list of all new jobs waiting to use the processor, the OS adds jobs to the system by transferring process from the long-term queue to the short-term queue.
- I/O queues: each device has a queue for the processes waiting to use that device; it is the OS that decide which process to assign to an available I/O device.
- Any resource allocation and scheduling policy must consider:
References
Operating Systems: Internals and Design Principles (6th Edition), William Stallings