Subscribe by Email


Showing posts with label Registers. Show all posts
Showing posts with label Registers. Show all posts

Sunday, July 14, 2013

What is Polling?

- Polling is often referred to as the polled operation.
- When the statuses of the external devices are actively sampled by a client program just like a synchronous activity is referred to as the polling. 
- The common use of the polling is in the input and output operations. 
- In rare cases, polling is also called as the software driven I/O or just simply as polled I/O. 
- As and when required, polling is also carried out with the busy waiting synonymous. 
- Polling is then referred to as the busy–wait polling. 
- In this case whenever it is required to carry out an input/ output operation, the system just checks the status of the device required for fulfilling this operation until it is idle. 
- When it becomes idle it is accessed by the I/O operation. 
- Such polling may also refer to a state in which the status of the device is checked again and again for accessing it if idle. 
- If the device is occupied, the system is forced to return to some other pending task. 
- In this case the CPU time is wasted less when compared to what happens in busy waiting. 
- However, this is not a better alternative to interrupt driven I/O polling. 
- In single purpose systems that are too simple, using busy-wait polling is perfectly fine if the system cannot take any action until the I/O device has been accessed. 
- But traditionally, the polling was thought to be a consequence of the operating systems and simple hardware that do not support multitasking. 
- The polling works intimately with the low level hardware usually. 
- For example, a parallel printer port can be polled for checking whether or not it is ready for printing another character. 
- This involves just the examination of a bit. 
- The bit to be examined represents the high or low voltage stage of the single wire in the cable of the printer during the time of reading. 
- The I/O instruction by which this byte is read is also responsible for transferring the voltage state directly to the eight flip flops or circuits. 
- These 8 flip flops together constitute one byte of a register of CPU. 

Polling also has a number of disadvantages. 
- One is that there is limited time for servicing the I/O devices. 
- Polling has to be done within this time period only. 
- But in some cases there are many devices to be checked which cause the polling time to exceed the given limit. 
- The host keeps on hitting the busy bit until the device becomes idle or clear. 
When the device is idle, the state is written in to the command register and also in the data out register. 
- The command ready bit is set to 1. 
- The controller sets the busy bit once it knows that the command ready bit has been set.  
- After reading from the command register, the controller carries out the required I/O operation on the device. 
- On the other hand, if the read bit has been set to one, the controller loads the device data in to the data in register. 
- This data is further read by the host. 
- Once the whole action has been completed, the command ready bit is cleared by the controller. 
- The error bit is also cleared for showing that the operation has been completed successfully. 
- At the end the busy bit is also set.
- Polling can be seen in the terms of master slave scenario where the master sends inquiring about the working status slave devices i.e., whether they are clear or engaged. 


Thursday, June 20, 2013

Explain the single and multiple partition techniques?

There are a number of allocation techniques available and all have different properties and allocate memory based on different principles. One prominent type of allocation is the partitioned allocation. 
- In partitioned allocation the primary or the main memory of the system is divided into a number of contiguous memory blocks which are commonly known as the memory partitions. 
- Each of these partitions consists of all the information that might be required for carrying out a specific task. 
- The task of allocating these memory partitions to various jobs and processes and de-allocating them after use is the duty of the memory management unit.  
But partitioned allocation cannot be carried out by the help of software alone. 
It requires some hardware support. 
- This support prevents interference of the various jobs in to each other and with the operating system as well. 
- For example, a lock and key technique was used by the IBM system/ 360. 
- Some other systems made use of the registers called the base and bound registers containing the partition limits and these were also used for flagging if any invalid access was made. 
- Limits register was used by the UNIVAC 1108 having separate base and bound data and instructions. 
- A technique called the memory interleaving was used by this system for placing so called I banks and d banks in different memory modules. 

Partitions are of two types namely:
Ø  Static partitions: These are defined at the boot time or IPL (initial program load) or sometimes by the computer operator. An example of system using static partitions is IBM system/360 operating system multi-programming with MFT (fixed number of tasks).
Ø  Dynamic partitions: These are created automatically for the specified job. An example is of the IBM system/ 360 operating system multi-programming with MVT (variable number of tasks).

