System memory map
Julie Stamp (8365) 479 posts |
I’ve been trying to get a picture of how the logical address space is laid out. I wrote a program
which when run on IOMD RISC OS 5.27 gives
So:
|
Rick Murray (539) 13958 posts |
If OS_ReadSysInfo 8 has the “OS runs from RAM” bit set, then you ought to be able to use OS_Memory 8 with flag 5 (so
I don’t think so, asides from high vectors. Unfortunately there doesn’t appear to be a memory map document.
First of all, expect to see huge gaps. The addressing range (&00000000 → &FFFFFFFF) covers 4GiB. The vast majority of machines do not have that. I think the “average” 32 bit amount is probably a gigabyte. One thing I did notice, you don’t have any I/O space listed. Where’s the combi-I/O chip for IDE, floppy, serial, and parallel? You are using an IOMD machine, so where’s podule space? EASI space? The x86 co-processor? What about the IOMD devices (keyboard, mouse, IIC…)? |
Rick Murray (539) 13958 posts |
The RiscPC TRM is at 4corn. This should give you an idea where things may be located. I can only find references to the old addresses such as IOMD at &03200000. |
Jeffrey Lee (213) 6048 posts |
There’s a logical memory map in Kernel.hdr.KernelWS: https://gitlab.riscosopen.org/RiscOS/Sources/Kernel/-/blob/Kernel-6_42/hdr/KernelWS#L244 So yes, currently the only thing above ROM is the high processor vectors (if enabled). DAs are allocated address space starting from the bottom of the memory map, while IO memory is allocated from top down; so the gap between the end of the DAs and the start of the IO region is free space which one or the other could potentially claim. You can use OS_Memory 8 to find how much IO address space has been allocated, but I don’t think there’s a call to tell you where the region currently starts. |
Martin Avison (27) 1512 posts |
I came across this thread again recently, and tried the MemoryMap program, as it looked useful. On This Titanium, running RO5.29, it shows nearly twice as many areas as the IOMD RO5.27 above. Shows how the OS has changed! Then I looked at the program … and PROCprint_sorted struck me as rather complicated, and realised that it was because (a) the arrays were unsorted, and (b) the addresses are 32bit (ie can look negative to BASIC). Thinking if my ArmSort was used, it could be reduced to just… … but no: ArmSort sorted the arrays fine, but treated the addresses as signed.
This stirred a plan from long ago to add an Unsigned sort facility to ArmSort … and lo, it is now added to v4.09, so if the above code is changed to… … it will now work happily.
So, thanks to Julie for a useful program, AND for provoking me to improve ArmSort. One very minor bug: Any HAL devices show the Last address one byte before the First. This is because they get a base adddress but zero allocated length. I ‘fixed’ this by setting alloc%=1 so Last=First. |