Bochs memory messages

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
teodori
Member
Member
Posts: 103
Joined: Wed Nov 14, 2012 4:55 pm

Bochs memory messages

Post by teodori »

Hello, I see some messages in bochs and I don't understand them. I assume it's about memory usage.
What does this mean?

Code: Select all

00005248076i[MEM0 ] allocate_block: block=0x18 used 0x3 of 0x800
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: Bochs memory messages

Post by Combuster »

Code: Select all

$ find -iname "*.cc" | xargs grep -n "allocate_block:"
./memory/misc_mem.cc:218:          BX_INFO(("allocate_block: block=0x%x, replaced 0x%x",   
./memory/misc_mem.cc:223:        BX_INFO(("allocate_block: block=0x%x used 0x%x of 0x%x",
./memory/misc_mem.cc:235:  BX_DEBUG(("allocate_block: used_blocks=0x%x of 0x%x", BX_MEM_THIS used_blocks, max_blocks));

Code: Select all

#if BX_LARGE_RAMFILE
  /* 
   * Match block to vector address
   * First, see if there is any spare host memory blocks we can still freely allocate
   */
Bochs uses lazy allocation of memory, so everytime you access a new block of RAM, it'll allocate one. In this case, support for Guest RAM > Host RAM is enabled which can swap out pages to disk when they're not used, which in turn means additional log information because it's fairly new.
"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 ]
teodori
Member
Member
Posts: 103
Joined: Wed Nov 14, 2012 4:55 pm

Re: Bochs memory messages

Post by teodori »

Ok so thoses messages are related to the emulator and not to the OS. I thought they showed up because I did an error in my memory manager.
Thank you
teodori
Member
Member
Posts: 103
Joined: Wed Nov 14, 2012 4:55 pm

Re: Bochs memory messages

Post by teodori »

Are those messages usefull for debug? What does block mean? And what do the numbers tell me there?

Code: Select all

[MEM0 ] allocate_block: block=0x10 used 0x3 of 0x200
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: Bochs memory messages

Post by Combuster »

I can guess, but to give an accurate answer I will have to look at the source again, which is something you could do in my place.
"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 ]
Post Reply