Skip to contentSkip to conversation

subobj-rmap

DISCUSSION Chuck Ebbert 1 participant 1 message Apr 7, 2003

lore
Share & tools
lore
#0 lore raw

Davide Libenzi wrote:

1) |----------------------|
2) |-----------|
3) |--------------------------|
4) |-----------|

R) |---|---|-------|---|--|---|

    1   1   1       1   1  3
    3   2   2       3   3
        3   3       4
            4

How's this for an alogorithm for finding which
chunk of 'R' you have hit with a given memory reference:

o Use a bitmap to represent the whole address range.
o Set the bits that correspond the the first page of each subregion.

To search:

 o  Look up the bit for the page you are interested in.
 o  Scan backwards for a 1.
 o  Convert bit position to address, this is the

base of the subregion.

Since this is i386-only you can play neat assembler
tricks with this code to make it fast.

(OS/2 did/does it that way.)

--
Chuck
I am not a number!