Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

实验一中构建裸机运行时执行环境一节gdb的选择问题 #149

Open
Carolmelon opened this issue Jul 23, 2021 · 3 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@Carolmelon
Copy link

问题描述

本小节实验指导书上选择的gdb-client为rust-gdb,但rust-gdb原生不支持riscv指令集。实际上应该选用riscv64-unknown-elf-gdb。

在rCore-Tutorial实验指导书上的位置

链接: 第一章/构建裸机运行时执行环境/设置正确的程序内存布局
UQ@MJQ)Y YWZA` 7AF)OF_N

更进一步分析

)F@YDGLU0CF`$6 LQ2)}F)G
PT1WL1807F$X37736RF1 )0

@Carolmelon Carolmelon added the bug Something isn't working label Jul 23, 2021
@Carolmelon
Copy link
Author

本节还有一个问题,就是在正确配置栈空间布局这一节之前,_start符号并不能被装入0x8020 0000所在的地址,需要在_start函数定义之前加上#[link_section = ".text.entry"]才行。
// src/main.rs
/* 省略其他代码 */
#[no_mangle]
#[link_section = ".text.entry"]
extern "C" fn _start() {
shutdown();
}

@uran0sH
Copy link

uran0sH commented Jul 24, 2021

本节还有一个问题,就是在正确配置栈空间布局这一节之前,_start符号并不能被装入0x8020 0000所在的地址,需要在_start函数定义之前加上#[link_section = ".text.entry"]才行。
// src/main.rs
/* 省略其他代码 */
#[no_mangle]
#[link_section = ".text.entry"]
extern "C" fn _start() {
shutdown();
}

应该是在entry.asm开头加.text.entry

@Carolmelon
Copy link
Author

Carolmelon commented Jul 25, 2021

本节还有一个问题,就是在正确配置栈空间布局这一节之前,_start符号并不能被装入0x8020 0000所在的地址,需要在_start函数定义之前加上#[link_section = ".text.entry"]才行。
// src/main.rs
/* 省略其他代码 */
#[no_mangle]
#[link_section = ".text.entry"]
extern "C" fn _start() {
shutdown();
}

应该是在entry.asm开头加.text.entry

正确配置栈空间布局这一小节之前,还没有entry.asm这个汇编文件

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants