Emulators

Programming, for all ages and all languages.
Post Reply
User avatar
octa
Member
Member
Posts: 50
Joined: Sat Jun 28, 2008 9:15 am

Emulators

Post by octa »

how is memory managed in emulators..
like in bochs we are able to store values and load values frm virtual processor memory while emulating .
where does bochs store these values ??
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Emulators

Post by Combuster »

in a malloc()ed piece of memory

where else did you expect?
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
DeletedAccount
Member
Member
Posts: 566
Joined: Tue Jun 20, 2006 9:17 am

Re: Emulators

Post by DeletedAccount »

That really depends upon the implementation :wink:

Regards
Shrek
User avatar
octa
Member
Member
Posts: 50
Joined: Sat Jun 28, 2008 9:15 am

Re: Emulators

Post by octa »

the address space that is emulated is very big and malloc will run out of space. what can be done in that case.
JohnnyTheDon
Member
Member
Posts: 524
Joined: Sun Nov 09, 2008 2:55 am
Location: Pennsylvania, USA

Re: Emulators

Post by JohnnyTheDon »

Bochs probably has its own memory manager with some method of allocating that has less overhead than malloc. It would definitely not run out of memory. On a 32-bit system bochs would get about 3 GB of address space, and on a 64-bit (Linux) system it gets 128TB. The smaller address space in 32-bit systems is probably why bochs limits emulated memory at 2 GB.

I'm also willing to bet bochs doesn't hold memory that you haven't used yet to keep things small when possible.

EDIT: spelling
Last edited by JohnnyTheDon on Sun Jan 11, 2009 1:20 am, edited 1 time in total.
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: Emulators

Post by bewing »

All of the operating systems that Bochs runs under have virtual memory systems. It does not matter how much physical memory is on the machine that is running Bochs. Any program running on any of these machines can allocate more virtual memory with malloc than the machine actually contains physically. That is what virtual memory is for.
Post Reply