rustubs/kthread/
meeseeks.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//! a noisy dummy task to test the system
use crate::kthread::KThread;
use crate::proc::task::Task;

pub struct Meeseeks {}

impl KThread for Meeseeks {
	fn entry() -> ! {
		let t = Task::current().unwrap();
		sprintln!("I'm Mr.Meeseeks {}, look at me~", t.pid);
		let mm = &t.mm;
		for vma in &mm.vmas {
			println!("{:#?}", vma);
		}
		loop {
			let t = Task::current().unwrap();
			sprintln!("I'm {}", t.pid);
			t.nanosleep(2_000_000_000);
		}
	}
}