From e2b3e5e7b9026629f3138b404ecaefebcebe648f Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Thu, 10 Sep 2015 12:20:51 +0200 Subject: [PATCH] Script to print the memory map --- boot/device/memory_map.awk | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 boot/device/memory_map.awk diff --git a/boot/device/memory_map.awk b/boot/device/memory_map.awk new file mode 100644 index 000000000..95851e1d8 --- /dev/null +++ b/boot/device/memory_map.awk @@ -0,0 +1,22 @@ +/data_section_start_ram/ { data_start = $1 } +/data_section_end_ram/ { data_end = $1 } +/bss_section_start_ram/ { bss_start = $1 } +/bss_section_end_ram/ { bss_end = $1 } +/liba_heap_start/ { heap_start = $1 } +/liba_heap_end/ { heap_end = $1 } +/framebuffer_start/ { framebuffer_start = $1 } +/framebuffer_end/ { framebuffer_end = $1 } +/stack_start/ { stack_start = $1 } +/stack_end/ { stack_end = $1 } + +function log_section(name, start, end) { + printf("%s: 0x%x - 0x%x (0x%x = %d = %dK)\n", name, start, end, end-start, end-start, (end-start)/1024) +} + +END { + log_section("DATA ", data_start, data_end); + log_section("BSS ", bss_start, bss_end); + log_section("HEAP ", heap_start, heap_end); + log_section("FB ", framebuffer_start, framebuffer_end); + log_section("STACK", stack_end, stack_start); +}