|
|
@ -86,10 +86,11 @@ fn remap_the_kernel() {
|
|
|
|
static mut SATP: usize = 0;
|
|
|
|
static mut SATP: usize = 0;
|
|
|
|
|
|
|
|
|
|
|
|
pub unsafe fn clear_bss() {
|
|
|
|
pub unsafe fn clear_bss() {
|
|
|
|
let bss_start = sbss as usize;
|
|
|
|
let start = sbss as usize;
|
|
|
|
let bss_end = ebss as usize;
|
|
|
|
let end = ebss as usize;
|
|
|
|
for i in bss_start..bss_end {
|
|
|
|
let step = core::mem::size_of::<usize>();
|
|
|
|
(i as *mut u8).write(0);
|
|
|
|
for i in (start..end).step_by(step) {
|
|
|
|
|
|
|
|
(i as *mut usize).write(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|