Add memory information
This commit is contained in:
parent
c3648d1cc4
commit
6927a4c5cf
1 changed files with 76 additions and 3 deletions
10
kernel/scheme/sys/memory.rs
Normal file
10
kernel/scheme/sys/memory.rs
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
use collections::Vec;
|
||||
|
||||
use arch::memory::{free_frames, used_frames};
|
||||
use syscall::error::Result;
|
||||
|
||||
pub fn resource() -> Result<Vec<u8>> {
|
||||
let string = format!("Memory Used: {} KB\nMemory Free: {} KB\n", used_frames() * 4, free_frames() * 4);
|
||||
|
||||
Ok(string.into_bytes())
|
||||
}
|
||||
Loading…
Reference in a new issue