IA - 32 memory simulator

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
gtsphere

IA - 32 memory simulator

Post 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!
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:IA - 32 memory simulator

Post 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 ?
gtsphere

Re:IA - 32 memory simulator

Post 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.
Post Reply