A Aspect Of An Operating System

Print   

02 Nov 2017

Disclaimer:
This essay has been written and submitted by students and is not an example of our work. Please click this link to view samples of our professional work witten by our professional essay writers. Any opinions, findings, conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of EssayCompany.

So how virtual memory works? Most computers currently have something like 32 or 64 megabytes of RAM accessible for the CPU to use. However, that sum of RAM is not sufficient to perform all of the programs that most customers assume to perform at one time. For instance, if you run the operating system, an e-mail program, a Web browser and word processor into the RAM at the same time, 32 megabytes is not sufficient to store it all. If there were no these kinds of thing like the virtual memory, then when you loaded up the available RAM your computer will respond, "Sorry, you cannot fill any more applications. Please shut the application to run a new program." With the help of virtual memory, what the computer able to perform is look at RAM for spaces that have not been utilized and duplicate them onto the hard disk. This makes free space in RAM to run the new application. Because this duplicating occurs automatically, you never even notice it is occurring, and it affects your computer feel like it has infinite RAM space although it only has 32 megabytes mounted. Due to hard disk space is so significantly cheaper compare to RAM chips, it also has a pleasant economic advantage. The read/write pace of a hard drive is substantially lower compared to RAM, and the technology of a hard drive is not created to accessing tiny bits of data at a time. If your system has to depend too heavily on virtual memory, you will detect a major performance decline. The essential is to have sufficient RAM to manage everything you are likely to operate on concurrently then, the only time you "experience" the sluggishness of virtual memory is when there's a minor pause when you're switching tasks. When that's the scenario, virtual memory is excellent.

What is virtual memory with paging? An approach used by virtual memory operating systems to guarantee that the data you require is accessible as rapidly as possible. The operating system duplicates a specific amount of pages from your storage device to main memory. When a program requires a page that is not in main memory, the operating system duplicates the required page into memory and duplicates another page back to the disk. What is virtual memory with segmentation? Virtual memory with segmentation divides virtual address spaces into variable-length segments.

The comparison of virtual memory with paging and virtual memory with segmentation. Both are virtual memory techniques. Both methods involve dividing up primary into smaller segments. Both approaches also try to make optimum use of RAM(Random Access Memory). Both methods require to make use of indexing in order to access seldom used code.

The contrasting of virtual memory with paging and virtual memory with segmentation. Segments can be shifted in and out of that space. Pages there can "page" in and out of main memory, giving two levels of virtual memory. Paging provides a fixed-sized block of memory, regarded as a frame, from the backing store to the main memory whilst segmentation is the very same for an entire big segment of data, which could have in any size. Paging occurs when an application demands for a page that does not present on the main memory, but it is illusioned to be exist by the virtual memory. In this situation, an expected system known as "trap" request for this page to be transfered from the backing store to be kept in one of the free memory areas in the memory (if possible) or substitute it with any other page in it in respect to the Page replacement algorithm being utilized. Now, considering that pages are fixed-sized blocks of memory, then the case of page substitution is simple since it is identified that 1 page (fixed size memory-block) requires to be substituted for this page to be accommodated. But as for the segments, due to the fact they are of varying sizes (maybe bigger (normally) or smaller than a common page-size), it is hard to make a space for it in the main memory. The Segment replacement algorithm in that situation will be a little complicated and less efficient to properly produce an appropriate-sized memory block for this segment to be transported from the backing store into the main memory.

Also, an issue which barely possible could happen where the segment size is too huge for the physical memory to accommodate.

An interrupt is a dynamic event that requires prompt attention by the CPU. Normally an interrupt only requires a brief period or interval of CPU time to serve it. After that the initial process can continue its task. There are two types interrupting events. The hardware interrupts that are those given by I/O device controllers when they require CPU to process I/O data, and software interrupts, also regarded as traps, that are raised when the existing process carries out a special trap instruction to show that something incorrect has occurred or the process requires unique service from the operating system (like carrying out some I/O operation). Only a marginal amount of types of interrupts are defined. For every kind of I/O devices, there is an exclusive program known as an interrupt handler to assist the interrupt requests from these devices. For all software traps, there is also a particular trap handler defined. Every type of interrupt has an affiliated priority level. An operating process will only get interrupted by an interrupt source or trap of greater priority. When the CPU is performing an interrupt handler, the interrupt handler might be further interrupted by an interrupt source of even greater priority.

