Working inside operating system:
A user submits his job to the operating system. A user is anybody that desires work to be done by a computer system. A job is the collection of activities needed to do the work required. A job may be divided into several steps which are collectively called Job steps. Job steps are units of work that must be done sequentially, for example, the three steps of compile, load and execute. Once the operating system accepts a users job , it may create several processes. A process, or more commonly called a task is a computation that may be done concurrently with other computations. The figure below depicts the relationship between a user, a job, a process and the address space.
A user submits his job to the operating system. A user is anybody that desires work to be done by a computer system. A job is the collection of activities needed to do the work required. A job may be divided into several steps which are collectively called Job steps. Job steps are units of work that must be done sequentially, for example, the three steps of compile, load and execute. Once the operating system accepts a users job , it may create several processes. A process, or more commonly called a task is a computation that may be done concurrently with other computations. The figure below depicts the relationship between a user, a job, a process and the address space.
Another view of a process is the locus of points of a processor executing a collection of programs. The collection of programs and data that are accessed in a process forms an address space. The figure above depicts two sample address spaces, one for an I/O process and the other for a CPU process.
Note that the actual code for the file system portion of the operating system may be the same for both address spaces. If code is to be shared in this manner, it must be pure, or locks must be set to prevent race conditions. Pure code, sometimes called Reentrant code, is a code that does not modify itself.
The operating system must map the address spaces of processes into physical memory. this task my be assisted by special hardware, for example a paged system, or it may be performed primarily by software, for example a swapping system.
Multi programming is a term given to a system that may be several processes in states of execution at the same time. A process is in a state of execution if the computation has been started but has not been completed or terminated (error completion). A thing to note is that a process may be in a state of execution and not be executing which means some intermediate results have been computed but the processor is not currently working on this process.
Another feature found in most contemporary computer systems is special hardware and instructions used by the operating system. These instructions which are usually not available to the ordinary user, are commonly called Privileged Instructions. Most contemporary computers have at least two states of execution- a problem state (user state, slave state) and a supervisor state (executive state, master state). In the supervisor state the processor can correctly execute privileged instructions. Obviously one privileged instruction is to change the state of the machine. Others may start the I/O processors , change the protection rights of parts of memory, or change the interrupt status of the machine.
Protection hardware is often used to control access to parts of memory. For example, the operating system may deem certain parts of memory to be not writable. That means a user program may be prohibited from altering the operating system programs.
Interrupt hardware allows the operating system to coordinate operations going on simultaneously. It also allows the non sequential flow of a program. An interrupt is a mechanism by which a processor is forced to take note of an event, in much the same way as we may be interrupted from reading this blog by a friend or relative. Hardware may exist to mask certain interrupts.
We should note here that many computer configurations do not have all these special instructions or hardware. The IBM, for example, has no general masking facilities. On the other hand, many large systems have even more elaborate hardware facilities than referred to here, to assist the operating system, especially the I/O processes. What limitations does the lack of these facilities place on the user or purchaser or what does a user gain from these special features, is a matter for the coming blogs to answer.

No comments:
Post a Comment