Module 4 : Architecture of Advanced Microprocessor

Lecture 30 : Muti-User/ Multi-Tasking Operating System

Multi-User/ Multi-Tasking Operating System:

The need for advanced Microprocessor architecture mainly arose because of multi-user or multi-tasking operating system. 8086 can serve a simple user. Hence 8088 (similar to 8086) was initially adopted (in 1980's) for Personal Computer.

Multi-user operating system, as the name implies, is supposed to serve multiple users at the same time. In other words, the operating system should be capable of running multiple user programs. Each user is also called a task. Hence multi-user operating system also called multi-tasking operating system. A schematic diagram of a multi-tasking operating system is shown in the figure.

Fig. 30.1  Schematic diagram of multi-user/ multi-tasking operating system (OS)

The part of the operating system (OS) that serves various tasks is called a scheduler or a dispatcher or a supervisor. It is obvious that all users can not be served at the same instant of time. Hence the OS serves one user at a time and goes to the next user when the current user has been served for a specified time. This process is called "scheduling". There are two methods of scheduling. They are as follows.

  1. Time slice method : In this method, each task/ user is served for a fixed time of 20 ms. This method works well when the number of users is less. Since users are assumed to be slower than the processor, each user feels that he is served continuously. However, this method becomes inefficient with the increase of number of users. Less important user/ task is also served for the same time as a critical or important task. This, sometimes, becomes unacceptable.

  2. Pre-emptive priority based scheduling : In this method, each task is assigned a priority. A low priority task can be interrupted by a high priority task. When the high priority task completes execution returns to the low priority task.

Important facts in a multi tasking operating system:

  1. Preserving the environment:
    Each task occupies some memory and runs its own program. It should be remembered that each task is independent and needs to be protected from other tasks. In the same time, when the next task has to be served, the various registers and status of the currently executed task should be preserved so that the current task can be served again after a specified time. Hence the environment of each task has to be preserved.
  2. Resource sharing:
    Resources are available for the use of various tasks. Some examples of resources are printer, X-Y plotter, disk drives, etc. Each resource is associated with a flag called "semaphore". When a task/ user is using a particular resource, the task sets the corresponding semaphore indicating that the resource is in use and not available for other task. When the task finishes its work with the resource, it resets the semaphore so that some other task can use the same resource.