I have been designing a structural table to hold mapped addresses to map I/O ports and differnt regions of linear address space. In common sense I've named it "Mapped Address Table" or in short MAT. I'd like to get your cons and pros about it because I do not want waste time and change this later finding that it may be to slow, or to much overhead after it is already implemented.
In breif, it is a table of two arrays of 32bit varibles, the first array contains base addresses, the second contains the size. Each entry identifies a mapped region and referred by the index number, taking the two array base[ i ] and size[ i ]. Finally to indicate where "base" and "size" array begins, there is a record that stores base address and byte length of the MAT. Basically base address finds your way to "base" array, the base address + byte length/2 finds the start of "size" array. The count of entries within the MAT is simply calculated as byte length/8.
[tt] MAT
/\ +-----------------------------+ Base + ByteLength
|| | |
|| | Size Array |
|| | EntryCount = ByteLength/8 |
|| | |
|| | |
|| | |
|| +-----------------------------+ Base + (ByteLength / 2)
|| | |
|| | Base Array |
|| | EntryCount = ByteLength/8 |
|| | |
|| | |
|| | |
|| +-----------------------------+ Base[/tt]
What worries me is, when all entries are used up, the table must grow and so when it does, it must be moved into a larger contigous block of physical memory. The reason why they are not structured is because I would like to make use of the rep prefix opcodes which I think would make life a lot easier and faster, especially when searching but ofcourse its theorically.
When I mean structure format I mean like this:
struct MAT_ENTRY {
DWORD Base;
DWORD Size;
};
Also, documented my theorical approach of memory managment, which is just the ground basis of it, if you would like to read on it and comment/criticise post them here too. The document is in RTF file and be temperary downloaded here: http://69.194.132.218/ASRS.rtf
<edit by="Pype"> used 'tt' instead of 'font=Lucida Console' for those who don't have 'Lucida Console' at hand
