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

refactor(prototyper): Refactored the process of boot hart initialization #28

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
26 changes: 13 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ args = ["clean"]

[tasks.prototyper-nemu-build]
command = "cargo"
args = ["build", "-prustsbi-prototyper", "--release", "--features=nemu,payload"]
args = ["build", "-prustsbi-prototyper", "--release", "--target", "riscv64imac-unknown-none-elf", "-Zbuild-std=core", "--features=nemu,payload"]
env = {"RUSTFLAGS"="-C relocation-model=pie -C link-arg=-pie" }

[tasks.prototyper-nemu]
command = "rust-objcopy"
Expand Down
53 changes: 6 additions & 47 deletions prototyper/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ fn main() {
println!("cargo:rustc-link-search={}", out.display());
}

#[cfg(feature = "payload")]
const LINKER_SCRIPT: &[u8] = b"OUTPUT_ARCH(riscv)
ENTRY(_start)
SECTIONS {
. = 0x80000000;
sbi_start = .;
.text : ALIGN(8) {
*(.text.entry)
*(.text .text.*)
Expand All @@ -34,6 +34,7 @@ SECTIONS {
*(.rela*)
__rel_dyn_end = .;
}

erodata = .;
.data : ALIGN(8) {
sdata = .;
Expand All @@ -53,56 +54,14 @@ SECTIONS {
/DISCARD/ : {
*(.eh_frame)
}

. = ALIGN(8);
sbi_end = .;

.text 0x80100000 : ALIGN(8) {
*(.fw_fdt)
}
.text 0x80200000 : ALIGN(8) {
*(.payload)
}
}";

#[cfg(not(feature = "payload"))]
const LINKER_SCRIPT: &[u8] = b"OUTPUT_ARCH(riscv)
ENTRY(_start)
SECTIONS {
. = 0x80000000;
.text : ALIGN(8) {
*(.text.entry)
*(.text .text.*)
}
.rodata : ALIGN(8) {
srodata = .;
*(.rodata .rodata.*)
*(.srodata .srodata.*)
. = ALIGN(8);
}
.dynsym : ALIGN(8) {
*(.dynsym)
}
.rela.dyn : ALIGN(8) {
__rel_dyn_start = .;
*(.rela*)
__rel_dyn_end = .;
}

erodata = .;

.data : ALIGN(8) {
sdata = .;
*(.data .data.*)
*(.sdata .sdata.*)
. = ALIGN(8);
edata = .;
}
sidata = LOADADDR(.data);
.bss (NOLOAD) : ALIGN(8) {
*(.bss.uninit)
sbss = .;
*(.bss .bss.*)
*(.sbss .sbss.*)
ebss = .;
}
/DISCARD/ : {
*(.eh_frame)
}
}";
Loading