On 25/02/12 20:29, Brad Normand wrote: [...] > Basically, yes. It'd be a 4GB virtual address space, but could be > backed by a real 4GB RAM if there was appropriate hardware. Otherwise > it could be backed by swap. If you're going to simulate virtual memory you'll need to tell the OS when you've *finished* using a segment, so that it can save it to disk again. Both GEOS and PalmOS did this. You'd allocate a block of memory from the system and get a handle; to actually use the handle you'd have to lock it, and then unlock it again when you were finished. If you changed the contents you would have to dirty it. int handle = Allocate(100); char* ptr = Lock(handle); *ptr = 0; Dirty(handle); Unlock(handle); It worked very well. GEOS used it for both persistent storage and virtual memory simulation. You could open a multimegabyte document and the data would be invisibly loaded on demand; from the API point of view you got a persistent heap in a file. Lovely system, died due to being impossible to write code for and lousy marketing. http://www.breadbox.com/ (Free evaluation version, requires DOS.) Of course, they both used object handles rather than simulating a flat address space. -- ┌─── dg@cowlark.com ───── http://www.cowlark.com ───── │ │ "Never attribute to malice what can be adequately explained by │ stupidity." --- Nick Diamos (Hanlon's Razor)
Attachment:
signature.asc
Description: OpenPGP digital signature