Exercise Memory Management

  • Upload
    ismimi

  • View
    217

  • Download
    0

Embed Size (px)

Citation preview

  • 7/28/2019 Exercise Memory Management

    1/2

    Exercise Memory Management:

    Consider a system where the memory adopts the paged segmentation method. The page size

    is 400 B and the segment size is maximum 1200 B. A process, of size 5600 B, needs to execute

    on the system. This process contains 2000 B as the main program, 1100 B as libraries, 1500 B

    as functions and 1000 B as data.

    1. Say how this process will be partitioned in order to be loaded in the memory (i.e. divisioninto segments and pages).

    2. Was there any internal fragmentation? How many bytes?3. Construct the segments and pages tables of this process, in the case knowing that the list

    of free frames is the following: {22, 40, 6, 51, 52, 7, 9, 11, 402, 223, 17, 30, 100, 31, 36, 55,

    77, 78, 79, }

    P.S.: the process is loaded in the order: main prog, libraries, functions then data.

    4. If the memory word size is 1 byte, how many bits do we need to code the offset?5. Suppose that the logical address is coded on 16 bits, the segment number takes 3 bits.

    How many bits remain for the page number?

    6. Give the physical addresses corresponding to the following binary logical addresses :a. 00000101 10001111b. 01100010 00001110c. 01000000 11110000d. 10100011 10001100

    7. Find the logical address of the word 3500 in the process then find its physical address.What type is this word (code in main prog, data )?

  • 7/28/2019 Exercise Memory Management

    2/2

    Exercice Gestion de la mmoire :

    On considre un systme dont la mmoire qui adopte le principe de la segmentation pagine

    o une page vaut 400 O et un segment est de taille maximale 1200 O. Un processus, de taille

    5600 O, vient sexcuter sur ce systme. Ce processus comporte 2000 O de code du

    programme principal, 1100 O de bibliothques, 1500 O de fonctions et 1000 O de donnes.

    1. Dire comment le processus va tre dcoup pour tre charg en mmoire (i.e.dcoupage en segments et pages).

    2. Est-ce quil y a eu de la fragmentation interne ? de combien doctets ?3. Construire les tableaux de segments et de pages de ce processus, si la liste des cadres

    (frames) libres est la suivantes : {22, 40, 6, 51, 52, 7, 9, 11, 402, 223, 17, 30, 100, 31, 36,

    55, 77, 78, 79, }

    P.S.: Le processus est charg en mmoire dans lordre: programme principal, librairies,fonctions puis donns.

    4. Si le mot mmoire est de 1 byte, de combien de bits on a besoin pour coder loffset?5. On suppose que ladresse logique soit code sur 16 bits, le numro du segment prend 3

    bits. Combien reste-il pour le numro de page ?

    6. Donner les adresses physiques correspondantes aux adresses logiques binairessuivantes :

    a. 00000101 10001111b. 01100010 00001110c. 01000000 11110000d. 10100011 10001100

    7. Trouver ladresse logique du mot 3500 du processus, chercher ensuite son adressephysique. De quel type est ce mot mmoire (code du programme principal, donne,

    )?