Friday, 18 March 2016

Storage and execution of computer program

Storage and execution

In the 1950s, computer programs were stored on perforated paper tape
Typically, computer programs are stored in non-volatile memory until requested either directly or indirectly to be executed by the computer user. Upon such a request, the program is loaded into random-access memory, by a computer program called an operating system, where it can be accessed directly by the central processor. The central processor then executes ("runs") the program, instruction by instruction, until termination. A program in execution is called a process. Termination is either by normal self-termination or by error – software or hardware error.

Simultaneous execution


Many operating systems support multitasking which enables many computer programs to appear to run simultaneously on one computer. Operating systems may run multiple programs through process scheduling – a software mechanism to switch the CPU among processes often so users can interact with each program while it runs. Within hardware, modern day multiprocessor computers or computers with multicore processors may run multiple programs.
Multiple lines of the same computer program may be simultaneously executed using threadsMultithreading processors are optimized to execute multiple threads efficiently.

Self-modifying programs

A computer program in execution is normally treated as being different from the data the program operates on. However, in some cases, this distinction is blurred when a computer program modifies itself. The modified computer program is subsequently executed as part of the same program. Self-modifying code is possible for programs written inmachine codeassembly languageLispCCOBOLPL/1, and Prolog.

Functional categories

Computer programs may be categorized along functional lines. The main functional categories are application software and system software. System software includes theoperating system which couples computer hardware with application software. The purpose of the operating system is to provide an environment in which application software executes in a convenient and efficient manner. In addition to the operating system, system software includes embedded programsboot programs, and micro programs. Application software designed for end users have a user interface. Application software not designed for the end user includes middleware, which couples one application with another. Application software also includes utility programs. The distinction between system software and application software is under debate.

Application software


Example of an app: GCalctool, a software calculator
There are many types of application software:

Utility programs

Utility programs are application programs designed to aid system administrators and computer programmers.

Operating system


An operating system is a computer program that acts as an intermediary between a user of a computer and the computer hardware. 
In the 1950s, the programmer, who was also the operator, would write a program and run it. After the program finished executing, the output may have been printed, or it may have been punched onto paper tape or cards for later processing. More often than not the program did not work.  The programmer then looked at the console lights and fiddled with the console switches. If less fortunate, a memory printout was made for further study. In the 1960s, programmers reduced the amount of wasted time by automating the operator's job. A program called an operating system was kept in the computer at all times.
Originally, operating systems were programmed in assembly; however, modern operating systems are typically written in C.

Boot program

stored-program computer requires an initial computer program stored in its read-only memory to boot. The boot process is to identify and initialize all aspects of the system, from processor registers to device controllers to memory contents. Following the initialization process, this initial computer program loads the operating system and sets theprogram counter to begin normal operations.

Embedded programs

The microcontroller on the right of thisUSB flash drive is controlled with embedded firmware.
Independent of the host computer, a hardware device might have embedded firmware to control its operation. Firmware is used when the computer program is rarely or never expected to change, or when the program must not be lost when the power is off.

Microcode programs


Microcode programs control some central processing units and some other hardware. This code moves data between the registers,busesarithmetic logic units, and other functional units in the CPU. Unlike conventional programs, microcode is not usually written by, or even visible to, the end users of systems, and is usually provided by the manufacturer, and is considered internal to the device.

No comments:

Post a Comment