- The hardware typed memory such as the base and bound registers (GE – 635, PDP – 10 etc.), Burroughs corporation B5500 etc. is used for relocating the memory partitions. 
- The partitions that can be relocated can be compacted to form larger contiguous memory chunks in the main memory. 
- Some systems allow for swapping out the partitions to the secondary storage and in turn to some additional memory.
The partitioned allocation offers two types of allocation techniques namely:
  1. Single partition techniques
  2. Multiple partition techniques

- Single partition techniques are the ones that are used for the single time sharing partition for swapping in and out the memory partitions. 
- These techniques are used by the IBM’s TSO (time sharing option). 
- The multiple partition techniques are used in the multiple time sharing partition. 
- In DOS systems when the disk is partitioned, each of the memory partitions act as if it is an individual disk drive. 
- Partitioning is useful for the systems where there are more than one operating system. 
- Partitioning techniques are meant for increasing the efficiency of the disk. 
Hard and soft partitioning is used on the apple Macintosh computers. 
- The creation, relocation and deletion of the memory partitions can be harmful for the data. 
- That’s why it is good to have back up of the data stored on your system. 
Several issues have to be considered if you want to install more than one operating system on your computer. 
- Day by day disks are becoming less expensive and bigger. 
- You can go for separate disks for storing data and installing Oss. 


Friday, May 3, 2013

What is a Dispatcher?


A number of types of schedulers are available that suit the different needs of different operating systems. Presently, there are three categories of the schedulers:
  1. Long-term schedulers
  2. Medium-term schedulers
  3. Short-term schedulers
Apart from the schedulers there is one more component involved in the scheduling process and is known as the dispatcher. 
- It is the dispatcher that gives a process power to control the CPU. 
- To which process this control is to be given is selected by the short-term scheduler. 
- This whole process involves the following three steps:
  1. Switching the context
  2. Turning on the user code
  3. Making a jump to the exact location of the program from where it has to be restarted.
- Values taken from the program counter are analyzed by the dispatcher and accordingly it fetches instructions and feeds data in to the registers. 
- The dispatcher unlike the other system components needs to be very quick since it is invoked during all the switches that occur. 
- Whenever a context switch is invoked, the processor gets in to an idle state for a very small period of time. 
- Hence, it is required that the context switches that are not necessary might be avoided. 
- The dispatcher takes some time for stopping one process and start running the other one. 
- The dispatch latency is what we call this time.

- Scheduling and dispatch are complex processes and interrelation to each other. 
- These two are very much essential for the operation of the operating system. 
Today, architectural extensions are available for the modern processors that provide a number of banks of registers.
- Swapping of these registers in hardware is possible and therefore a certain number of tasks are capable of retaining their full registers. 
- Whenever an interrupt triggers the dispatcher, it sends to it the full set of the registers belonging to the process that was being executed at the time of occurrence of the interrupt. 
- Here, the program counter is not considered. 
- Therefore, it is important that the dispatcher should be written carefully for storing the present states of the registers on being triggered. 
- In other words, we can say that for the dispatcher itself, there is no immediate context. 
- This saves it from the same problem. 

Process of Dispatcher

Below we try to describe in simple words what actually the process is.
  1. The program presently having the context is executed by the processor. Things used by this program include stack base, flags, program counter, and registers and so on. There is a possible exception of the reserved register that is native to the operating system. The executing program does not have any knowledge regarding the dispatcher.
  2. For dispatcher a timed interrupt is triggered. Here the program counter jumps to the address listed in the BIOS interrupt. This marks the beginning of the execution of the dispatch sub routine. The dispatcher then deals with the stacks and the registers etc. of the program that raised the interrupt.
  3. Dispatcher like the other programs consists of some sets of instructions that operate up on the register of the current program. These instructions know everything of the previously executed programs. Out of these, the first few instructions are responsible for storing the state of the program.
  4. Dispatcher next determines which program should be given the CPU next for executing. Now it deletes all the statistics of the previously executed state and fills in the details of the next process to be executed.
  5. Dispatcher jumps to the address mentioned in the program counter and establishes a full context on the processor.
- Actually dispatcher does not really require registers since its only work is to write the current state of the CPU in to a memory location that has been predetermined. 
- It then loads in to the CPU another process from other predetermined location. 


Facebook activity