Page 1 of 1
ram
Posted: Wed Jun 22, 2005 2:40 pm
by nooby
if i have only 32mb ram can i access addresses ober 32mb ?
Re:ram
Posted: Wed Jun 22, 2005 2:44 pm
by Kemp
If you're asking about physical (real) addresses then no, you can't access more memory than you have. If you're talking about what is often referred to as linear memory which is the result of some combination of remapping and/or page swapping then yes, the programs that are using that memory can be told whatever you want as long as you make sure it maps to somewhere within valid physical memory (or you swap the page back into a valid place).
Re:ram
Posted: Thu Jun 23, 2005 2:26 am
by Pype.Clicker
Kemp wrote:
If you're asking about physical (real) addresses then no, you can't access more memory than you have.
actually, nothing on the processor will never prevent you from accessing a physical address beyond 32MB in that case ... but that will simply act as a black hole: whatever you write, all you'll read back will be 'floating wire' state (e.g. 0xffff is probable, but not even guaranteed)
Now, some devices might have memory mapped above that (e.g. my VBE card here has its LFB somewhere at 0xfa000000 or something), in which case whatever you read/write there will be interpreted by that device and might not react as 'regular' memory.
Re:ram
Posted: Thu Jun 23, 2005 3:15 am
by Kemp
Ok, true, but I was more referring to the fact that doing anything about real memory is either going to achieve abslutely nothing or potentially mess up a mapped device. Of course if you want to write to the device it's perfectly fine.
Re:ram
Posted: Thu Jun 23, 2005 3:25 am
by Solar
And depending on your architecture and type of RAM, those 32 MB you have are not necessarily accessable at addresses 0x0000 0000 through 0x0200 0000 either. If you have e.g. two banks with 16 MB each, they might be (physically) mapped at two completely seperate address ranges, with memory-mapped devices strewn in between.
That is why people came up with MMU's and virtual addresses. Physical memory layout is usually a real mess.

Re:ram
Posted: Thu Jun 23, 2005 3:49 am
by Kemp
So I really should have said writing above, below or between real memory will do whatever. Hmmm.... suddenly giving programs linear memory seems more like showing them mercy than providing a nice little convenience.
Re:ram
Posted: Thu Jun 23, 2005 5:33 am
by smiddy
Solar wrote:Physical memory layout is usually a real mess.

It certain could be depending on your perspective.

Fortunately there are hardware layers that allow us to avoid the mess and
see it as one contiguous mass of RAM.
Re:ram
Posted: Thu Jun 23, 2005 6:17 am
by Solar
And as always in threads like this, let me point out that AmigaOS (up to 3.x at least) does the virtual-to-physical mapping while loading the executable.
Just to show that there is always a
different solution to a problem.

Re:ram
Posted: Thu Jun 23, 2005 6:38 am
by Pype.Clicker
Solar wrote:
And as always in threads like this, let me point out that AmigaOS (up to 3.x at least) does the virtual-to-physical mapping while loading the executable.
Just to show that there is always a
different solution to a problem.
not so sure i got your point, Solar ... What's so great-and-completely-different about it ?
Re:ram
Posted: Thu Jun 23, 2005 7:00 am
by Solar
You don't have an MMU employed. Memory references are adjusted in the binary. Actually, binaries are subdivided into "hunks", which are liberally scattered across the available memory however they might fit, so you don't require one large continuous piece of memory for the binary to fit in.
Mind, this is of course horribly inferior to a MMU at work. You get memory fragmentation, you can't do memory protection, and virtual memory (i.e., swapping memory to hard drive) becomes a real headache.
It's just that - a novelty, but one that shows that you can have a system that does not offer you a virtual continuous address space, yet still leaves the developer blissfully ignorant of the details.
Re:ram
Posted: Thu Jun 23, 2005 8:05 am
by Kemp
But what if it splits up an area you use indexed addressing on or somesuch? The base address would be adjusted correctly to be within your memory space but when you start incrementing it you'll wander into someone else's space.
Re:ram
Posted: Thu Jun 23, 2005 8:24 am
by Solar
You use indexed addressing within an array. Arrays aren't split up between hunks.
(The hunks are defined by the compiler. The Amiga "HUNK" format is a binary format, just as ELF or PE. It doesn't mean binaries are randomly picked apart.)
If you're using indexed addressing in memory areas that haven't been defined as continuous data objects... good luck.
