A task is sequence of instructions treated as an element of work. Each application a user is running can be represented by a process that is running or executing. A process is different from a program in that it is the program’s execution – the program itself is regarded as static. A platform is a particular combination of software and hardware upon which a process is executing – a process is the culmination of a programs’ source code.
Source code is static, process is dynamic. Source code is abstract from the platform it is to be running on and therefore allows concentration on overall purpose not availability. Multitasking refers to ability to do more than one task at any one time – a system can have multiple processors in order to perform many tasks but it is likely that more tasks will be carried out than the system has processors. Multiple tasks will need to share resources which will create performance bottlenecks. Requirements of multitasking systems:
Not to waste hardware resources – always be busy doing some task if possible.
Keep users productive not in waiting.
Mediate access to shared resources.
Two types of multitasking operating systems – cooperative multitasking (apps are coded to allow other programs to run from time to time) and pre-emptive multitasking (operating system can request that a process give way to another).
A batch process is one which will run without any user input, a non-pre-emptive operating system is one which runs a process to completion before allowing another to run.
Runtime environment is responsible for managing loading and execution of a program and designating storage space. Before execution – source code is turned into platform specific machine code by means of a compiler. If the source code is changed in steps (line by line) then we say that it is translated.
Operating system mediates between concurrent process to prevent errors by running in two modes – user mode and supervisor mode. Main difference here being supervisor mode has option of controlling input and output operations and controlling entry and exit from this mode. This allows user process from causing too much damage if controlled properly.
Supervisor mode would be called upon if a user process requests something that is unusual or forbidden in trying to delete a file that is write-protected for example. In this way supervisor mode can be used to protect services and files that are essential to the running of the system. Memory – 4 types of memory:
(1) Registers – high-speed memory in which is stored data that is required immediately like instructions. Size of register referred to as data width.
(2) Cache memory – holds recently accessed data or results which is likely to be needed again soon.
(3) Main memory – RAM – provides main storage for processes and data.
(4) Disk storage – persistent storage – all other types above are volatile.
Hardware interfaces – communication between CPU and main memory and external devices is slow as it takes place over “communication highway” known as system bus. Delays are caused by system bus being busy. A hardware device has a device controller which controls the information being passed to and from the hardware device. A device controller acts independently of the main processor and therefore can run in parallel.
Processor – three basic functions:
Read and write binary numbers to memory locations.
Perform arithmetic operations up to a certain size.
Determine what instruction should be executed next which may involve some sense of evaluation of principles.
Program execution takes place in fetch-execute cycle which uses a program counter. The counter is responsible for logging which set of instructions is being used by a program and therefore which instruction set is needed next. The fetch-execute cycle then fetches the next instruction and executes this until