-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added printheap option to shell.
- Loading branch information
Showing
17 changed files
with
251 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,4 +26,8 @@ path = "ls.rs" | |
|
||
[[bin]] | ||
name = "stat" | ||
path = "stat.rs" | ||
path = "stat.rs" | ||
|
||
[[bin]] | ||
name = "ps" | ||
path = "ps.rs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#![feature(alloc)] | ||
#![feature(start)] | ||
#![no_main] | ||
#![no_std] | ||
|
||
#[macro_use] | ||
extern crate std; | ||
|
||
use std::io; | ||
|
||
#[no_mangle] | ||
pub unsafe fn main(_argc: usize, _argv: *const *const u8) { | ||
let mut occupied_size = 0; | ||
for i in 0..100 { | ||
if let Some(proc_info) = std::syscalls::proc_info(i) { | ||
println!("Process number {}", i); | ||
println!("\tProcess start: {:#x}", proc_info.process_base); | ||
println!("\tProcess end: {:#x}", proc_info.process_total_size); | ||
occupied_size += proc_info.process_total_size as usize; | ||
} else { | ||
break; | ||
} | ||
} | ||
let total_size = std::syscalls::get_proccess_area_size(); | ||
let free = total_size - occupied_size; | ||
println!("\n===== Process area info ====="); | ||
println!("Total: {} bytes.", total_size); | ||
println!("Free: {} bytes.", free); | ||
println!("Occupied: {} bytes.", occupied_size); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.