How to issue an interrupt request?

The CPU, main memory, and I/O devices are all linked via a system bus. The

system bus comprises of numerous parallel metal wires, some carrying data, some carrying addresses for the main memory or I/O device IDs (and also addresses for I/O device ports; every I/O device has a couple of registers known as ports, and every port has a special address), and some carrying control signals. There are two groups of wires of the system bus that are crucial to the functioning of interrupt processing:

• The Interrupt Request Line: It has two states. When it is high (carrying high voltage), at most one I/O device or a trap is demanding an interrupt.

• The Address Lines: While in interrupt processing, they will carry the device ID of the interrupt source with the top priority.

For an I/O device to create an interrupt request, it only requires to raise the Interrupt Request Line. Many I/O devices can raise the Interrupt Request Line at the similar time, but only the ID of the device with the top priority will be broadcast on the Address lines.

How is an interrupt request detected?

There is a unique Interrupt Enabled Bit in a system control register. If this bit carries 1, the system is prepared to process interrupt requests. If this bit carries 0, the system will neglect any interrupt requests. The latter is crucial when the present process is performing some very sensitive task that an interrupt could destabilize the system.

For the discussion of interrupt processing, the execution of an instruction has three stages:

a. Read the instruction from the main memory, and store it in the Instruction

Register

b. Carry out the instruction

c. If the Interrupt Enabled Bit is holding 1, then check the Interrupt Request Line for any interrupt requests. If the Interrupt Request Line is raised, enter the Interrupt Processing Phase

How to find the interrupt’s handler?

As I stated before, every type of interrupts will be performed by its own special interrupt handler. These interrupt handlers are a vital aspect of an operating system. The initial address of every of these interrupt handlers are stored in a table known as 3 an Interrupt Vector. The Interrupt Vector is normally kept at the lower end of the main

memory, beginning from address 0. Suppose an I/O device has ID 3, then the first address of its interrupt handler is in memory address 3. About getting into the interrupt processing stage, the following events will occur:

a. Reset (put 0 in) the Interrupt Enabled Bit to avoid further nested

interrupting

b. The hardware will instantly push all the values of the program counter and general purpose-registers into a system stack

c. Suppose the Address Lines of the system bus is now having k, where k is a

small integer, the kth memory word’s value (the initial address of the

interrupt handler for the present interrupt source) will be moved into the CPU program counter, and the CPU begins to perform the interrupt handler.

What will the interrupt handler do?

The interrupt handler will perform the subsequent steps:

a. If required, save additional state information for the interrupted process. For instance, perhaps the carry bit of the ALU is required by this handler therefore requires to be stored.

b. Set (put 1 in) the Interrupt Enabled Bit to allow further nested interrupting

c. Perform the required processing developed for this kind of interrupt or trap. Generally, some data will be transmitted between a CPU register and one of the registers of an I/O device controller. Since the interrupt is now permitted, it is likely that the execution of this interrupt handler be further interrupted by sources of more greater priority.

d. Restore any data saved in step a.

e. Upon stopping the interrupt handler, pop the values of the program counter and general-purpose registers of the interrupted process back into these registers.

f. Now the CPU able to continue the execution of the interrupted process.



rev

Our Service Portfolio

jb

Want To Place An Order Quickly?

Then shoot us a message on Whatsapp, WeChat or Gmail. We are available 24/7 to assist you.

whatsapp

Do not panic, you are at the right place

jb

Visit Our essay writting help page to get all the details and guidence on availing our assiatance service.

Get 20% Discount, Now
£19 £14/ Per Page
14 days delivery time

Our writting assistance service is undoubtedly one of the most affordable writting assistance services and we have highly qualified professionls to help you with your work. So what are you waiting for, click below to order now.

Get An Instant Quote

ORDER TODAY!

Our experts are ready to assist you, call us to get a free quote or order now to get succeed in your academics writing.

Get a Free Quote Order Now