Page 1 of 1
IA - 32 memory simulator
Posted: Mon Feb 17, 2003 12:32 am
by gtsphere
Hello All, I was just wondering if anyone has any experience with Memory Management, IA-32 specific, and has any hints or tips to help simulate one.
So far I am able to define classes that emulate a GDT and maps memory and all of the neat stuff, but just looking for any other ideas.
Thanks for anyone who replies!
Re:IA - 32 memory simulator
Posted: Mon Feb 17, 2003 1:34 am
by Pype.Clicker
basically, you can create a set of "physical pages" (just bunch of 4K raw bytes that will be pointed to by an array or something) and then
Code: Select all
class Segment {
linear_t base;
size_t limit;
virtual linear_t map(offset_t off) throws SegmentationFault;
}
read(Segment seg, offset_t off)
{
linear_t la=seg.map(offset);
return phys_page[Paging.map(la)].dd[PageDirector.offset(la)/4]
}
Paging.map() will have to translate the linear address into physical address looking up tables, etc.
However, i wonder why you're trying to emulate this ? would you by any chance be making Yet Another Bochs ?
Re:IA - 32 memory simulator
Posted: Mon Feb 17, 2003 11:19 am
by gtsphere
The reason i'm doing this is for an assignment for one of my operating system design classes. But the instructions for the lab are very vague, but not completely hard to understand. I was just looking to see if anyone had any information that is noteworthy.