mirror of
https://github.com/rcore-os/rCore-Tutorial-v3.git
synced 2024-11-22 17:36:25 +04:00
Update format of link_user.S
This commit is contained in:
parent
ee1a063d42
commit
df70bd8dcb
17
os/build.rs
17
os/build.rs
@ -2,7 +2,8 @@ use std::io::{Result, Write};
|
||||
use std::fs::{File, read_dir};
|
||||
|
||||
fn main() {
|
||||
println!("cargo:rerun-if-changed=../user/src/bin/");
|
||||
println!("cargo:rerun-if-changed=../user/src/");
|
||||
println!("cargo:rerun-if-changed={}", TARGET_PATH);
|
||||
insert_app_data().unwrap();
|
||||
}
|
||||
|
||||
@ -26,17 +27,12 @@ fn insert_app_data() -> Result<()> {
|
||||
.section .data
|
||||
.global _num_app
|
||||
_num_app:
|
||||
.quad {}
|
||||
"#, apps.len())?;
|
||||
.quad {}"#, apps.len())?;
|
||||
|
||||
for i in 0..apps.len() {
|
||||
writeln!(f, r#"
|
||||
.quad app_{}_start
|
||||
"#, i)?;
|
||||
writeln!(f, r#" .quad app_{}_start"#, i)?;
|
||||
}
|
||||
writeln!(f, r#"
|
||||
.quad app_{}_end
|
||||
"#, apps.len() - 1)?;
|
||||
writeln!(f, r#" .quad app_{}_end"#, apps.len() - 1)?;
|
||||
|
||||
for (idx, app) in apps.iter().enumerate() {
|
||||
println!("app_{}: {}", idx, app);
|
||||
@ -46,8 +42,7 @@ _num_app:
|
||||
.global app_{0}_end
|
||||
app_{0}_start:
|
||||
.incbin "{2}{1}.bin"
|
||||
app_{0}_end:
|
||||
"#, idx, app, TARGET_PATH)?;
|
||||
app_{0}_end:"#, idx, app, TARGET_PATH)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
Loading…
Reference in New Issue
Block a user