Page 1 :
purts, one part for operating system and another for a job is curreatly.executing, consider the, Management ". The efficient memory management is possible with multiprogramming. A, will be idle. Thus memory needs to be allocated efficiently to pack as many process in to, or uni programming system, the main memory is divided in to two, division is carried out dynamically by the operating system, this task is known as “ Memory, few process are in main memory, the remaining process are waiting for I/O and the processor, u-3, CHAPTER -6, Gilo, Memory Management, it is, is, ina mano programming, Partition (1), Operating system, User Process, Partition (2), user process, Figure 6.1 Main memory partition, Partition 2 is allowed for user process. But some part of the partition 2 wasted, it is, mdicated by Blacked lines in the figure. In the multiprogramming environment the user space, UNIded in to number of partitions. Each partition is for one process. The task of sub, is, memory as possible., Scanned with Oken Scanner
Page 2 :
Scanned with Oken Scanner, Address In 0 to KB is the space from 210, 2200=100+2100(Contents of the register), all are by a is to as a Spac, to 2200 KB, this actual in is called The se, by a the of is But in the 2-, memory unit is called For J1 is a wrin, Physical = + of the registe, The set these logical referred, An by CPU is as an generated, 6.2 - Operating Systems, memeay mouny,, 6.1 Logical Versus Physical Address Space, to as a, "Physi, 2200 KB is the physical address space therefore, 4lam brud 'E, -シ1 01, consider the figure 6.2., Aul Shred 210h, An address genuraled, Relocation, Register, ^ main, baden, adeher, 2100, J1, CPU, 000, Main Memory, Figure 6.2, The runtime mapping from logical to physical address is done by the memory managem, unit (MMU), which is not a hardware device. The base register is also called the reloca, register. The value in the relocation register is added to every address generated by a u, process at the time it is sent to the memory .For example the base is at 2100, then an atter, by the user to address location 0 is dynamically related to location 2100. An access to locat, 100 is mapped to location 2200., /6,2 Swapping, Swapping is a method to improve the main memory utilization. For example the main mem, consisting of 10 process, assume that it is the maximum capacity, and the CPU currer, executing the process no:9 in the middle of the execution the process no: 9 need an, Then the CPU switch to another job and process no:9 is moved to a disk and another pro, is lóaded in main memory in the place of process no: 9. When the process no: 9 is compic, its 1/0 operation then the processor no: 9 moved in to main memory from the disk. Swle
Page 3 :
clsk, Swap owt, M.M ScuayMemory Management C 6.3, process, is, memory, switch iocess (rome, MiM to, S.out, Swapout Pi, Swapin Pi, Switch from dest, to. M. M in Jeie, to be swap.m, secondary memory, desk:, Suaffng, Main memory, Figure 6.3 Swapping, suggests 5 requirements., Relocation, २२०, Protection, Sharing, Logical Organization, Physical Organization, 6.3.1 Relocation, Relocation is a mechanism to convert the logical address in to physical address. An addr, is generated by CPU is said to be logical address. An address is generated by memory mana, is said to be physical address., Physical address = Contents of Relocation register + logical address., %3D, Relɔcation is necessary at the time of swap in 'a process from one backing store to, memory. All most all times the process occupies the same location at the time of sw:, But some times it is not possible, at the time of relocátion is required. Observe the figu, Scanned with Oken Scanner
Page 4 :
6.4 5 Operating Systems, Base register, Swapin, +, With, relocation, Main, memory, Figure 6.4 Relocation, 6.3.2 Protection, The word protection means provide security, from unauthorized usage of memory. The, operating system can protect the memory with, the help of base and limit registers. Base 1024, registers consisting the starting address of the, next process. The limit register specifies the, boundary of that job, So the limit register is also 10924, said to be fencing register. For better, understanding consider the figure 6.5, Faily, O.S, Base registe, 10924, JOB1, 9900, Limit register, JOB2, 21824, The base register holds the smallest legal, physical memory address, the limit register, contains the size of the process., figure 6.6 it depicts the hardware protection, mechanism with base and limit registers. If the, logical address, otherwise it is trap to operating system. The physical address (Logical + Base) is less the, the base limit it causes no problems, otherwise it is trap to the operating system., Consider the, Fig 6.5 Main memory protection, greater than the contents of base register it is the authorized accas, Contents of, Base + Limit, base register, Yes, Yes, Logical, CPU, Address, No, No, Figure 6.6 Memory protection with base and limit, Scanned with Oken Scanner
Page 5 :
Scanned with Oken Scanner, at its physical is organized., system is as a or one-, We in à computer, dimensional, of a, the figure 6.7, it the sharing of processor., modules, some of which are (Read, system and can effectively, only, ) and of which contain, data that may be If the operating, modules of sort, then a number of, the in the in the of copy of processor. Consider, program, it is to each to access copy of the program rather, For 3 users want to take then share, process is said to be to say if of are executing same, memory by severkl the same portion of main by number of, Generally s are at the of access the of main, main waste, than its its If each a of program, a lot of, actual machine it does not correspond, Although this closely mirrors the, to the way in typically, constructed. Most are in to, 6.3.4 organization, sequence of or memory,, Memory Management C 6.5, 6.3.3, O.S, Word, precessing, Resume 1, Word precessing, J1, Word, Resume 1, precessing, Resume 2, Resume 2, J2, Resume 3, Word, precessing, deal with user programs and data in the form of, Resume 3, can be realized., 6.3.5 Physical organization, A computer memory is organized in to at least, two levels: main memory and secondary, memory. Main memory provides fast access at, abrively bigh cost. In addition, main memory is volatile: that is, it does not provide permanent, storage. Secondary memory is slower and cheaper than main memory, and it is usually not, volatile. Thus secondary memory of large capacity can be provided to allow for long-term, storage of programs and data, while a smaller main memory holds programs and data currently, J3, advantages, Figure 6.7 Memory sharing, The word 'loading' means load the program (or) Module from secondary storage devices, (disk) to main memory. Loadings are two types. One is the compile time loading and second, in use., 6.4 Dynamic Loading and Dynamic Linking V