|
|
@ -21,7 +21,7 @@ mod stdio;
|
|
|
|
#[cfg(feature = "link_user")]
|
|
|
|
#[cfg(feature = "link_user")]
|
|
|
|
global_asm!(concat!(
|
|
|
|
global_asm!(concat!(
|
|
|
|
r#"
|
|
|
|
r#"
|
|
|
|
.section .data
|
|
|
|
.section .data.img
|
|
|
|
.global _user_img_start
|
|
|
|
.global _user_img_start
|
|
|
|
.global _user_img_end
|
|
|
|
.global _user_img_end
|
|
|
|
_user_img_start:
|
|
|
|
_user_img_start:
|
|
|
@ -57,7 +57,22 @@ lazy_static! {
|
|
|
|
println!("Sfs start {:x}, end {:x}", _user_img_start as usize, _user_img_end as usize);
|
|
|
|
println!("Sfs start {:x}, end {:x}", _user_img_start as usize, _user_img_end as usize);
|
|
|
|
Arc::new(unsafe { device::MemBuf::new(_user_img_start, _user_img_end) })
|
|
|
|
Arc::new(unsafe { device::MemBuf::new(_user_img_start, _user_img_end) })
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let device2 = {
|
|
|
|
|
|
|
|
extern {
|
|
|
|
|
|
|
|
fn _user_img_start();
|
|
|
|
|
|
|
|
fn _user_img_end();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Arc::new(unsafe { device::MemBuf::new(_user_img_start, _user_img_end) })
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let super_block = SimpleFileSystem::read(device2);
|
|
|
|
|
|
|
|
println!("Superblock: magic = {:x}, freemap_blocks = {:x}", super_block.magic, super_block.freemap_blocks);
|
|
|
|
|
|
|
|
println!("blocks = {:}", super_block.blocks);
|
|
|
|
|
|
|
|
println!("unused_blocks = {:}", super_block.unused_blocks);
|
|
|
|
|
|
|
|
|
|
|
|
let sfs = SimpleFileSystem::open(device).expect("failed to open SFS");
|
|
|
|
let sfs = SimpleFileSystem::open(device).expect("failed to open SFS");
|
|
|
|
|
|
|
|
// println!("{:}", sfs.free_map.read());
|
|
|
|
sfs.root_inode()
|
|
|
|
sfs.root_inode()
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|