Default memory map(ARM)

摘自: http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0471c/Beihhaag.html

文档: ARM Compiler toolchain  Developing Software for ARM Processors.pdf

就不翻译了, 水平有限, 费时间, 免得误人子弟. 见谅则个!  ^_^

====================================================================================

In an image where you have not described the memory map, the linker places code and data according to a default memory map, as shown in the following figure:

Figure 2. Default memory map

Note

The processors based on ARMv6-M and ARMv7-M architectures have fixed memory maps. This makes porting software easier between different systems based on these processors.

The default memory map is described as follows:

  • The image is linked to load and run at address 0x8000. All Read Only (RO) sections are placed first, followed by Read-Write(RW) sections, then Zero Initialized (ZI) sections.

  • The heap follows directly on from the top of ZI, so the exact location is decided at link time.

  • The stack base location is provided by a semihosting operation during application startup. The value returned by this semihosting operation depends on the debug environment.

The linker observes a set of rules to decide where in memory code and data is located:

Figure 3. Linker placement rules


Generally, the linker sorts the input sections by attribute, by name, and then by position in the input list.

To fully control the placement of code and data you must use the scatter-loading mechanism.



存储映射(Memory Map)是一种将文件或设备的内容映射到进程的地址空间中的技术。通过存储映射,进程可以直接访问文件或设备的内容,而无需进行繁琐的读写操作。存储映射可以提高访问速度,并且可以实现多个进程之间的共享访问。 存储映射有两种主要的用途:文件内存映射和共享内存。 文件内存映射是将一个文件映射到进程的地址空间中,使得进程可以像访问内存一样访问文件的内容。通过使用mmap系统调用,可以将一个文件映射到内存中,并通过指针来访问文件的内容。这种方式可以提高文件的读写速度,并且可以方便地进行随机访问。 共享内存是一种最快的进程间通信方式,它允许多个进程共享同一块内存区域。在共享内存中,多个进程可以同时访问同一块内存,实现数据的共享。共享内存可以使用不同的接口,如Posix接口和System V接口。通过使用shm_open()和mmap()函数,可以创建和访问共享内存区域。 总结来说,存储映射是一种将文件或设备的内容映射到进程的地址空间中的技术。文件内存映射可以提高文件的读写速度,而共享内存可以实现多个进程之间的数据共享。 #### 引用[.reference_title] - *1* *2* [linux下共享内存sharedMemory(shm)和内存映射memorymap的关系](https://blog.youkuaiyun.com/jinking01/article/details/120274820)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [Memory Map(Linux 存储映射IO)](https://blog.youkuaiyun.com/a931040/article/details/51955693)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值