Before we talk about operating systems, let’s talk about punch cards. Punched cards are pieces of cardboard that can carry numerical information thanks to the holes drilled into certain points on it. They were widely-used means of inputting data into early computers. Herman Hollerith was an statistician who developed an electromechanical tabulating machine for punched cards.
Holes were punched in the card represent different pieces of data. Someone would need to punch the holes by hand or with a machine then use a tabulating machine to compile data from the cards. In the past, people who did these jobs were called computer operators. It sounds very strange that a profession no longer exists. On the first computers, with no operation systems, every program needed the full hardware specification to run correctly and perform standart tasks, and its own drivers for peripheral devices like printers and punched paper card readers. The growing complexity of hardware and application programs eventually made operating systems a necessity for everyday use.
Sembolic languages, assemblers and compilers were developed for programmers to translate symbolic program-code into machine code that previously would have been hand-encoded. Later machines came with libraries of support code on punched cards or magnetic tape, which would be linked to the user’s program to assist in operations such as input and output. This was the genesis of the modern day operating systems; however machines still ran a single job at a time.
Operating System
Operating system is a program that acts as an intermediary between a user of a computer and the computer hardware.
Operating system goals:
- Execute user programs and make solving user problems easier
- Make the computer system convenient to use
- Use the computer hardware in an efficient manner
Operating system is a resource allocator
- Manage all resources
- Decides between conflicting requests for efficient and fair resource use
Operating system is a control program
- Controls execution of programs to prevent errors and improper use of the computer
Operating System Structure
A computer system can be divided into four components:
- Hardware — Computer hardware includes the physical parts of a computer. (Cpu, monitor, mouse etc.)
- Operating system — Controls and coordinates use of hardware among various applications and users.
- Application programs — define the ways in which the system resources are used to solve the computing problems of the users. (Word processors, compilers, web browsers, database systems, video games etc.)
- Users — (people, machines, other computers)
The operating system is divided into layers. Each layer uses services of only lower-level layers. The bottom layer is the computer hardware (layer 0). The operating system which is the intermediary between user of a computer and the hardware, is the first layer. In layer 2 all the installed programs resides. The highest layer is the user or user interface.
What Operating Systems Do
- Users want convenience, ease of use
- Shared computer such as mainframe or minicomputer must keep all users happy
- Users of dedicate systems such as workstations have dedicated resources but frequently use shared resources from servers
- Handheld computers are resource poor, optimized for usability and battery life
- Some computers have little or no user interface, such as embedded computers in devices and automobiles
Computer Startup
Booting is the process of starting a computer. It can be initiated by hardware such as a button press, or by a software command. After it is switched on, a computer’s CPU has no software in its main memory, so some process must load software into memory before it can be executed. This may be done by hardware or firmware in the CPU.
Firmware is a software program or set of instructions programmed on a hardware device. It prodives the necessary instructions for how the device communicates with the other computer hardware. Firmware is held in non-volatile memory devices such as ROM, EEPROM, and flash memory.
Operating system is stored on non-volatile memory. Read-only memory would contain a small bootloader what would have basic intelligence to read. Bootloader is a computer program that is responsible for booting a computer. The bootloader will often perform some core initialization of the system hardware and then load the operating system.
Computer System Operation
- One or more CPUs, device controllers connect through common bus providing access to shared memory
- Concurrent execution of CPUs and device competing for memory cycles
- I/O devices and the CPU can execute concurrently
- Each device controller is in charge of a particular device type
- Each device controller has a local buffer
- CPU moves data from/to main memory to/from local buffers
- I/O is from the device to local buffer of controller
- Device controller informs CPU that it has finished its operation by causing an interrupt
- Interrupt transfers control to the interrupt service routine generally, through the interrupt vector, which contains the addresses of all the service routines
- Interrupt architecture must save the address of the interrupted instruction
- Incoming interrupts are disabled while another interrupt is being proccessed to prevent a loss interrupt
- A trap is a software-generated interrupt caused either by an error or a user request
- An operating system is interrupt driven
- The operating system preserves the state of the CPU by storing registers and program counter
- Determines which type of interrupt has occurred: pooling, vectored interrupt system
- Separate segments of code determine what action should be taken for each type of interrupt
CPU: Central processing unit is the electronic circuitry that executes instructions comprising a computer program. The CPU performs basic arithmetic, logic, controlling, and input.
Device Controller: Device controller is a hardware unit attached I/O bus of the computer and works like an interface between a device and a device driver. It is an electronic component consisting of chips that is responsible for handling the incoming and outgoing signals of the CPU. It acts as a bridge between the device and the operating system which receives commands from OS, such as read, write or more complex commands.
Bus: A pair of signal lines that facilitate the transfer of multi-bit data from one system to another is known as a bus.
Interrupt: Interrupt is a signal emitted by hardware or software when a process or an event needs immediate attention. It alerts the processor to a high-priority process requiring interruption of the current working process.
Register: The register in the control unit of a digital computer that stores the current instruction of the program and controls the operation of the computer during the execution of that instruction.
Program Counter: A program counter is a CPU register in the computer processor which has the address of the next instruction to be executed from memory. It is a digital counter needed for faster execution of tasks as well as for tracking the current execution point.