Comments (6)
首先这个函数,如果map映射成功的话,返回值是等于v_addr的,但是如果v_addr本身就为0,那么无论成功或是失败,其返回值都为(0)RT_NULL。
因为逻辑上 va 是不允许传 0 的,否则无法触发 NULL 异常。所以返回值为 0 无论任何情况下都视为错误。
from rt-thread.
首先这个函数,如果map映射成功的话,返回值是等于v_addr的,但是如果v_addr本身就为0,那么无论成功或是失败,其返回值都为(0)RT_NULL。
因为逻辑上 va 是不允许传 0 的,否则无法触发 NULL 异常。所以返回值为 0 无论任何情况下都视为错误。
那比如我这个开发板,DDR的起始地址就是0,那是不是得给它专门做一下2M的向上对齐呢?
from rt-thread.
以本次移植的zynqmp开发板来说,vaddr=0,size=0x7ff00000,这里size=2047M,不是2M对齐,所以创建映射的函数为_kernel_map_4K。该函数会涉及到rt_pages_alloc_ext去分配物理页面。
rt_page_init
不要注册超过 1 G 范围的地址。一般就是拆成多段。等内核第二次页表切换完成后,通过 rt_page_install 装入剩余部分。
from rt-thread.
以本次移植的zynqmp开发板来说,vaddr=0,size=0x7ff00000,这里size=2047M,不是2M对齐,所以创建映射的函数为_kernel_map_4K。该函数会涉及到rt_pages_alloc_ext去分配物理页面。
rt_page_init
不要注册超过 1 G 范围的地址。一般就是拆成多段。等内核第二次页表切换完成后,通过 rt_page_install 装入剩余部分。
那看样子要修改一下setup.c里面的一些逻辑了
from rt-thread.
这个 BSP 不使能用户态(RT_USING_SMART
)的时候应该把 KERNEL_VADDR_START
定义为 0。否则无法正常完成 mapping。
from rt-thread.
这个 BSP 不使能用户态(
RT_USING_SMART
)的时候应该把KERNEL_VADDR_START
定义为 0。否则无法正常完成 mapping。
在不开启用户态的时候,这个值来源于ARCH_TEXT_OFFSET,难道我必须强制这个值为0吗?
from rt-thread.
Related Issues (20)
- stm32cubeMX生成的 rt-thread makefile工程似乎有bug
- duo:编译时是否可以默认加入 gpio HOT 4
- 启动问题 HOT 3
- duo: atoi crash HOT 2
- duo: spi: loop test support
- duo : adc: 测量校准问题 HOT 1
- ..\..\..\components\drivers\ipc\completion.c文件缺失 HOT 5
- stm32l4 libraries missing? HOT 2
- rt smart 内核挂在 sd 卡崩溃
- object.c 中 rt_object_find 的修改存在 bug HOT 11
- [object] 当对象名字长度等于RT_NAME_MAX时异常
- RT-Thread Studio生成工程编译失败
- duo: cv18xx_risc-v failed to build HOT 2
- duo: cppcheck failed
- duo:build warnings
- duo: little core does not work HOT 2
- 在rtthread studio建立v5.1.0的工程不能用
- [bsp/rk3568]:使用v5.1.0版本无法正常启动 HOT 3
- qemu-vexpress-a9 中使用c++出错 HOT 4
- rt_object_get_information函数优化问题 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rt-thread.