Welcome, Guest. Please login or register.

Author Topic: Coldfire AGAIN  (Read 25767 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Coldfire AGAIN
« Reply #14 from previous page: March 31, 2008, 06:53:56 PM »
Quote

...what effectively happens is that the MMU updates the 'virtual' memory addresses with the real memory addresses (like saying to the program 'here's where your data was').

...

I really can't see a problem with what I've described, perhaps you can?


How do you take, say, 16 4KiB pages scattered across the 4G physical address space that an application requested and originally thought was one contiguous 64KiB lump of memory and tell it "here is where your data was" ?

A single allocation of memory on a VM system using an MMU that an application uses a single pointer to refer to can translate into many unrelated chunks of genuine physical memory. You can't assume contiguous address mapped memory is contiguous in physical RAM.
int p; // A
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show all replies
Re: Coldfire AGAIN
« Reply #15 on: March 31, 2008, 08:56:13 PM »
Quote

HenryCase wrote:
Quote
Karlos wrote:
How do you take, say, 16 4KiB pages scattered across the 4G physical address space that an application requested and originally thought was one contiguous 64KiB lump of memory and tell it "here is where your data was" ?


By arranging it into a 64KiB lump before you give memory control back to the program.


Assuming you could do this, do you have any idea how complex the algorithm required to sort all the scattered physical blocks into contiguous lumps that reflect what the code originally allocated and ensuring pointers everywhere in the system are updated? That's not even including the overhead of copying pages of memory around.

Quote
Give me an example of when you'd use a pointer to address more than one memory location so I can explain how its done.


Any code that walks arrays, traverses containers, manipulates strings, etc.
int p; // A