I am in uboot and was wondering, how could I tell what RAM address range is being used by uboot.

uboot needs memory to run so it might be using some of the RAM. I want to avoid modifying those RAM addresses.

How do I know which region of memory is uboot loaded?


The DULG DebuggingUBoot page has this to say (the "relocation" it speaks of is copying itself from flash to RAM).

For debugging U-Boot after relocation we need to know the address to which U-Boot relocates itself to. When no exotic features like PRAM are used, this address usually is - CONFIG_SYS_MONITOR_LEN. In our example with 16MB RAM and CONFIG_SYS_MONITOR_LEN = 192KB this yields the address 0x1000000 - 0x30000 = 0xFD0000.

Further reading of the text seems to indicate it's dependent on the processor or board and that you may have to check the U-Boot source to know for sure.

Regarding the Guruplug:

On the RAM side, u-Boot has the first 8 megabytes reserved. The rest is free. Some developer’s will load kernels and filesystems at 0×800000 for programming to flash. Another common spot is at the 100 megabyte boundary (or offset 0×640000).

Depending on your version of U-Boot commands may be available to put a string somewhere in free RAM and then hunt the rest of RAM for that string, revealing the approximate location of U-Boot in memory.

| improve this answer | |

When I start the version of uboot that I am using, it automatically displays a "virtual kernel memory layout".

Memory: 859068k/859068k available, 25668k reserved, 0K highmem
Virtual kernel memory layout:
    vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    DMA     : 0xf9e00000 - 0xffe00000   (  96 MB)
    vmalloc : 0xe0800000 - 0xf4000000   ( 312 MB)
    lowmem  : 0x80000000 - 0xe0000000   (1536 MB)
    pkmap   : 0x7fe00000 - 0x80000000   (   2 MB)
    modules : 0x7f000000 - 0x7fe00000   (  14 MB)
      .init : 0x80008000 - 0x8004d000   ( 276 kB)
      .text : 0x8004d000 - 0x808ad000   (8576 kB)
      .data : 0x808ce000 - 0x80937a40   ( 423 kB)

I found it was safe to use the lowmem area for various utility processes I wanted to run (like loading large files into memory). Ideally, I think you want to use high memory for that kind of thing, but I didn't have the option (as you can see in my output).

| improve this answer | |
  • Are you sure that's not Linux's memory map? – claymation Apr 5 '17 at 20:37
  • I'm not certain. That lack of highmem and the reference to "Virtual kernel" leads me to think otherwise. I'm a noob/hack when it comes to uboot. The important point here was that I was able to safely use that lowmem range without writing over anything that the uboot seemed to require. – BuvinJ Apr 5 '17 at 20:48
  • As I recall, this is displayed prior to the loading the OS btw. – BuvinJ Apr 5 '17 at 20:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.