We have a patch internally that implements more of mmap(), but unfortunately it's not quite ready to post.
If you just want to do a read mapping (you don't care if writes to the mmap'd region get written back to disk), and you don't mind just reading the whole mmap region in up front (which you need to do, since SE mode doesn't support page faulting), it's not too hard; just call p->allocateMem() to allocate the memory in the simulated process, and then read the data out of the file and use writeBlob() to copy it into the memory you just allocated. Steve On Tue, Oct 7, 2014 at 6:14 AM, Ahmad Hassan via gem5-users < gem5-users@gem5.org> wrote: > Hi, > > The existing implementation in GEM5 SE mode only supports MMAP to > /dev/zero. Has anyone implemented MMAP in gem5 that can map a file from the > disk? If not, how can I extend this? > > Regards, > > _______________________________________________ > gem5-users mailing list > gem5-users@gem5.org > http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users >
_______________________________________________ gem5-users mailing list gem5-users@gem5.org http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users