Makogan
Posts: 71
Joined: Tue May 16, 2017 9:17 pm

How to findo information about the current address space?

Wed Jun 14, 2017 1:37 am

So! I am about to implement malloc (scary!) for the pi 3. But in order to do this I need to know mainly 2 things, the first what is the TRUE maximum ram address that is addressable by the cpu. I have heard that pi's have a limit of 1 gb, so I assume the last ram address is located at: 1073741824-1 = 1073741823, am I correct in this?

The other thing is, although i can easily check for the size of my kernel (i.e the only program running at the time) by disassembling and seeing where the las address lies, this seems tedious. Is there a way to tell exactly where my program lives in memory at run time (or at the bare minimum at linking time?). My only hypothesis is to iterate through all of ram starting at 0x8000 looking for the first 0, but I cannot fit all the possible problems with this into 1 post.

Thank you and sorry for the bother once again.

User avatar
Arjan
Posts: 215
Joined: Sat Sep 08, 2012 1:59 pm

Re: How to findo information about the current address space?

Sun Jul 30, 2017 7:43 pm

Hi Makogan,

You can get the details from the linker.
See my malloc -> https://github.com/vanvught/rpidmx512/b ... c/malloc.c

Also you can use the mailbox to get the memory size -> https://github.com/vanvught/rpidmx512/b ... _vc.c#L461
http://www.raspberrypi-dmx.org/
Open Source DMX/RDM/MIDI/OSC/Art-Net/sACN solutions

Return to “Bare metal”

Who is online

Users browsing this forum: No registered users and 4 guests