You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fn main() {
let src: [u8; 10] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let mut dest: [u8; 10] = [0; 10];
let src_addr: u64 = &src as *const _ as u64;
let dest_addr: u64 = &mut dest as *mut _ as u64;
let copy_len: usize = 5;
unsafe {
memory_copy(src_addr, dest_addr, copy_len/8);
}
println!("源数据:{:?}", src);
println!("拷贝后的目标数据:{:?}", dest);
}
unsafe fn memory_copy(src: u64, dest: u64, len: usize) {
let src_ptr = src as *const u64;
let dest_ptr = dest as *mut u64;
for i in 0..len {
let src_value = *src_ptr.offset(i as isize);
*dest_ptr.offset(i as isize) = src_value;
}
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
树莓派开发板上电后的执行顺序 依次为:
目前 make chainboot 的作用和流程是:
可以参考下面的程序,修改 kernel8.img 程序的逻辑,改为从某个地址读 arceos-raspi4.bin,搬到 0x80000 ,再跳转过去执行
这样做,可以简化代码工作量,但需要提前通过 cat kernel8.img arceos-raspi4.bin > all.bin ,all.bin 的前半部分是 kernel8.img,负责把后半部分的 arceos-raspi4.bin 搬到 0x80000,如何实现这个搬移,可以参考下面的 memory_copy
补充说明:
All reactions